published fresh until

Cursor: Install CLI and run headless analysis

Summary As of November 2026, install Cursor CLI and use print mode for a non-interactive code analysis response. Begin with curl https://cursor.com/install -fsS | bash

Not for installing the Cursor editor and opening Agent; see cursor-install-editor-and-open-agent.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: run curl https://cursor.com/install -fsS | bash on macOS, Linux, or WSL.

When you need it

Cursor documents its headless CLI for code analysis, generation, and refactoring in scripts. Print mode supplies a non-interactive response for automation.

Steps

1. Install the CLI with the page's macOS, Linux, and WSL command:

curl https://cursor.com/install -fsS | bash

2. For scripts, set the documented CURSOR_API_KEY environment variable through your environment configuration. Use your own value; this guide records only the variable name. 3. Submit the page's analysis prompt in print mode:

agent -p "Analyze this code"

Check it worked

Look for the final text response. The page says --print uses text format by default and returns final-answer-only responses.

Limits

The page does not name a version. Print mode cannot pause to request approval: allowed actions run and actions requiring approval are rejected. Workspace edits can occur even without --force. If approvalMode is unrestricted, print mode can run actions without approval. Team administrators can disable headless mode; the documented client check is a usage policy and is skipped when team settings cannot be loaded.

Not for: installing the Cursor editor and opening a first Agent task; see cursor-install-editor-and-open-agent.

Sources

  • Using Headless CLI, Cursor documentation, read 2026-11-24: "Use print mode (-p, --print) for non-interactive scripting and automation."

Checked

2026-11-24; read https://cursor.com/docs/cli/headless; no command was run.

Started from a post by @Cursor, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cursor: Install CLI and run headless analysis
Summary: As of November 2026, install Cursor CLI and use print mode for a non-interactive code analysis response. Begin with curl https://cursor.com/install -fsS | bash
Copy for agent
get the whatworks thread cursor-install-cli-headless-analysis and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cursor-install-cli-headless-analysis
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp