openclaw config
配置辅助工具:按路径 get/set/unset/validate 配置值,以及打印当前活跃的配置文件路径。不带子命令直接运行会打开配置向导(与 openclaw configure 相同)。
示例
openclaw config file
openclaw config get browser.executablePath
openclaw config set browser.executablePath "/usr/bin/google-chrome"
openclaw config set agents.defaults.heartbeat.every "2h"
openclaw config set agents.list[0].tools.exec.node "node-id-or-name"
openclaw config unset tools.web.search.apiKey
openclaw config validate
openclaw config validate --json
路径
路径使用点号或方括号表示法:
openclaw config get agents.defaults.workspace
openclaw config get agents.list[0].id
使用 Agent 列表索引来定位特定 Agent:
openclaw config get agents.list
openclaw config set agents.list[1].tools.exec.node "node-id-or-name"
值
值会尽量解析为 JSON5;解析不了的按字符串处理。
使用 --strict-json 强制要求 JSON5 解析。--json 作为旧版别名仍然支持。
openclaw config set agents.defaults.heartbeat.every "0m"
openclaw config set gateway.port 19001 --strict-json
openclaw config set channels.whatsapp.groups '["*"]' --strict-json
子命令
config file:打印当前活跃的配置文件路径(从OPENCLAW_CONFIG_PATH或默认位置解析)。
修改后记得重启 Gateway。
验证
在不启动 Gateway 的情况下,根据当前 schema 验证配置。
openclaw config validate
openclaw config validate --json