diff --git a/docs/cli/config.md b/docs/cli/config.md index a0fae0301df..60b64cd6fb3 100644 --- a/docs/cli/config.md +++ b/docs/cli/config.md @@ -48,7 +48,14 @@ openclaw config validate --json ### `config schema` -Print the generated JSON schema for `openclaw.json` to stdout as plain text. +Print the generated JSON schema for `openclaw.json` to stdout as JSON. + +What it includes: + +- The current root config schema, plus a root `$schema` string field for editor tooling +- Field `title` and `description` metadata derived from the same labels/help used by the Control UI +- Best-effort live plugin + channel schema metadata when runtime manifests can be loaded +- A clean fallback schema even when the current config is invalid ```bash openclaw config schema diff --git a/docs/cli/index.md b/docs/cli/index.md index 8ade759e3dd..550706c53cf 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -577,7 +577,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 `: remove a value. - `config file`: print the active config file path. -- `config schema`: print the generated JSON schema for `openclaw.json`. +- `config schema`: print the generated JSON schema for `openclaw.json`, including field docs and best-effort live plugin/channel schema metadata. - `config validate`: validate the current config against the schema without starting the gateway. - `config validate --json`: emit machine-readable JSON output. diff --git a/docs/gateway/configuration.md b/docs/gateway/configuration.md index 4578d3b0a72..7df771da285 100644 --- a/docs/gateway/configuration.md +++ b/docs/gateway/configuration.md @@ -51,7 +51,9 @@ See the [full reference](/gateway/configuration-reference) for every available f Open [http://127.0.0.1:18789](http://127.0.0.1:18789) and use the **Config** tab. - The Control UI renders a form from the config schema, with a **Raw JSON** editor as an escape hatch. + The Control UI renders a form from the live config schema, including field + labels/help plus plugin and channel schemas when available, with a **Raw + JSON** editor as an escape hatch. Edit `~/.openclaw/openclaw.json` directly. The Gateway watches the file and applies changes automatically (see [hot reload](#config-hot-reload)). @@ -64,6 +66,15 @@ See the [full reference](/gateway/configuration-reference) for every available f OpenClaw only accepts configurations that fully match the schema. Unknown keys, malformed types, or invalid values cause the Gateway to **refuse to start**. The only root-level exception is `$schema` (string), so editors can attach JSON Schema metadata. +Schema tooling notes: + +- `openclaw config schema` prints the same JSON Schema family used by Control UI + and config validation. +- Field `title` and `description` values are carried into the schema output for + editor and form tooling. +- Runtime plugin/channel schemas are merged in when the gateway can load the + current manifest registry. + When validation fails: - The Gateway does not boot diff --git a/docs/gateway/protocol.md b/docs/gateway/protocol.md index b2db787e77e..9a5cd16df92 100644 --- a/docs/gateway/protocol.md +++ b/docs/gateway/protocol.md @@ -275,8 +275,12 @@ Gateway exposes today. - `config.set` writes a validated config payload. - `config.patch` merges a partial config update. - `config.apply` validates + replaces the full config payload. -- `config.schema` and `config.schema.lookup` expose the live config schema and - lookup helpers used by Control UI and CLI tooling. +- `config.schema` returns the live config schema payload used by Control UI and + CLI tooling: schema, `uiHints`, version, and generation metadata, including + plugin + channel schema metadata when the runtime can load it. +- `config.schema.lookup` returns a path-scoped lookup payload for one config + path: normalized path, a shallow schema node with field docs, matched hint + + `hintPath`, and immediate child summaries for UI/CLI drill-down. - `update.run` runs the gateway update flow and schedules a restart only when the update itself succeeded. - `wizard.start`, `wizard.next`, `wizard.status`, and `wizard.cancel` expose the diff --git a/docs/web/control-ui.md b/docs/web/control-ui.md index 0cfa7ce61f6..5c6158ec241 100644 --- a/docs/web/control-ui.md +++ b/docs/web/control-ui.md @@ -92,7 +92,9 @@ The Control UI can localize itself on first load based on your browser locale, a - Config: apply + restart with validation (`config.apply`) and wake the last active session - Config writes include a base-hash guard to prevent clobbering concurrent edits - Config writes (`config.set`/`config.apply`/`config.patch`) also preflight active SecretRef resolution for refs in the submitted config payload; unresolved active submitted refs are rejected before write -- Config schema + form rendering (`config.schema`, including plugin + channel schemas); Raw JSON editor is available only when the snapshot has a safe raw round-trip +- Config schema + form rendering (`config.schema` / `config.schema.lookup`, + including field labels/help plus plugin + channel schemas when available); + Raw JSON editor is available only when the snapshot has a safe raw round-trip - If a snapshot cannot safely round-trip raw text, Control UI forces Form mode and disables Raw mode for that snapshot - Structured SecretRef object values are rendered read-only in form text inputs to prevent accidental object-to-string corruption - Debug: status/health/models snapshots + event log + manual RPC calls (`status`, `health`, `models.list`)