Skip to content
Cursor CLI logo

Cursor CLI cheat sheet

$ agent Cursor Official docs

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.

Install
curl https://cursor.com/install -fsS | bash     # macOS / Linux / WSL
Start & run
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
Sessions & auth
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

FlagWhat it does
-p, --printNon-interactive (print) mode, then exit
--model <m>Pick the model for the run
--output-formattext · json · stream-json
--planPlan mode (alias for --mode=plan)
--mode <m>plan or ask
-f, --forceRun commands without prompting (yolo)
-w [name]Run in a new git worktree

In-session

Command / keyWhat it does
/plan · /askSwitch to Plan / Ask mode
/summarize (/compress)Compact context to free the window
/model [name]Switch model, e.g. /model Auto
/resumeResume an existing conversation
Shift+TabRotate Agent / Plan / Ask
Ctrl+RReview changes
prefix &Hand the message off to a Cloud Agent
Config & one-liners
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.