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 path
What it does
curl https://cursor.com/install -fsS | bash
Install on macOS, Linux, or Windows Subsystem for Linux.
irm 'https://cursor.com/install?win32=true' | iex
Install on native Windows from PowerShell.
~/.local/bin
Add this directory to PATH on macOS, Linux, or WSL if the agent command is not found after installation.
agent --version
Check the installed CLI version.
agent login
Sign in through the browser. Set NO_OPEN_BROWSER=1 to print a login URL.
agent
Start an interactive Agent session in the current directory.
agent "Explain the test failures"
Start an interactive session with an initial prompt.
agent update
Run 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.
Command
What it does
agent status
Show authentication status. agent whoami is an alias. Add --format json for structured output.
agent about
Show CLI version, system, and account details. Accepts --format text|json.
agent models
List models available to the signed-in account.
agent logout
Sign out and clear stored authentication.
agent create-chat
Create an empty chat and return its ID.
agent generate-rule
Create a Cursor rule through interactive prompts. agent rule is an alias.
agent install-shell-integration
Install shell integration in ~/.zshrc.
agent uninstall-shell-integration
Remove the shell integration from ~/.zshrc.
agent help [command]
Show help for a command. agent --help shows root help.
Modes and sessions
Mode or command
What it does
Agent mode
Default mode for coding tasks with tools.
agent --plan or agent --mode=plan
Start in Plan mode.
agent --mode=ask
Start in read-only Ask mode.
agent ls
Open previous chats and choose one to resume.
agent resume
Resume the latest chat.
agent --continue
Continue 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
Flag
What it does
--model <model>
Select a model for the run.
--list-models
List 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, --print
Run a non-interactive task and print its response.
--output-format text|json|stream-json
Choose print-mode output. The current default is text.
--stream-partial-output
Emit partial text deltas with --print --output-format stream-json.
-v, --version
Print the installed version.
-h, --help
Show help for the command.
Execution and workspace controls
Flag
What it does
-f, --force
Allow commands automatically unless a rule explicitly denies them. --yolo is an alias.
--sandbox enabled|disabled
Set sandbox mode for the run.
--trust
Trust 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-setup
Skip setup scripts from .cursor/worktrees.json.
--approve-mcps
Approve 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 command
What 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.
/ask
Switch 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.
/clear
Start a new chat. Aliases are /new, /new-chat, and /newchat.
/resume
Open recent chats and resume one.
/fork
Fork the current chat into a new session.
/rewind
Return to an earlier message.
/summarize
Summarize 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 command
What it does
/shell [command]
Enter Shell Mode or run a command. Aliases are /sh and /run.
/sandbox
Configure 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.
/open
Open 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 command
What it does
/config
Open CLI settings.
/vim
Toggle Vim editing in the CLI input area.
/line-numbers
Toggle line numbers in code blocks.
/show-thinking
Toggle thinking-block display.
/status-indicators
Toggle terminal-title status indicators.
/setup-terminal
Configure terminal newline keybindings.
/logs
Show and copy the debug log path.
/about
Show and copy CLI, system, and account information.
/update
Update Cursor CLI.
/help [command]
Show command help.
/copy
Copy a previous user message.
/copy-request-id
Copy the last request ID.
/copy-conversation-id
Copy the current conversation ID.
/feedback <message>
Send feedback to Cursor.
/max-mode
Toggle Max Mode on legacy request-based plans.
/logout
Sign out from Cursor.
/quit or /exit
Exit the CLI.
Keyboard shortcuts and prompt controls
Shortcut or control
Action
Shift+Tab
Rotate among Agent, Plan, and Ask modes.
Shift+Enter
Insert a newline in terminals that send this key combination to the CLI.
Ctrl+J
Insert a newline in any terminal, including tmux, screen, and SSH sessions.
\, then Enter
Insert a newline in any terminal.
Option+Enter / Alt+Enter
Insert a newline after /setup-terminal. In the skill picker, invoke a persistent Custom Mode.
Ctrl+R
Review changes. Press i in review mode to add follow-up instructions.
Ctrl+D
Exit 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 control
Purpose
~/.cursor/cli-config.json
Global CLI settings on macOS and Linux.
$env:USERPROFILE\.cursor\cli-config.json
Global CLI settings on Windows.
<project>/.cursor/cli.json
Project-level CLI permissions. Other CLI settings belong in the global file.
CURSOR_CONFIG_DIR
Choose another CLI configuration directory.
XDG_CONFIG_HOME
Change the global configuration path on Linux and BSD.
permissions.allow / permissions.deny
List operations to approve or reject. Deny rules take precedence.