> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.deel.com/cli/usage/output/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.deel.com/_mcp/server. # Output and filtering > Read the Deel CLI response envelope and shape it with --fields, --jq, --quiet, and --no-json 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](/cli/usage/errors) for the error shape. ## The response envelope ```json { "data": { "adjustment_id": "adj_01H8X4M2", "status": "pending", "is_created": true }, "meta": { "request_id": "8b1c1a2e-3f96-4d05-a172-9e6b8c4d0f13" } } ``` The envelope carries two keys: | Key | Description | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `data` | The operation result. An object for single-resource operations, an array for list operations. The API's own `data` wrapper is unwrapped. | | `meta.request_id` | The `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: | Flag | Effect | | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `--fields a,b.c` | Keep only the listed fields of `data`. Dotted paths select nested values; on arrays the projection applies to every element. | | `--jq ''` | Run a [jq](https://jqlang.github.io/jq/manual/) filter over `data` and print each result. Uses an embedded jq; no external binary is needed. | | `--raw` | With `--jq`, print string results without quotes (like `jq -r`). | | `--quiet` | Print only identifiers, one per line: the `id`, `job_id`, or `oid` of each result. | | `--no-json` | On an interactive terminal, print `data` without the envelope. Has no effect when piped. | `--jq` takes precedence over `--fields`. `--quiet` applies after `--fields`. ### Field projection ```bash deel jobs list --fields job_id,status ``` ```json { "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. ```bash deel jobs list --jq '.[] | select(.status == "SUCCEEDED") | .job_id' --raw ``` ```text 7f3c9b1e-2d84-4a51-9c07-1b5e8a0f3d62 c4d2f891-3a67-4e05-9c82-1b6f4d8a3e57 ``` Filters that produce objects print pretty-printed JSON: ```bash 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. ```bash 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](/cli/agents/overview). ## 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. ```text [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 #### [Scripting and CI](/cli/guides/automation) Chain commands, handle errors, and run the CLI in pipelines #### [Errors and exit codes](/cli/usage/errors) Branch on error codes instead of exit statuses > Build apps and integrations that extend and enhance the Deel services.