CLI

Output and exit codes

How to parse results and branch on failure.

The response body goes to stdout and the status line to stderr, so piping into jq works without any flag:

pxb customer list | jq -r '.content.customers[].fullname'

--json drops the status line entirely, for when stderr is also captured.

Exit codes are meaningful: 0 on success, 1 on any error, including a 4xx or 5xx from the API. So && and || are enough for control flow, and a failed step stops a chain rather than corrupting the next one:

pxb order list --json -q status=PAYMENT_PENDING \
  && pxb support-case list --json -q status=OPEN

In your terminal: pxb help output