> esc

Cursor CLI / terminal reference

Built from Cursor's official docs as of 11 July 2026. Click any command to copy it. The binary is agent, not cursor. The source of truth is cursor.com/docs/cli, and inside a session /help and /about show what your build has.

Cheat sheet Cookbook Changes

Launch & sessions

Everything you can type before you're in a session. Fresh installs auto-update by default.

Install & run

curl https://cursor.com/install -fsS | bashInstall on macOS, Linux, WSL. Windows PowerShell: irm 'https://cursor.com/install?win32=true' | iex. Add ~/.local/bin to PATH.
agentStart an interactive session in the current directory. Agent mode is the default.
agent "prompt"Start interactive with an initial prompt.
agent -p "prompt"Non-interactive print mode — the scripting entry point. See the headless section.
agent updateUpdate to the latest version manually (the CLI also auto-updates). In-session: /update.
agent --version | agent aboutInstalled version / version, system, and account info. about --format json for scripting.
agent models | agent --list-modelsList the models available to this account.
agent generate-ruleGenerate a new Cursor rule with interactive prompts. Alias agent rule.
agent install-shell-integrationInstall shell integration into ~/.zshrc (uninstall-shell-integration removes it).

Sessions

agent lsOpen previous chats and resume one — all workspaces by default, ←/→ narrows to this one.
agent resume | agent --continueResume the latest conversation (--continue is an alias for --resume=-1).
agent --resume="<chat-id>"Resume a specific conversation by id.
agent create-chatCreate a new empty chat and print its ID — pairs with --resume in scripts.
agent -w, --worktree [name]Run in a fresh git worktree under ~/.cursor/worktrees/<repo>/<name>. --worktree-base <ref> picks the base; --skip-worktree-setup skips .cursor/worktrees.json scripts.
agent worker startStart a private cloud worker that runs agents in your environment. agent worker debug runs preflight diagnostics.

Auth

agent login | logoutBrowser OAuth flow / sign out. NO_OPEN_BROWSER=1 prints the URL instead; press q for a QR code over SSH.
agent status | whoamiAuthentication status, account, endpoint. --format json for scripting.
CURSOR_API_KEY=… | --api-key <key>API-key auth for CI and scripts. Generate keys in the Cursor dashboard under API Keys.

no matches in this section

CLI flags

-p, --printPrint responses to console for scripts and non-interactive use. Also inferred on non-TTY stdout or piped stdin.
--output-format text|json|stream-jsonPrint-mode output shape (default text).
--stream-partial-outputStream text deltas as they generate. Needs --print --output-format stream-json.
--model <model>Model for the session. --list-models shows what your account can use.
--mode plan|ask | --planStart in Plan or Ask mode. Agent mode is the default when no mode is given.
-f, --forceForce-allow commands unless explicitly denied. Required for file edits in print mode.
--yoloAlias for --force.
--sandbox enabled|disabledSet sandbox mode for command execution. Settings persist across sessions.
--approve-mcpsAutomatically approve all MCP servers.
--trustTrust the workspace without prompting (headless mode only).
--workspace <path>Explicit repository root; otherwise the current working directory.
--add-dir <path>Add extra directories at launch for a multi-root session. Repeatable; in-session /add-dir.
--plugin-dir <path>Load a local plugin directory for this session. Repeatable.
-H, --header "Name: Value"Add a custom header to agent requests. Repeatable.
--api-key <key> | -v | -hAPI key / version / help. Every command and subcommand accepts -h.

no matches in this section

Slash commands

Typed inside a session. /help <command> shows details for any of them.

Modes & models

/model [filter]Select a model; Tab to edit. Family shortcuts like /opus and /composer jump straight to a model; /fast toggles Fast where supported.
/plan [prompt]Switch to Plan mode, show the current plan, or submit a prompt in Plan mode.
/askToggle Ask mode — read-only questions, no file edits.
/debug [prompt]Toggle Debug mode or submit a prompt in it.
/max-modeToggle Max Mode on models that support it.
/run-everything [on|off|status]Toggle Run Everything or show its status. Alias /auto-run.

Session

/clearStart a new chat session. Aliases /new, /new-chat, /newchat.
/resumeOpen recent chats and resume one.
/forkFork the current chat into a new session.
/rename <name>Rename the current chat session.
/summarizeSummarize the conversation to reduce context. Alias /compress.
/rewindJump back to a previous message.
/copyCopy a previous user message to the clipboard.
/copy-request-id | /copy-conversation-idCopy the last request ID / current conversation ID.
/quit | /exitExit.

System & interface

/shell [command]Enter Shell Mode (see below). Aliases /sh, /run.
/sandboxConfigure sandbox mode and network access interactively.
/mcp [list|list-tools] [id]Manage MCP servers and list a server's tools. Type to filter the server list.
/plugin [subcommand]Manage plugins and marketplaces.
/configConfigure CLI settings interactively.
/vim | /line-numbers | /show-thinking | /status-indicatorsToggle Vim keys, code-block line numbers, thinking blocks, terminal-title status.
/setup-terminalConfigure terminal newline keybindings (see Keyboard).
/about | /logsVersion, system, account info / debug log path. Both copy to the clipboard.
/openOpen the repository's git root in Cursor. Alias /cursor.
/update | /logout | /help [command] | /feedback <msg>Update the CLI, sign out, get help, send feedback to the team.
/bedrock [subcommand]Configure Bedrock when the Bedrock feature is enabled.

no matches in this section

Keyboard & input

@Select files and folders to include in context.
& <message>Prepend to any message to hand the task to a Cloud Agent — it keeps running while you're away; pick it up at cursor.com/agents.
Shift+TabRotate between Agent, Plan, and Ask modes.
Shift+EnterNewline. Native in iTerm2, Ghostty, Kitty, Warp, Zed; other terminals run /setup-terminal.
Ctrl+J / \ + EnterUniversal newline alternatives — work in every terminal, including tmux and screen.
ArrowUpCycle through previous messages.
Ctrl+RReview changes. i adds follow-up instructions; ↑/↓ scroll, ←/→ switch files.
Ctrl+OExpand truncated command output.
Ctrl+CCancel a hanging command; in Shell Mode, clears and exits.
Ctrl+DExit the CLI. Standard shell behaviour — press twice.
y / nApprove or reject a proposed terminal command before it runs.

no matches in this section

Shell mode

Run shell commands without leaving the conversation — quick, non-interactive, permission-checked.

/shell [command]Enter Shell Mode; commands run in your login shell ($SHELL) with the CLI's cwd and environment.
cd <dir> && …cd does not persist between commands — chain it each time you need another directory.
30s timeoutCommands time out after 30 seconds (not configurable). No servers, no interactive prompts.
TabOn the permission banner: add the command to your allowlist. Commands with redirection can't be allowlisted inline.
Esc / Backspace on empty inputExit Shell Mode.

no matches in this section

Headless & output

Print mode for scripts, CI, and automation. Auth via CURSOR_API_KEY in CI.

agent -p "prompt"Text answer, no file changes applied — proposals only.
agent -p --force "prompt"Apply file changes directly, no confirmation. The headless write switch.
--output-format jsonOne JSON object on success: result, session_id, duration_ms. Failures exit non-zero with stderr, no JSON.
--output-format stream-jsonNDJSON events: system init, one assistant line per message, tool_call started/completed, terminal result.
--stream-partial-outputCharacter-level deltas. Keep events with timestamp_ms and no model_call_id; the other two kinds are duplicate flushes.
agent -p "describe ./screenshot.png"Reference file paths in the prompt — the agent reads them (images included) via tool calls.
echo "$HOME/.cursor/bin" >> $GITHUB_PATHGitHub Actions: install with the curl one-liner, add to PATH, auth via a CURSOR_API_KEY secret.

no matches in this section

Permissions & sandbox

Permission tokens live in permissions.allow / permissions.deny; deny rules win.

Permission tokens

Shell(git) · Shell(curl:*)Shell access by command base; command:args globs match arguments too.
Read(src/**/*.ts) · Write(package.json)File read/write access by path or glob. Relative paths scope to the workspace.
WebFetch(*.example.com)Domains the web-fetch tool may hit without prompting. * = any domain — use with caution.
Mcp(server:tool)MCP tools by server and tool name, * wildcards on either side.

Modes & sandbox

approvalMode allowlist|auto-review|unrestrictedConfig-file setting for how tool calls get approved. Auto-review availability is admin-controlled.
agent sandbox enable | disable | resetSandbox mode for command execution vs allowlist mode. In-session: /sandbox (network access too).
agent sandbox run <cmd>Run one command sandboxed with workspace read/write. --allow-paths, --readonly-paths, --blocked-patterns, --network, --sb-debug.
sudo promptingElevated commands get a masked password prompt over secure IPC — the model never sees the password.

no matches in this section

Config & files

~/.cursor/cli-config.jsonGlobal CLI config: model, editor.vimMode, permissions, approvalMode, display toggles, attribution.*. Pure JSON, self-repairing.
.cursor/cli.jsonProject-level config — permissions only; everything else must be global.
CURSOR_CONFIG_DIR | XDG_CONFIG_HOMERelocate the config directory.
.cursor/rules/Same rules system as the editor, auto-loaded. AGENTS.md and CLAUDE.md at the project root are applied as rules too.
.cursor/mcp.json · ~/.cursor/mcp.jsonProject / global MCP servers — the CLI reuses the editor's configuration. Variables like ${workspaceFolder} resolve.
notifications · hints · rewind · suggestNextPromptOptional config booleans: terminal notification on finish, working hints, /rewind support, next-prompt suggestions.
attribution.attributeCommitsToAgent"Made with Cursor" trailer on agent commits (default true); attributePRsToAgent for PR footers.
HTTP_PROXY · HTTPS_PROXY · NODE_USE_ENV_PROXY=1Proxy support; NODE_EXTRA_CA_CERTS for SSL inspection, network.useHttp1ForAgent for proxies without HTTP/2.

no matches in this section

MCP & integrations

agent mcp list | list-tools <id>Configured servers and their status / a server's tools and argument names.
agent mcp login <id>Authenticate with an OAuth MCP server from .cursor/mcp.json or ~/.cursor/mcp.json.
agent mcp enable | disable <id>Add a server to the local approved list / stop it loading or prompting.
agent acpRun the CLI as an ACP (Agent Client Protocol) server over stdio JSON-RPC — for custom client integrations. Hidden from help.
agent worker --pool --pool-name <name>Register the private worker for pool assignment; one cloud agent claims it at a time. --worker-dir, --label, --management-addr shape it.

no matches in this section