OpenClaw配置
OpenClaw Configuration
OpenClaw的配置文件是整个系统的核心。通过合理的配置,你可以让OpenClaw按你的需求工作。
OpenClaw's config file is the core of the entire system. With proper configuration, you can make OpenClaw work according to your needs.
配置文件基础
Config File Basics
OpenClaw的配置文件位于 ~/.openclaw/openclaw.json。首次运行时会自动创建默认配置。
OpenClaw's config file is located at ~/.openclaw/openclaw.json. Default configuration is automatically created on first run.
多渠道接入
Multi-Channel Integration
OpenClaw支持多个聊天平台,你可以在配置中启用或禁用不同渠道。
OpenClaw supports multiple chat platforms. You can enable or disable different channels in the configuration.
Telegram
Telegram
在Telegram中与 @BotFather 对话,创建新bot,获取bot token。
Chat with @BotFather in Telegram, create a new bot, and get the bot token.
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "your-telegram-bot-token"
}
}
}
获取WhatsApp Business API访问权限,配置allowFrom白名单(推荐)。
Get WhatsApp Business API access, configure allowFrom whitelist (recommended).
{
"channels": {
"whatsapp": {
"enabled": true,
"allowFrom": ["+1234567890"]
}
}
}
安全提示: 对于WhatsApp,强烈建议设置allowFrom白名单。
Security Tip: For WhatsApp, it's strongly recommended to set an allowFrom whitelist.
代理配置
Agent Configuration
你可以创建多个具有不同角色和能力的AI代理,每个代理可以有不同的配置。
You can create multiple AI agents with different roles and capabilities. Each agent can have different configurations.
简单代理配置
Simple Agent Config
{
"agents": {
"default": {
"name": "助手",
"model": "deepseekv4",
"systemPrompt": "你是一个友好的AI助手。"
}
}
}
常用工具: web_search(网络搜索)、file_read(读取文件)、file_write(写入文件)、memory(记忆管理)
Common Tools: web_search, file_read, file_write, memory
常见问题
FAQ
Q: 如何测试配置是否正确?
Q: How to test if configuration is correct?
A: 运行 openclaw gateway status 检查配置。
A: Run openclaw gateway status to check configuration.
下一步
Next Steps
- 学习构建实战应用