openclaw config

設定輔助工具:依路徑取得/設定/刪除/驗證值,以及列印目前使用的設定檔。不帶子指令執行時會開啟設定精靈(等同 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 list 索引指定特定 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