feat(config): add openclaw config validate and improve startup error messages (#31220)

Merged via squash.

Prepared head SHA: 4598f2a541
Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Sid
2026-03-02 13:45:51 +08:00
committed by GitHub
parent 5a2200b280
commit 3002f13ca7
8 changed files with 232 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
---
summary: "CLI reference for `openclaw config` (get/set/unset values and config file path)"
summary: "CLI reference for `openclaw config` (get/set/unset/file/validate)"
read_when:
- You want to read or edit config non-interactively
title: "config"
@@ -7,8 +7,8 @@ title: "config"
# `openclaw config`
Config helpers: get/set/unset values by path and print the active config file.
Run without a subcommand to open
Config helpers: get/set/unset/validate values by path and print the active
config file. Run without a subcommand to open
the configure wizard (same as `openclaw configure`).
## Examples
@@ -20,6 +20,8 @@ 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
```
## Paths
@@ -54,3 +56,13 @@ openclaw config set channels.whatsapp.groups '["*"]' --strict-json
- `config file`: Print the active config file path (resolved from `OPENCLAW_CONFIG_PATH` or default location).
Restart the gateway after edits.
## Validate
Validate the current config against the active schema without starting the
gateway.
```bash
openclaw config validate
openclaw config validate --json
```

View File

@@ -380,7 +380,7 @@ Interactive configuration wizard (models, channels, skills, gateway).
### `config`
Non-interactive config helpers (get/set/unset/file). Running `openclaw config` with no
Non-interactive config helpers (get/set/unset/file/validate). Running `openclaw config` with no
subcommand launches the wizard.
Subcommands:
@@ -389,6 +389,8 @@ Subcommands:
- `config set <path> <value>`: set a value (JSON5 or raw string).
- `config unset <path>`: remove a value.
- `config file`: print the active config file path.
- `config validate`: validate the current config against the schema without starting the gateway.
- `config validate --json`: emit machine-readable JSON output.
### `doctor`