Clawdbot Gateway Configuration

Complete guide to configuring Clawdbot AI assistant gateway. Learn about configuration options, environment variables, and advanced settings.

Clawdbot Gateway Configuration Overview

The Clawdbot gateway is configured through ~/.clawdbot/clawdbot.json. This guide covers all configuration options for customizing your gateway.

Configuration File

Location

~/.clawdbot/clawdbot.json

Basic Structure

{
  "gateway": {
    "port": 3010,
    "host": "localhost"
  },
  "providers": {},
  "agents": {},
  "tools": {},
  "sessions": {}
}

Gateway Settings

Core Settings

{
  "gateway": {
    "port": 3010,
    "host": "localhost",
    "logLevel": "info",
    "maxConnections": 100
  }
}

Options

OptionDefaultDescription
port3010WebSocket server port
hostlocalhostBind address
logLevelinfoLog verbosity
maxConnections100Max concurrent connections

Provider Configuration

WhatsApp

{
  "providers": {
    "whatsapp": {
      "enabled": true,
      "authStrategy": "qr",
      "dmPolicy": "main"
    }
  }
}

Telegram

{
  "providers": {
    "telegram": {
      "enabled": true,
      "token": "${TELEGRAM_BOT_TOKEN}"
    }
  }
}

Discord

{
  "providers": {
    "discord": {
      "enabled": true,
      "token": "${DISCORD_BOT_TOKEN}",
      "intents": ["GUILDS", "GUILD_MESSAGES", "DIRECT_MESSAGES"]
    }
  }
}

Agent Configuration

Single Agent

{
  "agents": {
    "main": {
      "workspace": "~/.clawdbot/workspace",
      "model": "claude-3-sonnet"
    }
  }
}

Multi-Agent

{
  "agents": {
    "main": {
      "workspace": "~/.clawdbot/agents/main/workspace"
    },
    "work": {
      "workspace": "~/.clawdbot/agents/work/workspace"
    }
  }
}

Session Configuration

Session Policy

{
  "sessions": {
    "dmScope": "main",
    "resetTime": "04:00",
    "idleMinutes": 60,
    "maxHistory": 100
  }
}

Session Options

OptionDefaultDescription
dmScopemainDM session scope
resetTime04:00Daily reset time
idleMinutesnullIdle timeout
maxHistory100Max messages in history

Tool Configuration

Tool Policy

{
  "tools": {
    "profile": "full",
    "allow": ["*"],
    "deny": ["browser"]
  }
}

Provider-Specific Tools

{
  "tools": {
    "byProvider": {
      "whatsapp": {
        "deny": ["exec"]
      }
    }
  }
}

Environment Variables

Using Env Vars

{
  "providers": {
    "telegram": {
      "token": "${TELEGRAM_BOT_TOKEN}"
    }
  }
}

Common Variables

VariableDescription
CLAWDBOT_CONFIGConfig file path
CLAWDBOT_LOG_LEVELLog level override
CLAWDBOT_PORTPort override

CLI Configuration

Override Config

clawdbot gateway start --port 3011 --log-level debug

Config Commands

# View current config
clawdbot config get

# Set config value
clawdbot config set gateway.port 3011

# Reset to defaults
clawdbot config reset

Advanced Settings

Performance

{
  "gateway": {
    "messageBuffer": 1000,
    "processTimeout": 30000,
    "streamChunkSize": 50
  }
}

Limits

{
  "limits": {
    "maxMessageLength": 10000,
    "maxConcurrentRequests": 10,
    "rateLimitPerMinute": 60
  }
}

Next Steps