Install
openclaw skills install openclaw-config-guideOpenClaw configuration management best practices and common pitfalls. Use when: (1) User needs to modify OpenClaw configuration, (2) User asks about config paths or structure, (3) User encountered config errors, (4) Adding new providers or channels, (5) Before making any config changes - to avoid common mistakes like wrong paths or direct JSON editing.
openclaw skills install openclaw-config-guide本技能提供 OpenClaw 配置管理的最佳实践,帮助避免常见错误。
永远不要用 write 或 edit 直接修改配置文件!
❌ 错误方式:
~/.openclaw/openclaw.jsonplugins.entries.discord.botToken)✅ 正确方式:
gateway config.get 查看当前配置gateway config.patch 做增量修改gateway config.get 验证每次修改配置前,按此顺序执行:
读取现有配置
gateway config.get
目的:确认当前结构,避免猜测路径
确认正确路径
参考 references/common-paths.md 查找正确的配置项路径
原则:不确定时,宁可多看一眼,不要盲猜
使用 patch 修改
gateway config.patch
{
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_TOKEN"
}
}
}
验证修改结果
gateway config.get
确认修改生效,无语法错误
// ❌ 错误路径
{
"plugins": {
"entries": {
"discord": {
"botToken": "xxx" // 错误!
}
}
}
}
// ✅ 正确路径
{
"channels": {
"discord": {
"token": "xxx" // 正确!
}
}
}
// ❌ 危险!会丢失其他所有配置
gateway config.apply
{ ...新配置... }
// ✅ 安全!只修改指定部分
gateway config.patch
{ ...部分配置... }
references/common-paths.md
| 命令 | 用途 |
|---|---|
gateway config.get | 查看当前完整配置 |
gateway config.patch | 增量修改配置(推荐) |
gateway config.apply | 完全替换配置(危险) |
gateway config.schema | 查看配置 JSON Schema |
common-paths.md记住:配置错误会导致 OpenClaw 无法启动,务必谨慎!