clawdesk-cli
Clap-based CLI binary providing 12 subcommands for running, managing, and inspecting ClawDesk. This is the primary entry point for server-side usage.
Dependencies
Internal: clawdesk-types, clawdesk-gateway, clawdesk-domain, clawdesk-storage, clawdesk-sochdb, clawdesk-providers, clawdesk-channels, clawdesk-agents, clawdesk-infra
External: clap, tokio, anyhow, tracing-subscriber, serde
Subcommands
| Command | Description |
|---|---|
serve | Start the gateway HTTP/WS server |
chat | Interactive CLI chat session |
config | Display or validate configuration |
sessions | List or manage sessions |
models | List available models |
channels | List registered channels |
migrate | Run database migrations |
compact | Compact a session's context |
health | Check gateway health |
plugins | List or manage plugins |
cron | List or trigger cron tasks |
version | Print version information |
Key Types
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "clawdesk", version, about = "Multi-channel AI agent gateway")]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
/// Configuration file path
#[arg(short, long, default_value = "./config.toml")]
pub config: PathBuf,
/// Log level
#[arg(short, long, default_value = "info")]
pub log_level: String,
}
#[derive(Subcommand)]
pub enum Command {
/// Start the gateway server
Serve {
#[arg(short, long, default_value = "0.0.0.0")]
host: String,
#[arg(short, long, default_value = "1420")]
port: u16,
},
/// Interactive chat session
Chat {
#[arg(short, long)]
model: Option<String>,
#[arg(short, long)]
session: Option<String>,
},
/// Display configuration
Config {
#[arg(long)]
validate: bool,
},
// ... 9 more subcommands
}
Example Usage
# Start the server
clawdesk serve --port 1420
# Interactive chat
clawdesk chat --model claude-sonnet-4-20250514
# List sessions
clawdesk sessions --limit 10
# List models
clawdesk models
# Check health
clawdesk health
# Validate config
clawdesk config --validate
# Compact a session
clawdesk compact --session sess_abc123
# Run migrations
clawdesk migrate
# Version info
clawdesk version
Configuration
The CLI reads from config.toml by default. Override with --config:
clawdesk --config /etc/clawdesk/production.toml serve
Environment variables override config file values:
CLAWDESK_LOG=debug ANTHROPIC_API_KEY=sk-ant-... clawdesk serve
tip
Use clawdesk chat for quick testing without starting the full gateway. It connects directly to the provider without HTTP overhead.