--json whenever another process will consume the output.
Stdout
In JSON mode, stdout is one valid JSON document.ok is present, use the envelope; otherwise use the API page for that endpoint.
Error envelope
Validation, auth, upstream, and runtime errors use a JSON envelope when JSON mode is active.Exit codes
Payload controls
Use the command manifest or--help for the exact flags supported by each command.
Parsing rules
Agents should use this order:- Check the process exit code.
- Parse stdout as JSON.
- If the parsed object has
ok: false, readerror. - If the parsed object has
ok: true, readdata. - If
okis absent, treat it as a documented API passthrough object.
--json, sf describe --all --json, and the API reference pages.