feat(cli): add json schema to cli tool (#54523)

Merged via squash.

Prepared head SHA: 39c15ee70d
Co-authored-by: kvokka <15954013+kvokka@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
Mikhail Beliakov
2026-03-26 06:30:32 +07:00
committed by GitHub
parent ab37d8810d
commit fd934a566b
18 changed files with 674 additions and 76 deletions

View File

@@ -1,5 +1,5 @@
---
summary: "CLI reference for `openclaw config` (get/set/unset/file/validate)"
summary: "CLI reference for `openclaw config` (get/set/unset/file/schema/validate)"
read_when:
- You want to read or edit config non-interactively
title: "config"
@@ -7,7 +7,7 @@ title: "config"
# `openclaw config`
Config helpers for non-interactive edits in `openclaw.json`: get/set/unset/validate
Config helpers for non-interactive edits in `openclaw.json`: get/set/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`).
@@ -15,6 +15,7 @@ open the configure wizard (same as `openclaw configure`).
```bash
openclaw config file
openclaw config schema
openclaw config get browser.executablePath
openclaw config set browser.executablePath "/usr/bin/google-chrome"
openclaw config set agents.defaults.heartbeat.every "2h"
@@ -27,7 +28,21 @@ openclaw config validate
openclaw config validate --json
```
## Paths
### `config schema`
Print the generated JSON schema for `openclaw.json` to stdout as plain text.
```bash
openclaw config schema
```
Pipe it into a file when you want to inspect or validate it with other tools:
```bash
openclaw config schema > openclaw.schema.json
```
### Paths
Paths use dot or bracket notation:

View File

@@ -396,7 +396,7 @@ Interactive configuration wizard (models, channels, skills, gateway).
### `config`
Non-interactive config helpers (get/set/unset/file/validate). Running `openclaw config` with no
Non-interactive config helpers (get/set/unset/file/schema/validate). Running `openclaw config` with no
subcommand launches the wizard.
Subcommands:
@@ -413,6 +413,7 @@ Subcommands:
- `config set --strict-json`: require JSON5 parsing for path/value input. `--json` remains a legacy alias for strict parsing outside dry-run output mode.
- `config unset <path>`: remove a value.
- `config file`: print the active config file path.
- `config schema`: print the generated JSON schema for `openclaw.json`.
- `config validate`: validate the current config against the schema without starting the gateway.
- `config validate --json`: emit machine-readable JSON output.