OS Manuals

/usr/bin/agent

Cursor Agent CLI - Cursor's headless AI coding agent for the terminal

From cursor-agent 2026.11.05_git08060004071315-r0 (enterprise-packages), captured 2026-11-08 by running agent --help (exit 0). permalink

Usage: agent [options] [command] [prompt...]

Start the Cursor Agent

Arguments:
  prompt                       Initial prompt for the agent

Options:
  -v, --version                Output the version number
  --api-key <key>              API key for authentication (can also use
                               CURSOR_API_KEY env var)
  -H, --header <header>        Add custom header to agent requests (format:
                               'Name: Value', can be used multiple times)
  -e, --endpoint <url>         Target API endpoint URL (can also use
                               CURSOR_API_ENDPOINT env var) (default:
                               "https://api2.cursor.sh", env:
                               CURSOR_API_ENDPOINT)
  -p, --print                  Print responses to console (for scripts or
                               non-interactive use). Has access to all tools,
                               including write and shell. (default: false)
  --output-format <format>     Output format (only works with --print): text |
                               json | stream-json (default: "text")
  --stream-partial-output      Stream partial output as individual text deltas
                               (only works with --print and stream-json format)
                               (default: false)
  --mode <mode>                Start in the given execution mode. plan:
                               read-only/planning (analyze, propose plans, no
                               edits). ask: Q&A style for explanations and
                               questions (read-only). (choices: "plan", "ask")
  --plan                       Start in plan mode (shorthand for --mode=plan).
                               (default: false)
  --resume [chatId]            Select a session to resume (default: false)
  --continue                   Continue previous session (default: false)
  --model <model>              Model to use (e.g., gpt-5, sonnet-4-thinking).
                               Parameterized models accept quoted bracket
                               overrides, e.g.
                               'claude-opus-4-8[context=1m,effort=high,fast=false]'
  --list-models                List available models and exit (default: false)
  -f, --force                  Force allow commands unless explicitly denied
                               (default: false)
  --yolo                       Alias for --force (Run Everything) (default:
                               false)
  --auto-review                Use Auto-review (Smart Auto): a server classifier
                               auto-runs safe tool calls and prompts for the
                               rest (default: false)
  --sandbox <mode>             Explicitly enable or disable sandbox mode
                               (overrides config) (choices: "enabled",
                               "disabled")
  --approve-mcps               Automatically approve all MCP servers (default:
                               false)
  --trust                      Trust the current workspace without prompting
                               (default: false)
  --workspace <path-or-name>   Workspace directory or saved workspace name to
                               use (defaults to current working directory)
  --add-dir <path>             Add an additional workspace root directory (can
                               be specified multiple times)
  --plugin-dir <path>          Load a local plugin directory (can be specified
                               multiple times)
  -w, --worktree [name]        Start in an isolated git worktree at
                               ~/.cursor/worktrees/<reponame>/<name>. If
                               omitted, a name is generated.
  --worktree-base <branch>     Branch or ref to base the new worktree on
                               (default: current HEAD)
  --skip-worktree-setup        Skip running worktree setup scripts from
                               .cursor/worktrees.json (default: false)
  -h, --help                   Display help for command

Commands:
  persist                      Start or manage a session that survives terminal
                               disconnects
  install-shell-integration    Install shell integration to ~/.zshrc
  uninstall-shell-integration  Remove shell integration from ~/.zshrc
  login                        Authenticate with Cursor. Set NO_OPEN_BROWSER to
                               disable browser opening.
  logout                       Sign out and clear stored authentication
  mcp                          Manage MCP servers
  plugin                       Manage plugins and plugin marketplaces
  worker [options]             Run a self-hosted Cloud Agent worker that
                               connects to Cursor and executes agent tool calls
                               on this machine. Without --pool it is a personal
                               My Machines worker (no Enterprise plan needed);
                               with --pool it joins a team Self-Hosted Pool
                               (Enterprise plan + service account API key).
  status|whoami [options]      View authentication status
  models                       List available models for this account
  team                         View or switch the active team for this account
  bedrock                      Configure AWS Bedrock usage for CLI
  about [options]              Display version, system, and account information
  update [options]             Update Cursor Agent to the latest version
  create-chat                  Create a new empty chat and return its ID
  generate-rule|rule           Generate a new Cursor rule with interactive
                               prompts
  agent [prompt...]            Start the Cursor Agent
  ls                           Resume a chat session
  resume                       Resume the latest chat session
  help [command]               Display help for command
Options (26)
OptionDescriptionSource
-v, --versionOutput the version numberhelp
--api-key keyAPI key for authentication (can also use CURSOR_API_KEY env var)help
-H, --header headerAdd custom header to agent requests (format: 'Name: Value', can be used multiple times)help
-e, --endpoint urlTarget API endpoint URL (can also use CURSOR_API_ENDPOINT env var) (default: "https://api2.cursor.sh", env: CURSOR_API_ENDPOINT)help
-p, --printPrint responses to console (for scripts or non-interactive use).help
--output-format formatOutput format (only works with --print): text | json | stream-json (default: "text")help
--stream-partial-outputStream partial output as individual text deltas (only works with --print and stream-json format) (default: false)help
--mode modeStart in the given execution mode.help
--planStart in plan mode (shorthand for --mode=plan).help
--resume chatIdSelect a session to resume (default: false)help
--continueContinue previous session (default: false)help
--model modelModel to use (e.g., gpt-5, sonnet-4-thinking).help
--list-modelsList available models and exit (default: false)help
-f, --forceForce allow commands unless explicitly denied (default: false)help
--yoloAlias for --force (Run Everything) (default: false)help
--auto-reviewUse Auto-review (Smart Auto): a server classifier auto-runs safe tool calls and prompts for the rest (default: false)help
--sandbox modeExplicitly enable or disable sandbox mode (overrides config) (choices: "enabled", "disabled")help
--approve-mcpsAutomatically approve all MCP servers (default: false)help
--trustTrust the current workspace without prompting (default: false)help
--workspace path-or-nameWorkspace directory or saved workspace name to use (defaults to current working directory)help
--add-dir pathAdd an additional workspace root directory (can be specified multiple times)help
--plugin-dir pathLoad a local plugin directory (can be specified multiple times)help
-w, --worktree nameStart in an isolated git worktree at ~/.cursor/worktrees/<reponame>/<name>.help
--worktree-base branchBranch or ref to base the new worktree on (default: current HEAD)help
--skip-worktree-setupSkip running worktree setup scripts from .cursor/worktrees.json (default: false)help
-h, --helpDisplay help for commandhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.