Skip to main content

Command Palette

Search for a command to run...

CLI

Parameters

Global options

Global options can be used with any command:

OptionDescription
-v, --versionOutput 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)
-p, --printPrint responses to console (for scripts or non-interactive use). Has access to all tools, including write and shell.
--output-format <format>Output format (only works with --print): text, json, or stream-json (default: text)
--stream-partial-outputStream partial output as individual text deltas (only works with --print and stream-json format)
--resume [chatId]Resume a chat session
--continueContinue the previous session (alias for --resume=-1)
--model <model>Model to use
--mode <mode>Set agent mode: plan or ask (agent is the default when no mode is specified)
--planStart in plan mode (shorthand for --mode=plan)
--list-modelsList all available models
-f, --forceForce allow commands unless explicitly denied
--yoloAlias for --force
--sandbox <mode>Set sandbox mode: enabled or disabled
--approve-mcpsAutomatically approve all MCP servers
--trustTrust the workspace without prompting (headless mode only)
--workspace <path>Workspace directory to use
--plugin-dir <path>Load a local plugin directory (can be specified multiple times)
-w, --worktree [name]Run in a new Git worktree under ~/.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-setupSkip running worktree setup scripts from .cursor/worktrees.json
-h, --helpDisplay help for command

Commands

CommandDescriptionUsage
agent [prompt...]Start in agent mode (the default)agent agent "fix the tests"
loginAuthenticate with Cursoragent login
logoutSign out and clear stored authenticationagent logout
status | whoamiView authentication statusagent status
aboutDisplay version, system, and account infoagent about
modelsList available models for this accountagent models
mcpManage MCP serversagent mcp
sandboxConfigure sandbox mode or run one command in a sandbox (hidden)agent sandbox enable
workerStart a private cloud worker that runs agents in your environmentagent worker start
acpStart ACP server mode (advanced, hidden command)agent acp
updateUpdate Cursor Agent to the latest versionagent update
lsResume a chat sessionagent ls
resumeResume the latest chat sessionagent resume
create-chatCreate a new empty chat and return its IDagent create-chat
generate-rule | ruleGenerate a new Cursor rule with interactive promptsagent generate-rule
install-shell-integrationInstall shell integration to ~/.zshrcagent install-shell-integration
uninstall-shell-integrationRemove shell integration from ~/.zshrcagent uninstall-shell-integration
help [command]Display help for commandagent help [command]

MCP

Manage MCP servers configured for Cursor Agent.

SubcommandDescriptionUsage
login <identifier>Authenticate with an MCP server configured in .cursor/mcp.json or ~/.cursor/mcp.jsonagent mcp login <identifier>
listList configured MCP servers and their statusagent mcp list
list-tools <identifier>List available tools and their argument names for a specific MCPagent mcp list-tools <identifier>
enable <identifier>Add an MCP server to the local approved listagent mcp enable <identifier>
disable <identifier>Disable an MCP server so it won't load or prompt for approvalagent mcp disable <identifier>

All MCP commands support -h, --help for command-specific help.

Sandbox

Configure sandbox mode or run one command in a sandbox.

SubcommandDescriptionUsage
enableEnable sandbox mode for command executionagent sandbox enable
disableDisable sandbox mode and use allowlist modeagent sandbox disable
resetReset sandbox configuration to defaultsagent sandbox reset
run <cmd> [args...]Run a command in a sandbox with workspace read/writeagent sandbox run ls
help [command]Display help for commandagent sandbox help
CommandOptionDescription
sandbox run--allow-paths <paths>Comma-separated list of extra read/write paths
sandbox run--readonly-paths <paths>Comma-separated list of extra read-only paths
sandbox run--blocked-patterns <patterns>Comma-separated list of gitignore-style patterns to block
sandbox run--sandboxRun with the workspace read/write sandbox policy (default: true)
sandbox run--networkEnable network access in the sandbox (default: false)
sandbox run--sb-debugWrite sandbox debug logs to a temp folder and print the path

All sandbox commands support -h, --help for command-specific help.

Worker

Start a private cloud worker that connects to Cursor and runs agents in your environment.

SubcommandDescriptionUsage
startStart the worker and connect to Cursoragent worker start
debugRun private worker preflight diagnostics for auth, privacy, and routingagent worker debug
help [command]Display help for commandagent worker help
CommandOptionDescription
worker--auth-token-file <path>Path to a file containing the worker auth token
worker--worker-dir <path>Workspace root to expose to agents. Repeatable. The first value is the assignment identity.
worker--management-addr <address>Listen address for /healthz, /readyz, and /metrics
worker--label <key=value>Add a worker label. Can be used multiple times. Can't be used with --labels-file.
worker--labels-file <path>Path to a JSON or TOML labels file. Can also use CURSOR_WORKER_LABELS_FILE.
worker--idle-release-timeout <seconds>Seconds the worker may stay connected after becoming idle. Default 0 disables idle-based release.
worker--poolRegister for pool assignment. One cloud agent claims the worker at a time.
worker--single-useLegacy alias for --pool
worker--pool-name <name>Pool label for pool workers. Requires --pool or --single-use. Defaults to default.
worker--name <name>Custom display name. Defaults to the machine hostname.
worker--data-dir <path>Base directory for logs, artifacts, and recording data
worker--debugPrint worker debug diagnostics before starting bridge mode
worker start--verboseEnable verbose startup logs
worker debug--jsonOutput the debug report as JSON

Command-specific options

CommandOptionDescription
status, whoami--format <format>Output format: text or json (default: text)
about--format <format>Output format: text or json (default: text)

Arguments

When starting in chat mode (default behavior), you can provide an initial prompt:

Arguments:

  • prompt — Initial prompt for the agent

Getting help

All commands support the global -h, --help option to display command-specific help.