Skip to navigation

Output and filtering

Successful commands print a JSON envelope to stdout. Errors go to stderr as a separate JSON document, so stdout can be piped safely. See Errors and exit codes for the error shape.

The response envelope

{
"data": { "adjustment_id": "adj_01H8X4M2", "status": "pending", "is_created": true },
"meta": { "request_id": "8b1c1a2e-3f96-4d05-a172-9e6b8c4d0f13" }
}

The envelope carries two keys:

KeyDescription
dataThe operation result. An object for single-resource operations, an array for list operations. The API’s own data wrapper is unwrapped.
meta.request_idThe x-request-id the CLI generated for the request. Quote it when contacting support.

Utility commands such as deel auth status use the same envelope with their own data shape.

Output flags

Combine these flags to shape what a command prints:

FlagEffect
--fields a,b.cKeep only the listed fields of data. Dotted paths select nested values; on arrays the projection applies to every element.
--jq '<filter>'Run a jq filter over data and print each result. Uses an embedded jq; no external binary is needed.
--rawWith --jq, print string results without quotes (like jq -r).
--quietPrint only identifiers, one per line: the id, job_id, or oid of each result.
--no-jsonOn an interactive terminal, print data without the envelope. Has no effect when piped.

--jq takes precedence over --fields. --quiet applies after --fields.

Field projection

deel jobs list --fields job_id,status
{
"data": [
{ "job_id": "7f3c9b1e-2d84-4a51-9c07-1b5e8a0f3d62", "status": "SUCCEEDED" },
{ "job_id": "9a10c2d4-8e35-4a92-b6f1-7c3d9e5a2b18", "status": "RUNNING" }
],
"meta": { "request_id": "8b1c1a2e-3f96-4d05-a172-9e6b8c4d0f13" }
}

jq transforms

--jq receives the value of data and prints every result the filter produces as its own JSON document. The envelope is not printed.

deel jobs list --jq '.[] | select(.status == "SUCCEEDED") | .job_id' --raw
7f3c9b1e-2d84-4a51-9c07-1b5e8a0f3d62
c4d2f891-3a67-4e05-9c82-1b6f4d8a3e57

Filters that produce objects print pretty-printed JSON:

deel jobs list --jq '.[] | {job_id, status}'

Identifiers only

--quiet prints only the ids a command produced, which is the form to feed into the next command in a script.

JOB_ID=$(deel adjustments create-bulk --invoice --input file://batch.json --quiet)
deel job status "$JOB_ID"

Interactive and non-interactive output

The CLI always prints JSON when stdout is not a terminal, so pipes and redirects receive a stable format regardless of flags. On an interactive terminal, --no-json prints the data value alone, without the meta block.

A terminal counts as interactive only when stdout is a TTY, CI is not exactly true, and none of CLAUDE_CODE, CURSOR, or CODEX is present. Those three are presence checks, so CLAUDE_CODE=0 still counts as an agent environment. Inside CI runners and coding agents such as Claude Code, Cursor, and Codex, output is therefore JSON even when a pseudo-terminal is attached. See AI agents and the CLI.

Diagnostics with --debug

--debug writes request diagnostics to stderr without changing stdout: the method, URL, and status of each request, the request id, and the idempotency key with an indication of whether it was derived or overridden.

[debug] idempotency-key: 2f1a7c0e-9b3d-4e21-8a6f-5c9d3e7b1a04 (derived)
[debug] POST https://api-staging.letsdeel.com/rest/adjustments/invoice -> 201 x-request-id=8b1c1a2e-3f96-4d05-a172-9e6b8c4d0f13

Next steps