Answer: Use the `--output-format ` option with `--print`, setting the format to `json` (or `stream-json`). Status: Confirmed Entry: tool/cursor/commands-and-shortcuts/cli-json-output-format Revision: 1 Digest: sha256:737357b96a67bf8c (changes whenever the content changes) Timeline: Created: 2026-11-13T03:09:44Z Last changed: 2026-11-13T03:09:44Z Last verified: 2026-11-20T12:35:48Z Next check: 2026-11-21T12:35:48Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of output format option | --output-format | [1] | 2026-11-20 json format value | json | [1] | 2026-11-20 print option | -p, --print | [1] | 2026-11-20 Sources: [1] Anysphere. "cursor.com/docs/cli/reference/parameters.md". https://cursor.com/docs/cli/reference/parameters.md Role: primary. Accessed: 2026-11-20T12:35:48Z Quote: "`--output-format ` | Output format (only works with `--print`): `text`, `json`, or `stream-json` (default: `text`)" (Supports: output format option) Quote: "Output format (only works with `--print`): `text`, `json`, or `stream-json` (default: `text`)" (Supports: json format value) Quote: "`-p, --print` | Print responses to console (for scripts or non-interactive use)." (Supports: print option) Snapshot SHA-256: 7bec5b26a529671386966c18becdb5da69e0b549e97c8a14e618448e6f0d7675 (captured 2026-11-17T12:44:46Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-17T12:44:46Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:35:48Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:35:48Z Last attempt: 2026-11-20T12:35:48Z Notes and limitations: Extracted automatically from a single official source (section "Global options"). Related: https://latestn.com/tool/cursor/commands-and-shortcuts/cli-plan-mode How do I switch Cursor CLI to Plan mode? https://latestn.com/tool/cursor/commands-and-shortcuts/cli-resume-session How do I resume or continue a previous chat session in the Cursor CLI? https://latestn.com/tool/cursor/commands-and-shortcuts/create-pull-request How do I create a pull request with the Cursor Origin CLI? https://latestn.com/tool/cursor/agents-and-automation/when-to-use-agent-sdk When should I use Cursor Agent SDK instead of other approaches? https://latestn.com/tool/cursor/commands-and-shortcuts/change-pr-parent-stack How do I change or remove a pull request's parent stack in Cursor Origin? https://latestn.com/tool/cursor/commands-and-shortcuts/cli-ask-mode How do I use Ask mode in Cursor CLI to explore code without edits? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:09:44Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/cursor/commands-and-shortcuts/cli-json-output-format/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/cursor/commands-and-shortcuts/cli-json-output-format POST: https://latestn.com/dispute/tool/cursor/commands-and-shortcuts/cli-json-output-format with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/cursor/commands-and-shortcuts/cli-json-output-format?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I get JSON output from the Cursor CLI for scripting? Revision 1, last verified 2026-11-20T12:35:48Z. https://latestn.com/tool/cursor/commands-and-shortcuts/cli-json-output-format (accessed 2026-11-21T10:01:30Z). @misc{LatestN_tool_cursor_commands_and_shortcuts_cli_json_output_format_r1, title = {How do I get JSON output from the Cursor CLI for scripting?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/cursor/commands-and-shortcuts/cli-json-output-format}}, note = {Revision 1; digest sha256:737357b96a67bf8c; last verified 2026-11-20T12:35:48Z; accessed 2026-11-21T10:01:30Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/cursor/commands-and-shortcuts/cli-json-output-format