Config helpers for non-interactive edits inDocumentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
Repeatable guided-setup section filter when you run
openclaw config without a subcommand.workspace, model, web, gateway, daemon, channels, plugins, skills, health.
Examples
config schema
Print the generated JSON schema for openclaw.json to stdout as JSON.
What it includes
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
Related runtime RPC
Paths
Paths use dot or bracket notation: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.
config get <path> --json prints the raw value as JSON instead of terminal-formatted text.
Object assignment replaces the target path by default. Protected map/list paths that commonly hold user-added entries, such as
agents.defaults.models, models.providers, models.providers.<id>.models, plugins.entries, and auth.profiles, refuse replacements that would remove existing entries unless you pass --replace.--merge when adding entries to those maps:
--replace only when you intentionally want the provided value to become the complete target value.
config set modes
openclaw config set supports four assignment styles:
- Value mode
- SecretRef builder mode
- Provider builder mode
- Batch mode
--batch-json/--batch-file) as the source of truth. --strict-json / --json do not change batch parsing behavior.
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.
--replace-path <path> when one object or array must become exactly the provided value instead of being recursively patched:
--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:
Provider builder flags
Provider builder targets must usesecrets.providers.<alias> as the path.
Common flags
Common flags
--provider-source <env|file|exec>--provider-timeout-ms <ms>(file,exec)
Env provider (--provider-source env)
Env provider (--provider-source env)
--provider-allowlist <ENV_VAR>(repeatable)
File provider (--provider-source file)
File provider (--provider-source file)
--provider-path <path>(required)--provider-mode <singleValue|json>--provider-max-bytes <bytes>--provider-allow-insecure-path
Exec provider (--provider-source exec)
Exec provider (--provider-source exec)
--provider-command <path>(required)--provider-arg <arg>(repeatable)--provider-no-output-timeout-ms <ms>--provider-max-output-bytes <bytes>--provider-json-only--provider-env <KEY=VALUE>(repeatable)--provider-pass-env <ENV_VAR>(repeatable)--provider-trusted-dir <path>(repeatable)--provider-allow-insecure-path--provider-allow-symlink-command
Dry run
Use--dry-run to validate changes without writing openclaw.json.
Dry-run behavior
Dry-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 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 schema/resolvability failures whenok=false
JSON output shape
- Success example
- Failure example
If dry-run fails
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 <n> exec SecretRef resolvability check(s): dry-run skipped exec refs; rerun with--allow-execif you need exec resolvability validation.- For batch mode, fix failing entries and rerun
--dry-runbefore writing.
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:
plugins.entries.<id>..., OpenClaw keeps the active openclaw.json in place and reports the plugin-local issue instead of restoring .last-good. This prevents plugin schema changes or minHostVersion skew from rolling back unrelated user settings such as models, providers, auth profiles, channels, gateway exposure, tools, memory, browser, or cron config.
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.
Validate
Validate the current config against the active schema without starting the gateway.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:
If validation is already failing, start with
openclaw configure or openclaw doctor --fix. openclaw chat does not bypass the invalid-config guard.Compare with docs
Ask the agent to compare your current config with the relevant docs page and suggest the smallest fix.