Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Cursor CLI reference - Subcommands

Cursor CLI commands and subcommands

Cursor CLI documents 42 subcommands, including agent [prompt...], login and logout. These run as cursor-agent <command> from your shell. Each row gives the docs' description, accepted values and an example where one is documented.

Last verified 7 official pagesFull Cursor CLI reference

Cursor CLI subcommands
CommandDescriptionExample
agent [prompt...]

Starts in agent mode, the default. When no command is specified, Cursor Agent starts in interactive agent mode; an initial prompt can be passed as an argument.

prompt: initial prompt for the agent

Docs: agent [prompt...]
agent "refactor the auth module to use JWT tokens"
login

Authenticates with Cursor using a browser flow and stores credentials locally. During login, pressing q reveals a QR code for the same login URL.

Docs: login
agent login
logout

Signs out and clears stored authentication.

Docs: logout
agent logout
status | whoami

Views authentication status: whether you are authenticated, account information, and current endpoint configuration.

--format text|json

Docs: status | whoami
agent status
about

Displays version, system, and account info.

--format text|json

Docs: about
agent about
models

Lists available models for this account, including team Bedrock models and respecting team model restrictions.

Docs: models
agent models
mcp

Manages MCP servers configured for Cursor Agent. MCP in the CLI uses the same configuration as the editor.

login | list | list-tools | enable | disable

Docs: mcp
agent mcp
mcp login <identifier>

Authenticates with an MCP server configured in .cursor/mcp.json or ~/.cursor/mcp.json, with automatic callback handling.

identifier

Docs: mcp login <identifier>
agent mcp login <identifier>
mcp list

Lists configured MCP servers and their status in an interactive menu showing names, connection status, configuration source, and transport.

Docs: mcp list
agent mcp list
mcp list-tools <identifier>

Lists available tools and their argument names for a specific MCP server.

identifier

Docs: mcp list-tools <identifier>
agent mcp list-tools playwright
mcp enable <identifier>

Adds an MCP server to the local approved list.

identifier

Docs: mcp enable <identifier>
agent mcp enable <identifier>
mcp disable <identifier>

Disables an MCP server so it will not load or prompt for approval.

identifier

Docs: mcp disable <identifier>
agent mcp disable <identifier>
sandbox

Configures sandbox mode or runs one command in a sandbox. Hidden command.

enable | disable | reset | run | help

Docs: sandbox
agent sandbox enable
sandbox enable

Enables sandbox mode for command execution.

Docs: sandbox enable
agent sandbox enable
sandbox disable

Disables sandbox mode and uses allowlist mode.

Docs: sandbox disable
agent sandbox disable
sandbox reset

Resets sandbox configuration to defaults.

Docs: sandbox reset
agent sandbox reset
sandbox run <cmd> [args...]

Runs a command in a sandbox with workspace read/write.

--allow-paths, --readonly-paths, --blocked-patterns, --sandbox, --network, --sb-debug

Docs: sandbox run <cmd> [args...]
agent sandbox run ls
sandbox help [command]

Displays help for a sandbox command.

Docs: sandbox help [command]
agent sandbox help
worker

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

start | debug | controller | help

Docs: worker
agent worker start
worker start

Starts the worker and connects to Cursor. Waits for the bridge to connect before reporting ready.

--verbose

Docs: worker start
agent worker [options] start
worker debug

Runs private worker preflight diagnostics for auth, privacy, and routing.

--json

Docs: worker debug
agent worker debug
worker help [command]

Displays help for a worker command.

Docs: worker help [command]
agent worker help
worker controller

Starts workers from a --spawn hook, either claim-then-spawn (default) or as a warm pool with --warm-idle. Authenticates with a service account key.

--spawn, --api-key, --pool, --all-pools, --warm-idle, --session-token, --identity-audience, --repository, --endpoint

Docs: worker controller
agent worker controller --spawn ./spawn.sh --api-key "$CURSOR_API_KEY" --pool my-pool --pool default
acp

Starts ACP (Agent Client Protocol) server mode over stdio with JSON-RPC 2.0, newline-delimited. Intended for custom clients and advanced integrations; hidden from default help output.

Docs: acp
agent acp
update

Updates Cursor Agent to the latest version. The CLI also tries to auto-update by default.

Docs: update
agent update
ls

Opens previous chats so you can resume one.

Docs: ls
agent ls
resume

Resumes the latest chat session.

Docs: resume
agent resume
create-chat

Creates a new empty chat and returns its ID.

Docs: create-chat
agent create-chat
generate-rule | rule

Generates a new Cursor rule with interactive prompts.

Docs: generate-rule | rule
agent generate-rule
install-shell-integration

Installs shell integration to ~/.zshrc.

Docs: install-shell-integration
agent install-shell-integration
uninstall-shell-integration

Removes shell integration from ~/.zshrc.

Docs: uninstall-shell-integration
agent uninstall-shell-integration
help [command]

Displays help for a command.

Docs: help [command]
agent help [command]
bedrock

Configures AWS Bedrock access with your own access keys or a team IAM role; works across interactive, headless, and editor sessions.

Docs: bedrock
-no example
persist

Starts a persistent session that keeps the agent running after you disconnect. Detach with /detach.

attach | list | stop; --resume

Docs: persist
-no example
persist attach

Reconnects to a persistent session later.

Docs: persist attach
-no example
persist list

Lists persistent sessions (documented as agent persist list|stop for managing sessions).

Docs: persist list
-no example
persist stop

Stops a persistent session (documented as agent persist list|stop for managing sessions).

Docs: persist stop
-no example
env deploy

Deploys a Cloud Agent environment from an environment file. Files can include comments and trailing commas; invalid files fail with a syntax error pointing to where parsing stopped.

environment file

Docs: env deploy
-no example
plugin marketplace add <git-url>

Registers a plugin marketplace from the shell without an interactive session. Pin a branch, tag, or commit with --git-ref.

git URL; --git-ref

Docs: plugin marketplace add <git-url>
-no example
plugin marketplace list

Prints each marketplace's name, scope, and git URL.

--format json for scripts

Docs: plugin marketplace list
-no example
plugin marketplace update

Re-indexes a marketplace from its repository.

Docs: plugin marketplace update
-no example
plugin marketplace remove

Deletes a user-scoped marketplace.

Docs: plugin marketplace remove
-no example

The rest of the Cursor CLI reference

FAQ

How many subcommands does Cursor CLI have?

The official Cursor CLI docs list 42 subcommands, including agent [prompt...], login and logout. All of them are in the table above, in the docs' order.

What does agent [prompt...] do in Cursor CLI?

Starts in agent mode, the default. When no command is specified, Cursor Agent starts in interactive agent mode; an initial prompt can be passed as an argument. Values: prompt: initial prompt for the agent. Example: agent "refactor the auth module to use JWT tokens"

Where are Cursor CLI subcommands documented?

On 7 official docs pages at cursor.com, last read on October 17, 2026. Every row in the table links the exact section it came from.

More on Cursor CLI

Use other models in Cursor CLI

Setup guides from the model-in-tool directory, each with the env vars and base URL from official docs.

Sources

Last verified . Names and examples are copied verbatim from the 7 official pages below, and every row above links the exact section it came from.

Newsletter

Know when your tools change

One email per week. New coding agent releases, the flags and commands they add, and what they mean for how you work.