Skip to main content

Development Setup

This guide walks you through setting up a local development environment for contributing to ClawDesk.

Prerequisites

ToolMinimum VersionPurpose
Rust1.75+Core language (rustup recommended)
CargoLatest stableBuild system & package manager
Node.js18+Tauri frontend & docs site
pnpm8+Frontend package management
Git2.30+Version control
Docker24+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

Install the following extensions:

ExtensionIDPurpose
rust-analyzerrust-lang.rust-analyzerRust language server
Even Better TOMLtamasfe.even-better-tomlCargo.toml support
cratesserayuzgur.cratesDependency version hints
Error Lensusernamehw.errorlensInline 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)

  1. Open the workspace root Cargo.toml
  2. Enable Expand declarative macros in Rust settings
  3. Set the toolchain to stable 1.75+

Environment Variables

VariableRequiredDescription
ANTHROPIC_API_KEYFor Anthropic providerAPI key for Claude models
OPENAI_API_KEYFor OpenAI providerAPI key for GPT models
GOOGLE_API_KEYFor Gemini providerAPI key for Gemini models
CLAWDESK_CONFIG_PATHNoPath to config file (default: ./config.toml)
CLAWDESK_LOGNoLog level filter (default: info)
CLAWDESK_DB_PATHNoSochDB data directory
TELEGRAM_BOT_TOKENFor Telegram channelBot token from @BotFather
DISCORD_BOT_TOKENFor Discord channelBot token from Discord Developer Portal
SLACK_BOT_TOKENFor Slack channelBot 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