Skip to main content

CLI Reference

ClawDesk ships a single binary, clawdesk, built with clap derive. Every interaction—starting the gateway, sending messages, managing channels—goes through this CLI.

clawdesk [OPTIONS] <COMMAND>

Global Options

FlagShortEnv VarDefaultDescription
--config <PATH>-cCLAWDESK_CONFIG~/.clawdesk/config.tomlPath to configuration file
--log-level <LEVEL>-lCLAWDESK_LOGinfoLog level: trace, debug, info, warn, error
--data-dir <PATH>-dCLAWDESK_DATA_DIR~/.clawdesk/dataData directory for sessions, memory, and plugins
--no-colorNO_COLORfalseDisable colored output
--json-jfalseOutput in JSON format
--quiet-qfalseSuppress non-essential output
--verbose-vfalseEnable verbose logging (same as --log-level debug)

Commands Overview


gateway

Start the ClawDesk gateway server.

clawdesk gateway [OPTIONS]

Options

FlagShortDefaultDescription
--host <ADDR>-H0.0.0.0Bind address
--port <PORT>-p1420HTTP port
--ws-port <PORT>1421WebSocket port (0 = same as HTTP)
--tls-cert <PATH>TLS certificate file
--tls-key <PATH>TLS private key file
--workers <N>-wCPU countNumber of async worker threads
--max-sessions <N>1000Maximum concurrent sessions
--cors-origin <ORIGIN>*CORS allowed origins (comma-separated)
--no-discoveryfalseDisable mDNS service discovery
--pid-file <PATH>Write PID to file
--daemonfalseRun in background (Unix only)

Examples

# Start with defaults
clawdesk gateway

# Production setup
clawdesk gateway \
--host 0.0.0.0 \
--port 8443 \
--tls-cert /etc/clawdesk/cert.pem \
--tls-key /etc/clawdesk/key.pem \
--workers 8 \
--max-sessions 5000

# Development with verbose logging
clawdesk gateway -p 3000 -l debug
tip

Use --daemon and --pid-file together for systemd-free deployments:

clawdesk gateway --daemon --pid-file /var/run/clawdesk.pid

message

Send a one-shot message through the agent pipeline without starting a persistent gateway.

clawdesk message [OPTIONS] <TEXT>

Options

FlagShortDefaultDescription
--provider <NAME>-Pconfig defaultProvider to use (anthropic, openai, ollama, etc.)
--model <MODEL>-mprovider defaultModel identifier
--session <ID>-snew sessionResume an existing session
--system <PROMPT>config defaultSystem prompt override
--temperature <F>-t0.7Sampling temperature
--max-tokens <N>4096Maximum response tokens
--tools <LIST>all enabledComma-separated tool allowlist
--no-streamfalseWait for complete response (no streaming)
--output <FILE>-ostdoutWrite response to file
--attach <FILE>-aAttach file(s) to the message

Examples

# Simple question
clawdesk message "What is the capital of France?"

# Use a specific provider and model
clawdesk message -P anthropic -m claude-sonnet-4-20250514 "Explain monads"

# Continue a conversation
clawdesk message -s sess_abc123 "Tell me more about that"

# Pipe input
echo "Summarize this" | clawdesk message -

# Attach files
clawdesk message -a report.pdf "Summarize the attached document"

# Save response
clawdesk message -o response.md "Write a project plan"
info

When stdin is not a TTY and no TEXT argument is given, clawdesk message reads from stdin automatically.


channels

Manage messaging channel connections.

clawdesk channels <SUBCOMMAND>

Subcommands

SubcommandDescription
listShow all configured channels and their status
add <TYPE>Add a new channel interactively
remove <ID>Remove a channel by ID
start <ID>Start a specific channel
stop <ID>Stop a specific channel
restart <ID>Restart a specific channel
status <ID>Show detailed status for a channel
test <ID>Send a test message through the channel
logs <ID>Tail channel-specific logs

channels list

clawdesk channels list [--format table|json|csv]

Example output:

┌────────────┬──────────┬─────────┬───────────┬──────────────┐
│ ID │ Type │ Status │ Messages │ Last Active │
├────────────┼──────────┼─────────┼───────────┼──────────────┤
│ tg_main │ Telegram │ Running │ 14,302 │ 2 min ago │
│ dc_server │ Discord │ Running │ 8,451 │ 5 min ago │
│ sl_work │ Slack │ Stopped │ 0 │ 3 days ago │
│ wc_public │ WebChat │ Running │ 231 │ 1 min ago │
└────────────┴──────────┴─────────┴───────────┴──────────────┘

channels add

clawdesk channels add telegram --token "BOT_TOKEN" --name "My Bot"
clawdesk channels add discord --token "BOT_TOKEN" --guild-id 123456
clawdesk channels add slack --app-token "xapp-..." --bot-token "xoxb-..."
clawdesk channels add webchat --port 8080 --allowed-origins "https://example.com"
warning

Channel tokens are stored encrypted in the data directory. Never pass tokens via command-line in shared environments—use environment variables or interactive mode:

clawdesk channels add telegram  # Prompts for token interactively

plugins

Manage the plugin ecosystem.

clawdesk plugins <SUBCOMMAND>

Subcommands

SubcommandDescription
listList installed plugins
install <SOURCE>Install a plugin from path, URL, or registry
uninstall <NAME>Remove a plugin
enable <NAME>Enable a disabled plugin
disable <NAME>Disable a plugin without removing
update [NAME]Update one or all plugins
inspect <NAME>Show plugin metadata and capabilities
create <NAME>Scaffold a new plugin project

Examples

# Install from the plugin registry
clawdesk plugins install clawdesk-plugin-weather

# Install from a local path
clawdesk plugins install ./my-plugin/

# Install from a git URL
clawdesk plugins install https://github.com/user/clawdesk-plugin-rag.git

# Create a new plugin scaffold
clawdesk plugins create my-awesome-plugin --lang rust

# Inspect plugin details
clawdesk plugins inspect weather

cron

Manage scheduled tasks.

clawdesk cron <SUBCOMMAND>

Subcommands

SubcommandDescription
listShow all scheduled tasks
addCreate a new scheduled task
remove <ID>Remove a task
enable <ID>Enable a paused task
disable <ID>Pause a task
run <ID>Trigger immediate execution
history <ID>Show execution history

Examples

# Add a daily summary task
clawdesk cron add \
--name "daily-summary" \
--schedule "0 9 * * *" \
--channel tg_main \
--message "Generate a summary of yesterday's conversations"

# List all tasks
clawdesk cron list

# View execution history
clawdesk cron history daily-summary --limit 20

# Trigger a task now
clawdesk cron run daily-summary

agent

Configure and manage agent behavior.

clawdesk agent <SUBCOMMAND>

Subcommands

SubcommandDescription
showDisplay current agent configuration
set <KEY> <VALUE>Set an agent configuration value
resetReset to default configuration
toolsList available tools and their status
tools enable <NAME>Enable a tool
tools disable <NAME>Disable a tool
pipeline showDisplay the current pipeline stage order
pipeline set <STAGES>Set custom pipeline stage order

Examples

# Show current config
clawdesk agent show

# Set default provider
clawdesk agent set provider anthropic
clawdesk agent set model claude-sonnet-4-20250514

# Manage tools
clawdesk agent tools
clawdesk agent tools enable web_search
clawdesk agent tools disable code_execution

# View pipeline
clawdesk agent pipeline show

config

Manage ClawDesk configuration.

clawdesk config <SUBCOMMAND>

Subcommands

SubcommandDescription
showDisplay the full resolved configuration
get <KEY>Get a specific configuration value
set <KEY> <VALUE>Set a configuration value
editOpen config in $EDITOR
validateValidate the configuration file
resetReset to defaults
pathPrint the config file path
exportExport config (redacting secrets)
import <FILE>Import a configuration file

Examples

# Show full config
clawdesk config show

# Set values
clawdesk config set gateway.port 8443
clawdesk config set providers.anthropic.api_key "sk-ant-..."
clawdesk config set memory.embedding_provider ollama

# Validate
clawdesk config validate

# Export (safe to share)
clawdesk config export > my-config.toml

login

Authenticate with provider APIs.

clawdesk login [OPTIONS] [PROVIDER]

Options

FlagDescription
--api-key <KEY>Set API key directly
--browserOpen browser for OAuth flow
--checkVerify existing credentials
--revokeRemove stored credentials

Examples

# Interactive login
clawdesk login anthropic

# Set API key directly
clawdesk login openai --api-key "sk-..."

# Verify all credentials
clawdesk login --check

# Revoke a provider
clawdesk login anthropic --revoke

doctor

Diagnose system health and configuration issues.

clawdesk doctor [OPTIONS]

Options

FlagDescription
--fixAttempt to automatically fix issues
--verboseShow detailed diagnostic information
--check <NAME>Run a specific check only

Checks Performed

CheckDescription
configConfiguration file syntax and schema
providersAPI key validity and connectivity
channelsChannel token validity
memoryEmbedding model availability
pluginsPlugin integrity and dependencies
networkNetwork connectivity and DNS
storageData directory permissions and disk space
versionVersion compatibility

Example Output

$ clawdesk doctor
🔍 Running diagnostics...

✅ Configuration valid config at ~/.clawdesk/config.toml
✅ Anthropic provider API key valid, claude-sonnet-4-20250514 available
⚠️ OpenAI provider API key set but rate-limited
✅ Telegram channel bot token valid, webhook configured
❌ Slack channel app token expired — run `clawdesk login slack`
✅ Memory system embedding model loaded (384 dims)
✅ Plugins 3 plugins loaded, 0 errors
✅ Network all endpoints reachable
✅ Storage 14.2 GB free

Found 1 error and 1 warning.
Run `clawdesk doctor --fix` to attempt automatic fixes.

init

Initialize a new ClawDesk configuration.

clawdesk init [OPTIONS] [PATH]

Options

FlagDescription
--template <NAME>Use a predefined template (minimal, standard, full)
--non-interactiveSkip prompts, use defaults
--forceOverwrite existing configuration

Example

# Interactive setup
clawdesk init

# Minimal config in a custom directory
clawdesk init --template minimal /path/to/project

# CI/CD setup
clawdesk init --template standard --non-interactive

The init wizard walks through:

  1. Provider selection and API key entry
  2. Default model selection
  3. Channel setup
  4. Memory configuration
  5. Security defaults

completions

Generate shell completions.

clawdesk completions <SHELL>

Supported shells: bash, zsh, fish, elvish, powershell.

Setup

# Zsh
clawdesk completions zsh > ~/.zfunc/_clawdesk
echo 'fpath=(~/.zfunc $fpath)' >> ~/.zshrc

# Bash
clawdesk completions bash > /usr/local/etc/bash_completion.d/clawdesk

# Fish
clawdesk completions fish > ~/.config/fish/completions/clawdesk.fish

security

Manage security policies and audit logs.

clawdesk security <SUBCOMMAND>

Subcommands

SubcommandDescription
allowlist showDisplay the current allowlist
allowlist add <PATTERN>Add an allowlist entry
allowlist remove <PATTERN>Remove an allowlist entry
acl showShow access control rules
acl grant <USER> <ROLE>Grant a role to a user
acl revoke <USER> <ROLE>Revoke a role from a user
audit tailTail the audit log
audit exportExport audit log
audit verifyVerify hash-chain integrity
scan <TEXT>Test content against scanning rules
token createCreate a scoped API token
token revoke <ID>Revoke an API token
token listList active API tokens

Examples

# Manage allowlist
clawdesk security allowlist add "user:12345"
clawdesk security allowlist show

# Check audit integrity
clawdesk security audit verify

# Create a scoped token
clawdesk security token create \
--scope "read:sessions,write:messages" \
--expires "30d" \
--name "ci-bot"

# Test content scanning
echo "DROP TABLE users;" | clawdesk security scan

Environment Variables

All CLI flags can be set via environment variables with the CLAWDESK_ prefix:

VariableDescription
CLAWDESK_CONFIGConfig file path
CLAWDESK_DATA_DIRData directory path
CLAWDESK_LOGLog level
CLAWDESK_GATEWAY_HOSTGateway bind address
CLAWDESK_GATEWAY_PORTGateway port
CLAWDESK_ANTHROPIC_API_KEYAnthropic API key
CLAWDESK_OPENAI_API_KEYOpenAI API key
CLAWDESK_OLLAMA_URLOllama server URL
CLAWDESK_GEMINI_API_KEYGemini API key
CLAWDESK_AWS_REGIONAWS region for Bedrock
CLAWDESK_TELEGRAM_TOKENTelegram bot token
CLAWDESK_DISCORD_TOKENDiscord bot token
CLAWDESK_SLACK_APP_TOKENSlack app token
CLAWDESK_SLACK_BOT_TOKENSlack bot token
tip

Environment variables take precedence over config file values but are overridden by explicit CLI flags. The precedence order is:

CLI flags > Environment variables > Config file > Defaults


Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments or usage
3Configuration error
4Authentication error
5Network/connectivity error
10Provider error
11Channel error
12Plugin error
130Interrupted (Ctrl+C)