mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 18:20:22 +00:00
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:
@@ -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:
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user