Skip to main content
Pass --json whenever another process will consume the output.

Stdout

In JSON mode, stdout is one valid JSON document.
Some public API passthrough commands return the documented API object directly when the server object is already stable.
That response may be a market dossier object rather than a CLI envelope. Parse the response by shape: if 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:
  1. Check the process exit code.
  2. Parse stdout as JSON.
  3. If the parsed object has ok: false, read error.
  4. If the parsed object has ok: true, read data.
  5. If ok is absent, treat it as a documented API passthrough object.
Do not scrape human terminal text. Use --json, sf describe --all --json, and the API reference pages.