Config
Config helpers for non-interactive edits in openclaw.json: get/set/patch/unset/file/schema/validate values by path and print the active config file. Run without a subcommand to open the configure wizard (same as openclaw configure).
Root options
Section titled “Root options”Supported guided sections: workspace, model, web, gateway, daemon, channels, plugins, skills, health.
Examples
Section titled “Examples”openclaw config fileopenclaw config --section modelopenclaw config --section gateway --section daemonopenclaw config schemaopenclaw config get browser.executablePathopenclaw config set browser.executablePath "/usr/bin/google-chrome"openclaw config set browser.profiles.work.executablePath "/Applications/Google Chrome.app/Contents/MacOS/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 set agents.defaults.models '{"openai/gpt-5.4":{}}' --strict-json --mergeopenclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKENopenclaw config set secrets.providers.vaultfile --provider-source file --provider-path /etc/openclaw/secrets.json --provider-mode jsonopenclaw config patch --file ./openclaw.patch.json5 --dry-runopenclaw config unset plugins.entries.brave.config.webSearch.apiKeyopenclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN --dry-runopenclaw config validateopenclaw config validate --jsonconfig schema
Section titled “config schema”Print the generated JSON schema for openclaw.json to stdout as JSON.
What it includes
- The current root config schema, plus a root
$schemastring field for editor tooling. - Field
titleanddescriptiondocs metadata used by the Control UI. - Nested object, wildcard (
*), and array-item ([]) nodes inherit the sametitle/descriptionmetadata when matching field documentation exists. anyOf/oneOf/allOfbranches inherit the same docs metadata too when matching field documentation exists.- Best-effort live plugin + channel schema metadata when runtime manifests can be loaded.
- A clean fallback schema even when the current config is invalid.
Related runtime RPC
config.schema.lookup returns one normalized config path with a shallow schema node (title, description, type, enum, const, common bounds), matched UI hint metadata, and immediate child summaries. Use it for path-scoped drill-down in Control UI or custom clients.
openclaw config schemaPipe it into a file when you want to inspect or validate it with other tools:
openclaw config schema > openclaw.schema.jsonPaths use dot or bracket notation. Quote bracket-notation paths in shell examples so shells such as zsh do not expand [0] as a glob before OpenClaw receives the path:
openclaw config get agents.defaults.workspaceopenclaw config get 'agents.list[0].id'Use the agent list index to target a specific agent:
openclaw config get agents.listopenclaw config set 'agents.list[1].tools.exec.node' "node-id-or-name"Values
Section titled “Values”Values are parsed as JSON5 when possible; otherwise they are treated as strings. Use --strict-json to require JSON5 parsing. --json remains supported as a legacy alias.
openclaw config set agents.defaults.heartbeat.every "0m"openclaw config set gateway.port 19001 --strict-jsonopenclaw config set channels.whatsapp.groups '["*"]' --strict-jsonconfig get <path> --json prints the raw value as JSON instead of terminal-formatted text.
Use --merge when adding entries to those maps:
openclaw config set agents.defaults.models '{"openai/gpt-5.4":{}}' --strict-json --mergeopenclaw config set models.providers.ollama.models '[{"id":"llama3.2","name":"Llama 3.2"}]' --strict-json --mergeUse --replace only when you intentionally want the provided value to become the complete target value.
config set modes
Section titled “config set modes”openclaw config set supports four assignment styles:
openclaw config setopenclaw config set channels.discord.token \ --ref-provider default \ --ref-source env \ --ref-id DISCORD_BOT_TOKENProvider builder mode targets `secrets.providers.
` paths only:
```bashopenclaw config set secrets.providers.vault \ --provider-source exec \ --provider-command /usr/local/bin/openclaw-vault \ --provider-arg read \ --provider-arg openai/api-key \ --provider-timeout-ms 5000```openclaw config set --batch-json '[ { "path": "secrets.providers.default", "provider": { "source": "env" } }, { "path": "channels.discord.token", "ref": { "source": "env", "provider": "default", "id": "DISCORD_BOT_TOKEN" } }]'openclaw config set --batch-file ./config-set.batch.json --dry-runBatch parsing always uses the batch payload (--batch-json/--batch-file) as the source of truth. --strict-json / --json do not change batch parsing behavior.
config patch
Section titled “config patch”Use config patch when you want to paste or pipe a config-shaped patch instead of running many path-based config set commands. The input is a JSON5 object. Objects merge recursively, arrays and scalar values replace the target value, and null deletes the target path.
openclaw config patch --file ./openclaw.patch.json5 --dry-runopenclaw config patch --file ./openclaw.patch.json5You can also pipe a patch over stdin, which is useful for remote setup scripts:
ssh openclaw-host 'openclaw config patch --stdin --dry-run' < ./openclaw.patch.json5ssh openclaw-host 'openclaw config patch --stdin' < ./openclaw.patch.json5Example patch:
{ channels: { slack: { enabled: true, mode: "socket", botToken: { source: "env", provider: "default", id: "SLACK_BOT_TOKEN" }, appToken: { source: "env", provider: "default", id: "SLACK_APP_TOKEN" }, groupPolicy: "open", requireMention: false, }, discord: { enabled: true, token: { source: "env", provider: "default", id: "DISCORD_BOT_TOKEN" }, dmPolicy: "disabled", dm: { enabled: false }, groupPolicy: "allowlist", }, }, agents: { defaults: { model: { primary: "openai/gpt-5.5" }, models: { "openai/gpt-5.5": { params: { fastMode: true } }, }, }, },}Use --replace-path <path> when one object or array must become exactly the provided value instead of being recursively patched:
openclaw config patch --file ./discord.patch.json5 --replace-path 'channels.discord.guilds["123"].channels'--dry-run runs schema and SecretRef resolvability checks without writing. Exec-backed SecretRefs are skipped by default during dry-run; add --allow-exec when you intentionally want dry-run to execute provider commands.
JSON path/value mode remains supported for both SecretRefs and providers:
openclaw config set channels.discord.token \ '{"source":"env","provider":"default","id":"DISCORD_BOT_TOKEN"}' \ --strict-json
openclaw config set secrets.providers.vaultfile \ '{"source":"file","path":"/etc/openclaw/secrets.json","mode":"json"}' \ --strict-jsonProvider builder flags
Section titled “Provider builder flags”Provider builder targets must use secrets.providers.<alias> as the path.
Common flags
- `—provider-source
-—provider-timeout-ms
(file, exec`)
Env provider (--provider-source env)
- `—provider-allowlist
` (repeatable)
File provider (--provider-source file)
- `—provider-path
(required) -—provider-mode
-—provider-max-bytes
-—provider-allow-insecure-path`
Exec provider (--provider-source exec)
- `—provider-command
(required) -—provider-arg
(repeatable) -—provider-no-output-timeout-ms
-—provider-max-output-bytes
-—provider-json-only -—provider-env
(repeatable) -—provider-pass-env
(repeatable) -—provider-trusted-dir
(repeatable) -—provider-allow-insecure-path -—provider-allow-symlink-command`
Hardened exec provider example:
openclaw config set secrets.providers.vault \ --provider-source exec \ --provider-command /usr/local/bin/openclaw-vault \ --provider-arg read \ --provider-arg openai/api-key \ --provider-json-only \ --provider-pass-env VAULT_TOKEN \ --provider-trusted-dir /usr/local/bin \ --provider-timeout-ms 5000Dry run
Section titled “Dry run”Use --dry-run to validate changes without writing openclaw.json.
openclaw config set channels.discord.token \ --ref-provider default \ --ref-source env \ --ref-id DISCORD_BOT_TOKEN \ --dry-run
openclaw config set channels.discord.token \ --ref-provider default \ --ref-source env \ --ref-id DISCORD_BOT_TOKEN \ --dry-run \ --json
openclaw config set channels.discord.token \ --ref-provider vault \ --ref-source exec \ --ref-id discord/token \ --dry-run \ --allow-execDry-run behavior
- Builder mode: runs SecretRef resolvability checks for changed refs/providers.
- JSON mode (
--strict-json,--json, or batch mode): runs schema validation plus SecretRef resolvability checks. - Policy validation also runs for known unsupported SecretRef target surfaces.
- Policy checks evaluate the full post-change config, so parent-object writes (for example setting
hooksas an object) cannot bypass unsupported-surface validation. - Exec SecretRef checks are skipped by default during dry-run to avoid command side effects.
- Use
--allow-execwith--dry-runto opt in to exec SecretRef checks (this may execute provider commands). --allow-execis dry-run only and errors if used without--dry-run.
--dry-run --json fields
--dry-run --json prints a machine-readable report:
ok: whether dry-run passedoperations: number of assignments evaluatedchecks: whether schema/resolvability checks ranchecks.resolvabilityComplete: whether resolvability checks ran to completion (false when exec refs are skipped)refsChecked: number of refs actually resolved during dry-runskippedExecRefs: number of exec refs skipped because--allow-execwas not seterrors: structured missing-path, schema, or resolvability failures whenok=false
JSON output shape
Section titled “JSON output shape”{ ok: boolean, operations: number, configPath: string, inputModes: ["value" | "json" | "builder" | "unset", ...], checks: { schema: boolean, resolvability: boolean, resolvabilityComplete: boolean, }, refsChecked: number, skippedExecRefs: number, errors?: [ { kind: "missing-path" | "schema" | "resolvability", message: string, ref?: string, // present for resolvability errors }, ],}{ "ok": true, "operations": 1, "configPath": "~/.openclaw/openclaw.json", "inputModes": ["builder"], "checks": { "schema": false, "resolvability": true, "resolvabilityComplete": true }, "refsChecked": 1, "skippedExecRefs": 0}{ "ok": false, "operations": 1, "configPath": "~/.openclaw/openclaw.json", "inputModes": ["builder"], "checks": { "schema": false, "resolvability": true, "resolvabilityComplete": true }, "refsChecked": 1, "skippedExecRefs": 0, "errors": [ { "kind": "resolvability", "message": "Error: Environment variable \"MISSING_TEST_SECRET\" is not set.", "ref": "env:default:MISSING_TEST_SECRET" } ]}If dry-run fails
config schema validation failed: your post-change config shape is invalid; fix path/value or provider/ref object shape.Config policy validation failed: unsupported SecretRef usage: move that credential back to plaintext/string input and keep SecretRefs on supported surfaces only.SecretRef assignment(s) could not be resolved: referenced provider/ref currently cannot resolve (missing env var, invalid file pointer, exec provider failure, or provider/source mismatch).- `Dry run note: skipped
exec SecretRef resolvability check(s): dry-run skipped exec refs; rerun with —allow-exec` if you need exec resolvability validation.
- For batch mode, fix failing entries and rerun
--dry-runbefore writing.
Write safety
Section titled “Write safety”openclaw config set and other OpenClaw-owned config writers validate the full post-change config before committing it to disk. If the new payload fails schema validation or looks like a destructive clobber, the active config is left alone and the rejected payload is saved beside it as openclaw.json.rejected.*.
Prefer CLI writes for small edits:
openclaw config set gateway.reload.mode hybrid --dry-runopenclaw config set gateway.reload.mode hybridopenclaw config validateIf a write is rejected, inspect the saved payload and fix the full config shape:
CONFIG="$(openclaw config file)"ls -lt "$CONFIG".rejected.* 2>/dev/null | headopenclaw config validateDirect editor writes are still allowed, but the running Gateway treats them as untrusted until they validate. Invalid direct edits fail startup or are skipped by hot reload; Gateway does not rewrite openclaw.json. Run openclaw doctor --fix to repair prefixed/clobbered config or restore the last-known-good copy. See Gateway troubleshooting.
Whole-file recovery is reserved for doctor repair. Plugin schema changes or minHostVersion skew stay loud instead of rolling back unrelated user settings such as models, providers, auth profiles, channels, gateway exposure, tools, memory, browser, or cron config.
Subcommands
Section titled “Subcommands”config file: Print the active config file path (resolved fromOPENCLAW_CONFIG_PATHor default location). The path should name a regular file, not a symlink.
Restart the gateway after edits.
Validate
Section titled “Validate”Validate the current config against the active schema without starting the gateway.
openclaw config validateopenclaw config validate --jsonAfter openclaw config validate is passing, you can use the local TUI to have an embedded agent compare the active config against the docs while you validate each change from the same terminal:
openclaw chatThen inside the TUI:
!openclaw config file!openclaw docs gateway auth token secretref!openclaw config validate!openclaw doctorTypical repair loop:
Compare with docs
Ask the agent to compare your current config with the relevant docs page and suggest the smallest fix.
Apply targeted edits
Apply targeted edits with
openclaw config setoropenclaw configure.Re-validate
Rerun
openclaw config validateafter each change.Doctor for runtime issues
If validation passes but the runtime is still unhealthy, run
openclaw doctororopenclaw doctor --fixfor migration and repair help.