配置管理
Clawdbot 从 ~/.clawdbot/clawdbot.json 读取配置,使用 JSON5 格式。
配置验证
系统执行严格的 schema 验证。如果配置无效,网关拒绝启动:
clawdbot doctor核心配置
{
// 工作目录
workspace: "~/clawd",
// 网关设置
gateway: {
bind: "127.0.0.1:18789",
token: "your-secure-token"
},
// 渠道配置
channels: {
whatsapp: { enabled: true },
telegram: { enabled: true }
},
// 代理配置
agents: {
default: {
workspace: "~/clawd",
sandbox: "host"
}
}
}文件包含
使用 $include 指令分割配置:
{
$include: ["./channels.json", "./agents.json"]
}环境变量
敏感信息可以通过环境变量设置:
export CLAWDBOT_GATEWAY_TOKEN="..."
export TELEGRAM_BOT_TOKEN="..."