All clawq configuration lives in a single JSON file at ~/.clawq/config.json. This page covers every configuration section, the interactive wizard, programmatic access via the CLI, and environment variables.

Configuration Methods

Interactive Wizard

The recommended way to configure clawq for the first time:

clawq onboard       # full onboarding wizard
clawq config wizard # re-run the wizard any time

The wizard walks through provider, model, security, channels, gateway, and memory settings. When run in a TTY, it launches a full interactive TUI. When piped or redirected, it falls back to generating a starter template.

CLI Set/Get/Show

Manage individual values by dot-path:

# Set a value
clawq config set providers.0.api_key "sk-..."
clawq config set channels.telegram.enabled true

# Read a value
clawq config get providers.0.model

# Show full config (secrets redacted)
clawq config show

# Show a specific section
clawq config show security
clawq config show channels

Manual Editing

$EDITOR ~/.clawq/config.json

After editing, validate with:

clawq doctor

Environment Variables

VariablePurpose
CLAWQ_MASTER_KEYPassphrase for encrypting/decrypting API keys at rest (AES-256-GCM via PBKDF2)

When security.encrypt_secrets is true and CLAWQ_MASTER_KEY is set, API keys are automatically decrypted at runtime. Encrypted values are stored with a $ENC: prefix.

Configuration Sections

providers

An array of LLM provider configurations. The first provider is used by default.

{
  "providers": [
    {
      "name": "openrouter",
      "api_key": "sk-or-v1-...",
      "base_url": "https://openrouter.ai/api/v1",
      "model": "openai/gpt-4o"
    },
    {
      "name": "openai",
      "api_key": "sk-...",
      "base_url": "https://api.openai.com/v1",
      "model": "gpt-4o"
    }
  ]
}
FieldRequiredDescription
nameYesProvider identifier
api_keyYesAPI key (or $ENC:... encrypted value)
base_urlNoAPI base URL (defaults to OpenAI)
modelNoDefault model for this provider

channels

Channel configurations for Telegram, Discord, and Slack.

{
  "channels": {
    "telegram": {
      "enabled": true,
      "bot_token": "7123456789:AAF1k...",
      "allow_from": ["*"]
    },
    "discord": {
      "enabled": true,
      "bot_token": "MTIz...",
      "application_id": "123456789"
    },
    "slack": {
      "enabled": true,
      "bot_token": "xoxb-...",
      "app_token": "xapp-...",
      "signing_secret": "abc123..."
    }
  }
}

Telegram fields:

FieldDescription
enabledEnable/disable this channel
bot_tokenBot token from @BotFather
allow_fromArray of allowed chat IDs, or ["*"] for all users

Discord fields:

FieldDescription
enabledEnable/disable this channel
bot_tokenBot token from Discord Developer Portal
application_idApplication ID from Discord Developer Portal

Slack fields:

FieldDescription
enabledEnable/disable this channel
bot_tokenBot token (xoxb-...)
app_tokenApp-level token (xapp-...) for Socket Mode
signing_secretSigning secret for Events API HMAC verification

security

{
  "security": {
    "workspace_only": true,
    "tools_enabled": true,
    "audit_enabled": true,
    "encrypt_secrets": false,
    "rate_limit_rpm": 60,
    "audit_retention_days": 90
  }
}
FieldDefaultDescription
workspace_onlytrueRestrict file operations to workspace directory
tools_enabledtrueEnable agent tool invocations
audit_enabledtrueEnable audit logging of tool invocations and security events
encrypt_secretsfalseEncrypt API keys at rest using CLAWQ_MASTER_KEY
rate_limit_rpm60Requests per minute rate limit
audit_retention_days90Days to retain audit log entries

gateway

{
  "gateway": {
    "host": "127.0.0.1",
    "port": 13451
  }
}
FieldDefaultDescription
host127.0.0.1Gateway bind address
port13451Gateway port

memory

{
  "memory": {
    "backend": "sqlite",
    "search_enabled": true,
    "embedding_provider": "openai",
    "embedding_model": "text-embedding-3-small",
    "vector_weight": 50,
    "keyword_weight": 50,
    "ttl_days": 365
  }
}
FieldDefaultDescription
backendsqliteMemory backend type
search_enabledfalseEnable hybrid vector + FTS search
embedding_providerProvider for generating embeddings
embedding_modelModel for generating embeddings
vector_weight50Weight for vector similarity results (must sum to 100 with keyword_weight)
keyword_weight50Weight for keyword FTS results
ttl_days365Days before memory entries expire

resilience

{
  "resilience": {
    "timeout_s": 120.0,
    "max_retries": 2,
    "base_delay_s": 1.0,
    "fallback_provider": "groq"
  }
}
FieldDefaultDescription
timeout_s120.0Timeout for LLM API calls in seconds
max_retries2Maximum retry attempts with exponential backoff
base_delay_s1.0Base delay between retries
fallback_providerProvider name to use if primary fails

mcp

{
  "mcp": {
    "enabled": true,
    "exposed_tools": ["file_read", "file_write", "shell_exec"]
  }
}
FieldDefaultDescription
enabledfalseEnable the MCP server (JSON-RPC via stdio)
exposed_toolsallArray of tool names to expose (omit for all)

Full Example

{
  "providers": [
    {
      "name": "openrouter",
      "api_key": "sk-or-v1-...",
      "base_url": "https://openrouter.ai/api/v1",
      "model": "openai/gpt-4o"
    }
  ],
  "channels": {
    "telegram": {
      "enabled": true,
      "bot_token": "7123456789:AAF1k...",
      "allow_from": ["*"]
    }
  },
  "security": {
    "workspace_only": true,
    "tools_enabled": true,
    "audit_enabled": true,
    "encrypt_secrets": false
  },
  "gateway": {
    "host": "127.0.0.1",
    "port": 13451
  },
  "memory": {
    "backend": "sqlite",
    "search_enabled": false
  },
  "resilience": {
    "timeout_s": 120.0,
    "max_retries": 2
  }
}

Secret Encryption

To encrypt API keys at rest:

  1. Set security.encrypt_secrets to true
  2. Set the CLAWQ_MASTER_KEY environment variable with a strong passphrase
  3. Run clawq auth encrypt to encrypt all plaintext API keys
  4. Keys are stored as $ENC:... values and automatically decrypted at runtime