Development
Set up the kftray development environment and use the mise tasks for building, testing and formatting.
kftray uses mise for development tools and tasks. For platform dependencies and release builds, see building from source. For the pull request process, see contributing.
Prerequisites
mise
Install mise. It manages the other development tools and the tasks:
curl https://mise.run | shAfter the installation, restart your terminal or run:
source ~/.bashrc # or ~/.zshrcmise installs the tools pinned in .mise.toml:
- Node.js 26
- pnpm 12
- syft and grype (for the
sbom:*tasks)
mise run setup installs the system dependencies and the pnpm packages, including the Tauri CLI.
Rust
mise doesn't install Rust. Install it with rustup, along with the nightly rustfmt that mise run format:back uses:
rustup toolchain install stable
rustup toolchain install nightly --profile minimal --component rustfmtmise run test:back also needs cargo-llvm-cov and cargo-nextest:
cargo install --locked cargo-llvm-cov cargo-nextestQuick start
# Clone the repository
git clone https://github.com/hcavarsan/kftray.git
cd kftray
# Install tools defined in .mise.toml
mise install
# Set up system dependencies and install project dependencies
mise run setup
# Start development
mise run devDevelopment workflow
First-time setup
# Install mise-managed tools (Node, pnpm, syft, grype)
mise install
# Install system dependencies (webkit, build tools, etc.)
# This detects your OS and installs the right packages
mise run setupDaily development
# Start development mode (hot reload enabled)
mise run dev
# In another terminal, run tests
mise run test:back
# Format and lint before committing
mise run format
mise run lintmise run dev builds the kftray-helper binary in release mode first, then starts pnpm tauri dev.
Building
# Build production app
mise run build
# Build only the UI
mise run build:ui
# Build with bundle analysis
mise run build:analyzeFor platform requirements and build outputs, see Building from Source.
Available tasks
Run mise tasks to see all available tasks. These are the most common ones.
Development
| Task | Description |
|---|---|
mise run dev | Start Tauri development mode (hot reload) |
mise run build | Build the production application |
mise run build:ui | Build only the frontend UI |
mise run build:analyze | Build with bundle size analysis |
Code quality
| Task | Description |
|---|---|
mise run format | Format the frontend (Biome) and backend (rustfmt) |
mise run format:front | Format only the frontend code |
mise run format:back | Format only the backend code |
mise run lint | Lint with auto-fix (Biome and Clippy) |
mise run lint:front | Lint the frontend with auto-fix |
mise run lint:back | Lint the backend with auto-fix |
mise run check | TypeScript type checking |
Testing
| Task | Description |
|---|---|
mise run test:back | Run the Rust backend tests with coverage |
mise run test:server | Run the Docker proxy tests |
Pre-commit
| Task | Description |
|---|---|
mise run precommit | Run format, lint, SBOM scan and backend tests |
mise run precommit:hook | Format, run cargo check and stage tracked changes |
Utilities
| Task | Description |
|---|---|
mise run setup | Set up the development environment |
mise run generate-icons | Generate application icons |
mise run knip | Detect unused exports in the frontend |
Version management
| Task | Description |
|---|---|
mise run bump:patch | Bump the patch version (0.0.x) |
mise run bump:minor | Bump the minor version (0.x.0) |
mise run bump:major | Bump the major version (x.0.0) |
Project structure
kftray/
├── .mise.toml # mise configuration (tools + tasks)
├── frontend/ # React + TypeScript UI
│ ├── src/
│ └── package.json
├── crates/ # Rust workspace
│ ├── kftray-tauri/ # Desktop app (Tauri)
│ ├── kftui/ # Terminal UI
│ ├── kftray-server/ # Proxy relay server
│ ├── kftray-portforward/# Port forwarding logic
│ └── ...
├── hacks/ # Utility scripts
│ ├── setup.sh # OS-specific setup script
│ └── ...
└── README.md # Project overview and documentation linksSee Architecture for what each crate does.
Documentation
Guides live in kftray-blog/content/docs.
Update the corresponding MDX page when app behavior or development commands change. Repository READMEs provide short introductions and links to these pages.
When adding a page, include it in its directory's meta.json navigation. Publish new site routes before repository links that depend on them.
The version bump utility updates package manifests and Tauri configuration. Documentation downloads link to the website instead of requiring version updates in local Markdown guides.
Git workflow
Pre-commit hook
The repository doesn't install a Git hook. mise run precommit:hook is meant to be used as one. It:
Formats all code (Biome and rustfmt).
Runs cargo check on the workspace.
Stages every modified tracked file with git add -u.
Run it before you commit, or call it from your own .git/hooks/pre-commit.
To bypass the hook (not recommended):
git commit --no-verifyPull requests
- Fork and clone the repository.
- Create a feature branch:
git checkout -b feature/my-feature. - Make your changes.
- Run
mise run formatandmise run lint, then commit. - Push and create a pull request.
CI runs these checks:
- Format check
- Lint check (no auto-fix in CI)
- Backend tests with coverage
- Frontend bundle analysis
See Contributing for the full pull request and merge process.
Testing
Backend tests
# Run all backend tests with coverage
mise run test:back
# Run a specific test
cargo test test_nameFrontend type checking
# Check TypeScript types
mise run checkDocker proxy tests
# Test TCP/UDP proxy functionality
mise run test:serverTroubleshooting
mise not found
After installing mise, restart your terminal or run:
source ~/.bashrc # or ~/.zshrcSystem dependencies missing
Run the setup task again. It detects your OS and installs the missing dependencies:
mise run setupTool version mismatch
Reinstall the tools to get the versions pinned in .mise.toml:
mise installPort already in use
Tauri uses a default development port. In tauri.conf.json the dev URL is http://localhost:1420. Stop any process that uses the port:
# macOS/Linux
lsof -ti:PORT | xargs kill -9
# Windows
netstat -ano | findstr :PORT
taskkill /PID <PID> /FPre-commit hook failing
If you call mise run precommit:hook from your own Git hook, it runs mise run format and cargo check. If it fails:
- Check the error message.
- Fix the issue manually.
- Try committing again.
Or run the checks manually:
mise run format
mise run lintBuilding fails on Windows
Check that you have:
- Microsoft C++ Build Tools installed
- WebView2 Runtime installed
- NASM installed (for some dependencies)
Run mise run setup to see detailed instructions.
Node and pnpm version issues
mise manages the Node and pnpm versions. If you have version issues:
# Check installed versions
mise ls
# Reinstall tools
mise install --forceAdditional resources
- Tauri documentation
- mise documentation
- Contributing
- Building from Source
- Linux packaging for maintainers who publish the Linux packages
- Security for the SBOM and vulnerability scan that
mise run precommitruns
Getting help
- Check the Issues page.
- Join the Slack community.