Development Guide
This guide covers setting up a development environment for contributing to Kerminal.
Prerequisites
Ensure you have the following installed:
| Tool | Version | Purpose |
|---|---|---|
| Node.js | 20+ | Frontend development |
| Rust | Latest stable | Backend (Tauri) |
| Tauri CLI | Latest | Build tooling |
Install Rust
bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/envInstall Tauri CLI
bash
cargo install tauri-cliPlatform-Specific Dependencies
Linux (Debian/Ubuntu)
bash
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-devLinux (Arch Linux)
bash
sudo pacman -S webkit2gtk \
base-devel \
curl \
wget \
file \
openssl \
appmenu-gtk-module \
libappindicator-gtk3 \
librsvgLinux (Fedora)
bash
sudo dnf install webkit2gtk4.1-devel \
openssl-devel \
curl \
wget \
file \
libxdo-devel \
libappindicator-gtk3-devel \
librsvg2-develmacOS
bash
xcode-select --installWindows
Install Visual Studio Build Tools with C++ workload.
Getting Started
Clone Repository
bash
git clone https://github.com/klpod221/kerminal.git
cd kerminalInstall Dependencies
bash
npm installDevelopment Mode
bash
npm run tauri devThis will:
- Start the Vite dev server (hot reload)
- Compile the Rust backend
- Launch the Tauri window
Production Build
bash
npm run tauri buildOutput will be in src-tauri/target/release/bundle/.
Project Structure
kerminal/
├── src/ # Vue 3 frontend
│ ├── components/ # Vue components
│ ├── stores/ # Pinia stores
│ ├── views/ # Page views
│ ├── composables/ # Vue composables
│ └── assets/ # Static assets
├── src-tauri/ # Rust backend
│ ├── src/
│ │ ├── commands/ # Tauri commands
│ │ ├── models/ # Data models
│ │ ├── services/ # Business logic
│ │ └── main.rs # Entry point
│ ├── Cargo.toml # Rust dependencies
│ └── tauri.conf.json # Tauri configuration
├── docs/ # VitePress documentation
├── public/ # Public assets
└── package.json # Node.js dependenciesKey Technologies
Frontend
| Technology | Purpose |
|---|---|
| Vue 3 | UI framework |
| TypeScript | Type safety |
| Pinia | State management |
| xterm.js | Terminal emulation |
| TailwindCSS | Styling |
Backend
| Technology | Purpose |
|---|---|
| Tauri v2 | Desktop framework |
| Tokio | Async runtime |
| russh | SSH implementation |
| SQLx | Database access |
| AES-GCM | Encryption |
Code Style
Frontend (TypeScript/Vue)
- Use Composition API with
<script setup> - Follow Vue 3 style guide
- Use Prettier for formatting
bash
npm run prettyBackend (Rust)
- Follow Rust idioms
- Use
cargo fmtfor formatting - Run
cargo clippyfor lints
bash
cargo fmt
cargo clippyTesting
Frontend Tests
bash
# Coming soon
npm run testBackend Tests
bash
cd src-tauri
cargo testContributing
Workflow
- Fork the repository
- Create a feature branchbash
git checkout -b feature/amazing-feature - Make your changes
- Run tests and linting
- Commit with descriptive messagebash
git commit -m 'Add amazing feature' - Push to your forkbash
git push origin feature/amazing-feature - Open a Pull Request
Commit Messages
Follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentationstyle:Formattingrefactor:Code refactoringtest:Testschore:Maintenance
Pull Request Guidelines
- Clear description of changes
- Link related issues
- Include screenshots for UI changes
- Update documentation if needed
- Ensure all checks pass
Debugging
Frontend
Use Vue DevTools browser extension for Vue debugging.
Backend
Enable debug logging:
bash
RUST_LOG=debug npm run tauri devNetwork
For SSH debugging, enable verbose SSH output in development builds.
Building for Release
All Platforms
bash
npm run tauri buildSpecific Platform
bash
# Linux
npm run tauri build -- --target x86_64-unknown-linux-gnu
# Windows
npm run tauri build -- --target x86_64-pc-windows-msvc
# macOS (Intel)
npm run tauri build -- --target x86_64-apple-darwin
# macOS (Apple Silicon)
npm run tauri build -- --target aarch64-apple-darwin