2026-02-01 22:47:44 +01:00
|
|
|
|
---
|
|
|
|
|
|
read_when:
|
2026-02-02 15:46:45 +01:00
|
|
|
|
- 你想以非交互方式读取或编辑配置
|
2026-02-03 13:23:00 -08:00
|
|
|
|
summary: "`openclaw config` 的 CLI 参考(获取/设置/取消设置配置值)"
|
2026-02-01 22:47:44 +01:00
|
|
|
|
title: config
|
|
|
|
|
|
x-i18n:
|
2026-02-03 13:23:00 -08:00
|
|
|
|
generated_at: "2026-02-03T10:04:13Z"
|
2026-02-01 22:47:44 +01:00
|
|
|
|
model: claude-opus-4-5
|
|
|
|
|
|
provider: pi
|
|
|
|
|
|
source_hash: d60a35f5330f22bc99a0df090590586109d329ddd2ca294aeed191a22560c1c2
|
|
|
|
|
|
source_path: cli/config.md
|
2026-02-03 13:23:00 -08:00
|
|
|
|
workflow: 15
|
2026-02-01 22:47:44 +01:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
# `openclaw config`
|
|
|
|
|
|
|
2026-02-03 13:23:00 -08:00
|
|
|
|
配置辅助命令:通过路径获取/设置/取消设置值。不带子命令运行将打开
|
|
|
|
|
|
配置向导(与 `openclaw configure` 相同)。
|
2026-02-01 22:47:44 +01:00
|
|
|
|
|
|
|
|
|
|
## 示例
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
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
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 路径
|
|
|
|
|
|
|
2026-02-03 13:23:00 -08:00
|
|
|
|
路径使用点号或括号表示法:
|
2026-02-01 22:47:44 +01:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
openclaw config get agents.defaults.workspace
|
|
|
|
|
|
openclaw config get agents.list[0].id
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-03 13:23:00 -08:00
|
|
|
|
使用智能体列表索引来定位特定智能体:
|
2026-02-01 22:47:44 +01:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
openclaw config get agents.list
|
|
|
|
|
|
openclaw config set agents.list[1].tools.exec.node "node-id-or-name"
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 值
|
|
|
|
|
|
|
2026-02-03 13:23:00 -08:00
|
|
|
|
值会尽可能解析为 JSON5;否则将被视为字符串。
|
2026-02-01 22:47:44 +01:00
|
|
|
|
使用 `--json` 强制要求 JSON5 解析。
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
openclaw config set agents.defaults.heartbeat.every "0m"
|
|
|
|
|
|
openclaw config set gateway.port 19001 --json
|
|
|
|
|
|
openclaw config set channels.whatsapp.groups '["*"]' --json
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-03 13:23:00 -08:00
|
|
|
|
编辑后请重启 Gateway 网关。
|