Development Setup
This guide walks you through setting up a local development environment for contributing to ClawDesk.
Prerequisites
| Tool | Minimum Version | Purpose |
|---|---|---|
| Rust | 1.75+ | Core language (rustup recommended) |
| Cargo | Latest stable | Build system & package manager |
| Node.js | 18+ | Tauri frontend & docs site |
| pnpm | 8+ | Frontend package management |
| Git | 2.30+ | Version control |
| Docker | 24+ | Optional — containerized testing |
Platform-Specific Dependencies
macOS:
xcode-select --install
brew install cmake openssl protobuf
Linux (Debian/Ubuntu):
sudo apt update && sudo apt install -y \
build-essential pkg-config libssl-dev libgtk-3-dev \
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev \
librsvg2-dev protobuf-compiler
Clone & Build
# Clone the repository
git clone https://github.com/anthropics/clawdesk.git
cd clawdesk
# Build the entire workspace
cargo build
# Build in release mode (uses fat LTO — takes longer)
cargo build --release
tip
The workspace uses edition = "2021" and rust-version = "1.75". If your toolchain is older, run rustup update stable.
Running Tests
# Run all 610 tests
cargo test --workspace
# Run tests for a specific crate
cargo test -p clawdesk-domain
# Run with output displayed
cargo test --workspace -- --nocapture
Running the Gateway
# Copy the example config
cp sochdb-server-config.toml.example sochdb-server-config.toml
# Set required environment variables
export CLAWDESK_CONFIG_PATH=./config.toml
export ANTHROPIC_API_KEY=sk-ant-...
# Start the gateway server
cargo run -p clawdesk-cli -- serve
Running the Desktop App (Tauri)
cd crates/clawdesk-tauri
# Install frontend dependencies
pnpm install
# Start in development mode (hot-reload)
cargo tauri dev
IDE Setup
VS Code (Recommended)
Install the following extensions:
| Extension | ID | Purpose |
|---|---|---|
| rust-analyzer | rust-lang.rust-analyzer | Rust language server |
| Even Better TOML | tamasfe.even-better-toml | Cargo.toml support |
| crates | serayuzgur.crates | Dependency version hints |
| Error Lens | usernamehw.errorlens | Inline error display |
Recommended .vscode/settings.json:
{
"rust-analyzer.cargo.features": "all",
"rust-analyzer.check.command": "clippy",
"rust-analyzer.check.extraArgs": ["--workspace"],
"rust-analyzer.procMacro.enable": true,
"editor.formatOnSave": true,
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
}
}
JetBrains (RustRover / CLion)
- Open the workspace root
Cargo.toml - Enable Expand declarative macros in Rust settings
- Set the toolchain to stable 1.75+
Environment Variables
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY | For Anthropic provider | API key for Claude models |
OPENAI_API_KEY | For OpenAI provider | API key for GPT models |
GOOGLE_API_KEY | For Gemini provider | API key for Gemini models |
CLAWDESK_CONFIG_PATH | No | Path to config file (default: ./config.toml) |
CLAWDESK_LOG | No | Log level filter (default: info) |
CLAWDESK_DB_PATH | No | SochDB data directory |
TELEGRAM_BOT_TOKEN | For Telegram channel | Bot token from @BotFather |
DISCORD_BOT_TOKEN | For Discord channel | Bot token from Discord Developer Portal |
SLACK_BOT_TOKEN | For Slack channel | Bot OAuth token |
Docker Development
# Build the development image
docker compose build
# Run the full stack
docker compose up -d
# Tail logs
docker compose logs -f gateway
Next Steps
- Read the Coding Standards before writing code
- Review the Testing Guide for test conventions
- Check the Pull Request Workflow for contribution flow