Cursor CLI cheat sheet
Every command, flag and slash command for agent — Cursor's terminal agent — the same models as the editor, driveable headless with Plan / Ask / Agent modes. 14+ commands, verified July 2026.
The installed binary is now agent; cursor-agent still works as a legacy alias (both point at the same binary). Docs use agent throughout.
curl https://cursor.com/install -fsS | bash # macOS / Linux / WSL
agent # interactive TUI
agent "refactor auth to use JWT" # interactive, seeded with a prompt
agent -p "find and fix perf issues" # non-interactive (print) mode
agent --plan "design a migration" # Plan mode
agent --mode ask "explain this repo" # Ask mode (read-only, no edits)
agent -w feature-x "implement it" # run in a new git worktree
agent ls # list previous chats / sessions
agent resume [<chatId>] # resume a conversation (interactive if no id)
agent --continue # continue the most recent conversation
agent login | logout | status | models | update
Key flags
| Flag | What it does |
|---|---|
-p, --print | Non-interactive (print) mode, then exit |
--model <m> | Pick the model for the run |
--output-format | text · json · stream-json |
--plan | Plan mode (alias for --mode=plan) |
--mode <m> | plan or ask |
-f, --force | Run commands without prompting (yolo) |
-w [name] | Run in a new git worktree |
In-session
| Command / key | What it does |
|---|---|
/plan · /ask | Switch to Plan / Ask mode |
/summarize (/compress) | Compact context to free the window |
/model [name] | Switch model, e.g. /model Auto |
/resume | Resume an existing conversation |
Shift+Tab | Rotate Agent / Plan / Ask |
Ctrl+R | Review changes |
prefix & | Hand the message off to a Cloud Agent |
export CURSOR_API_KEY="…" # or: agent login (browser / device flow)
agent -p "fix the failing tests" --model sonnet-4.5 --output-format text
git diff | agent -p "write a commit message for this diff"
agent -p "add input validation to api/users" -f # headless + auto-approve
agent -w feature-x "implement the new endpoint" # isolated worktree
More CLI cheat sheets
Stop memorizing flags
Run Cursor CLI — and every other agent — from one app
TheVibeFather orchestrates Cursor CLI alongside every other coding CLI in one native macOS app. Bring the models you already pay for; keep your keys.
Claude Code
Gemini CLI
Aider
Goose
Qwen Code
Crush
Grok CLI
OpenHands CLI
Cline CLI
Roo Code CLI
Continue CLI