docs: correct directory JSON failure envelope (#124989)

* docs: correct directory JSON failure envelope

* docs(cli): document canonical config and directory JSON failures

Preserve the contributor directory error-envelope correction and update config get to distinguish schema-valid unset paths from unknown paths while linking the shared canonical CLI JSON failure contract.

Co-authored-by: qingminlong <qing.minlong@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
qingminlong
2026-08-25 03:48:27 +08:00
committed by GitHub
parent b4c620b157
commit 97cc8d6d34
2 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -60,7 +60,9 @@ openclaw config set 'agents.entries.work.tools.exec.node' "node-id-or-name"
Reads a value from the redacted config snapshot (secrets never print). `--json` prints the same redacted value as JSON; otherwise strings/numbers/booleans print bare and objects/arrays print as formatted JSON.
When the path is missing, `--json` writes `{ "error": "Config path not found: <path>" }` to stdout and exits with status 1. Without `--json`, the diagnostic remains on stderr.
A schema-valid but unset path explains that the runtime default applies; an unknown path suggests
`openclaw config schema`. With `--json`, both use the standard [CLI JSON failure envelope](/cli#json-failures)
on stdout and exit with status 1. Without `--json`, diagnostics remain on stderr.
```bash
openclaw config get browser.executablePath
+3 -2
View File
@@ -19,8 +19,9 @@ Results are meant to be pasted into other commands, especially `openclaw message
- `--json`: output JSON
Default output renders IDs and names in a table. Empty list results name the channel and account
that were queried; JSON list output uses an empty array (`[]`). Failures exit nonzero and use an
`{ "error": "..." }` object in JSON mode.
that were queried; JSON list output uses an empty array (`[]`). Failures exit nonzero and use the
canonical `{ "ok": false, "error": { "type": "cli_error", "message": "..." } }` envelope in
JSON mode.
## Notes