openclaw/docs/cli/policy
Leon-SK668 a339211296
fix(policy): emit JSON for command-owned CLI failures (#181758)
fix(policy): print JSON errors on stdout for policy check, compare and watch failures

`openclaw policy check`, `policy compare` and `policy watch` printed nothing on stdout when the command itself failed, even with --json or with output piped to another program, which broke scripts that read the documented machine-readable error. Each failure now prints one standard cli_error JSON document on stdout; piped output matches --json, and stderr and terminal output are unchanged.

Evidence: built CLI. On main the three failures printed 0 bytes on stdout (twice); with this change they print one cli_error document each (123, 95 and 89 bytes) (twice), with the same result when piped. Real terminal runs and all stderr output are unchanged.

Thanks @Leon-SK668.

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-10-23 16:59:01 -04:00
..
attestation.md
authoring.md docs: use plain language for connection checks (#165736) 2026-10-05 22:52:53 -07:00
findings.md
rules.md docs: use plain language for connection checks (#165736) 2026-10-05 22:52:53 -07:00
running-checks.md fix(policy): emit JSON for command-owned CLI failures (#181758) 2026-10-23 16:59:01 -04:00
scopes.md