Cursor CLI Cheat Sheet: Commands, Flags & Slash Commands

Look up Cursor CLI commands, flags, modes, session controls, permissions, MCP, ACP, CI output, and self-hosted worker syntax.

Cursor CLI runs Cursor’s coding agent from the terminal through the agent command.

Interactive sessions use slash commands and keyboard controls for modes, conversations, tools, context, and Cloud Agent handoff.

Use this cheat sheet to look up installation, shell commands, startup flags, sessions, worktrees, headless and CI syntax, permissions, MCP, ACP, and self-hosted worker commands.

Last updated: September 29, 2026.

Install and start Cursor CLI

Command or pathWhat it does
curl https://cursor.com/install -fsS | bashInstall on macOS, Linux, or Windows Subsystem for Linux.
irm 'https://cursor.com/install?win32=true' | iexInstall on native Windows from PowerShell.
~/.local/binAdd this directory to PATH on macOS, Linux, or WSL if the agent command is not found after installation.
agent --versionCheck the installed CLI version.
agent loginSign in through the browser. Set NO_OPEN_BROWSER=1 to print a login URL.
agentStart an interactive Agent session in the current directory.
agent "Explain the test failures"Start an interactive session with an initial prompt.
agent updateRun a manual update. Cursor CLI also attempts automatic updates.

Shell commands

Run these commands in a shell. Commands beginning with / belong inside an active Cursor CLI session.

CommandWhat it does
agent statusShow authentication status. agent whoami is an alias. Add --format json for structured output.
agent aboutShow CLI version, system, and account details. Accepts --format text|json.
agent modelsList models available to the signed-in account.
agent logoutSign out and clear stored authentication.
agent create-chatCreate an empty chat and return its ID.
agent generate-ruleCreate a Cursor rule through interactive prompts. agent rule is an alias.
agent install-shell-integrationInstall shell integration in ~/.zshrc.
agent uninstall-shell-integrationRemove the shell integration from ~/.zshrc.
agent help [command]Show help for a command. agent --help shows root help.

Modes and sessions

Mode or commandWhat it does
Agent modeDefault mode for coding tasks with tools.
agent --plan or agent --mode=planStart in Plan mode.
agent --mode=askStart in read-only Ask mode.
agent lsOpen previous chats and choose one to resume.
agent resumeResume the latest chat.
agent --continueContinue the previous session. This is an alias for --resume=-1.
agent --resume=<chat-id>Resume a specific chat by ID.

Startup flags and parameters

Model, output, and authentication

FlagWhat it does
--model <model>Select a model for the run.
--list-modelsList available models and exit.
--api-key <key>Authenticate with an API key. CURSOR_API_KEY is the environment-variable form.
-H, --header <header>Add a request header in Name: Value form. Repeat the flag for additional headers.
-p, --printRun a non-interactive task and print its response.
--output-format text|json|stream-jsonChoose print-mode output. The current default is text.
--stream-partial-outputEmit partial text deltas with --print --output-format stream-json.
-v, --versionPrint the installed version.
-h, --helpShow help for the command.

Execution and workspace controls

FlagWhat it does
-f, --forceAllow commands automatically unless a rule explicitly denies them. --yolo is an alias.
--sandbox enabled|disabledSet sandbox mode for the run.
--trustTrust the workspace with no prompt. Available in headless mode only.
--workspace <path>Choose the workspace directory.
-w, --worktree [name]Run in a Git worktree under ~/.cursor/worktrees/<reponame>/<name>. Cursor generates a name when one is not supplied.
--worktree-base <branch>Choose the worktree’s starting branch or ref. The default is the current HEAD.
--skip-worktree-setupSkip setup scripts from .cursor/worktrees.json.
--approve-mcpsApprove all MCP servers automatically.
--plugin-dir <path>Load a local plugin directory. Repeat the flag to load additional directories.

Interactive slash commands

Type slash commands after starting agent. The /help menu shows the commands available in your installation.

Modes and conversation

Slash commandWhat it does
/model [filter]Choose a model. Press Tab to edit its settings.
/plan [prompt]Switch to Plan mode, show the current plan, or submit a Plan-mode prompt.
/askSwitch to read-only Ask mode.
/debug [prompt]Switch to Debug mode or submit a Debug-mode prompt.
/run-everything [on|off|status]Control Run Everything. /auto-run is an alias.
/clearStart a new chat. Aliases are /new, /new-chat, and /newchat.
/resumeOpen recent chats and resume one.
/forkFork the current chat into a new session.
/rewindReturn to an earlier message.
/summarizeSummarize the conversation to reduce context use. /compress is an alias.
/rename <name>Rename the current chat.
/goal [objective]Set a long-lived objective. This command is rolling out.

Tools and runtime

Slash commandWhat it does
/shell [command]Enter Shell Mode or run a command. Aliases are /sh and /run.
/sandboxConfigure sandbox mode and network access.
/mcp [list|list-tools] [identifier]Manage MCP servers or inspect one server’s tools.
/plugin [subcommand]Manage CLI plugins and marketplaces.
/openOpen the repository’s Git root in Cursor. /cursor is an alias.
/bedrock [subcommand]Configure Bedrock when that feature is enabled.

Settings, display, and account

Slash commandWhat it does
/configOpen CLI settings.
/vimToggle Vim editing in the CLI input area.
/line-numbersToggle line numbers in code blocks.
/show-thinkingToggle thinking-block display.
/status-indicatorsToggle terminal-title status indicators.
/setup-terminalConfigure terminal newline keybindings.
/logsShow and copy the debug log path.
/aboutShow and copy CLI, system, and account information.
/updateUpdate Cursor CLI.
/help [command]Show command help.
/copyCopy a previous user message.
/copy-request-idCopy the last request ID.
/copy-conversation-idCopy the current conversation ID.
/feedback <message>Send feedback to Cursor.
/max-modeToggle Max Mode on legacy request-based plans.
/logoutSign out from Cursor.
/quit or /exitExit the CLI.

Keyboard shortcuts and prompt controls

Shortcut or controlAction
Shift+TabRotate among Agent, Plan, and Ask modes.
Shift+EnterInsert a newline in terminals that send this key combination to the CLI.
Ctrl+JInsert a newline in any terminal, including tmux, screen, and SSH sessions.
\, then EnterInsert a newline in any terminal.
Option+Enter / Alt+EnterInsert a newline after /setup-terminal. In the skill picker, invoke a persistent Custom Mode.
Ctrl+RReview changes. Press i in review mode to add follow-up instructions.
Ctrl+DExit the CLI after a second press.
@Choose a file or folder to include in the prompt.
& <message>Hand the message to a Cloud Agent and continue the task remotely.

Headless tasks and CI

--print runs non-interactively. Use CURSOR_API_KEY for unattended authentication. The default output format is text. Choose json for one structured result or stream-json for newline-delimited events. File changes are only applied when --force or --yolo is present.

agent -p "Explain the failing tests"
agent -p --output-format json "Summarize this repository"
agent -p --output-format stream-json --stream-partial-output "Review this change"
agent -p --force "Fix the failing tests"

Configuration, permissions, and sandbox

File or controlPurpose
~/.cursor/cli-config.jsonGlobal CLI settings on macOS and Linux.
$env:USERPROFILE\.cursor\cli-config.jsonGlobal CLI settings on Windows.
<project>/.cursor/cli.jsonProject-level CLI permissions. Other CLI settings belong in the global file.
CURSOR_CONFIG_DIRChoose another CLI configuration directory.
XDG_CONFIG_HOMEChange the global configuration path on Linux and BSD.
permissions.allow / permissions.denyList operations to approve or reject. Deny rules take precedence.
Shell(...), Read(...), Write(...), WebFetch(...), Mcp(...)Permission tokens for shell commands, files, web domains, and MCP tools.
~/.cursor/sandbox.jsonUser-level sandbox configuration for network access and filesystem rules.
<workspace>/.cursor/sandbox.jsonWorkspace-level sandbox configuration. Workspace settings take priority over user settings.
agent sandbox enable|disable|resetChange the CLI sandbox configuration. The shell command is hidden from default help.
agent sandbox run <cmd>Run one command with workspace read/write sandbox policy. Network access is off by default.

MCP and ACP

MCP commands

Command or fileWhat it does
<project>/.cursor/mcp.json / ~/.cursor/mcp.jsonDefine project and user MCP servers.
agent mcp listShow configured servers and their status.
agent mcp list-tools <identifier>Show a server’s tools and their parameters.
agent mcp login <identifier>Authenticate with a configured server.
agent mcp enable <identifier>Add a server to the local approved list.
agent mcp disable <identifier>Prevent a server from loading or prompting for approval.

ACP reference

ItemValue
Start serveragent acp
Transportstdio
ProtocolJSON-RPC 2.0 with one newline-delimited JSON message per line.
PermissionsThe client must answer blocking permission requests before tool execution can continue.
MCPProject and user MCP servers work in ACP mode. Team MCP servers configured through the Cursor dashboard do not.

Self-hosted worker commands

CommandWhat it does
agent worker startStart a self-hosted worker and connect it to Cursor. Personal workers can appear under My Machines.
agent worker debugRun preflight diagnostics for worker authentication, privacy, and routing.
agent worker --pool startStart a Team Pool worker in the default pool. Team Pools require Cursor Enterprise and a service-account API key.
agent worker --pool <name> startStart a worker in a specific Team Pool.
agent worker --computer-use --name <name> startStart a worker with computer use and a custom display name.

Related resources

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!