Cursor Editor CLI Cheatsheet - AI Editor Command Line & Agent Flags

All Cursor editor CLI and Agent commands in one place — from opening files to diff compare, extension management, and Agent calls — organized by scenario. Copy and go.

AI CLI·38 commands·Last updated 2026-08-05
Back to AI CLI

Open Files & Folders 6

cursor .
Open the current directory as a workspace
cursor /path/to/file.ts
Open a specific file
cursor /path/to/file.ts:42
Open a file and jump to line 42
cursor /path/to/file.ts:42:10
Jump to a specific line and column
cursor /path/to/project
Open an entire folder
cursor file1.ts file2.ts file3.ts
Open multiple files at once

Window Management 6

cursor -n /path/to/project
Open in a new window (--new-window)
cursor -r /path/to/file
Reuse an already-open window (--reuse-window)
cursor -w /path/to/file
Wait for the window to close (--wait, good as git editor)
cursor --merge
Merge all windows into a single window
cursor --add /path/to/folder
Add a folder to the current workspace (--add/-a)
cursor --locale zh-TW
Specify the UI locale

Diff & Merge 2

cursor -d file1.ts file2.ts
Compare two files side by side (--diff)
cursor -m base.ts mine.ts theirs.ts out.ts
Three-way merge (--merge)

Extension Management 4

cursor --list-extensions
List installed extensions
cursor --install-extension esbenp.prettier-vscode
Install a specific extension
cursor --uninstall-extension <id>
Uninstall a specific extension
cursor --disable-extensions
Launch with all extensions disabled

Rendering & Performance 7

cursor --disable-gpu
Disable GPU hardware acceleration
cursor --disable-hardware-acceleration
Disable hardware-accelerated rendering
cursor --user-data-dir /path/to/data
Custom user data directory
cursor --extensions-dir /path/to/ext
Custom extensions directory
cursor --max-memory 4096
Cap maximum memory (MB)
cursor --verbose /path/to/file
Enable verbose logging
cursor --status
Print process usage info

Remote Development 5

cursor --remote ssh-remote+host
Connect to a configured SSH remote
cursor --folder-uri vscode-remote://ssh-remote+host/path
Open a remote folder URI
cursor --file-uri vscode-remote://.../file.ts
Open a remote file URI
cursor --proxy-server http://proxy:8080
Use a proxy server
cursor --no-proxy-server
Do not use a proxy

Debug & Diagnostics 5

cursor --inspect
Enable debugging (default port 9229)
cursor --inspect-brk
Enable debugging and pause on first line
cursor --log error
Set log level: trace/debug/info/warn/error/critical
cursor --log-file /tmp/cursor.log
Specify a log file path
cursor --enable-proposed-api
Enable an extension's proposed API

Cursor Agent & Git Integration 3

cursor-agent -p "your question" --mode=ask --output-format text
Call Cursor Agent non-interactively (ask/code modes)
git config --global core.editor "cursor --wait"
Set Cursor as the git commit-message editor
cursor --goto file.py:128
Jump to a specific line in a file (--goto)

💡 Tips

  • Open projects fast from the terminal: `cursor .` beats clicking; compare changes with `cursor -d a.ts b.ts` for an instant diff view.
  • Set Cursor as the git editor (`core.editor "cursor --wait"`) and the commit editor pops up with line numbers, resuming when you close it.
  • In CI/scripts use `--wait` with diff or editor calls so the command blocks until the window closes, chaining steps cleanly.
  • Cursor Agent can be called non-interactively with `cursor-agent -p`, good for ask/code automation inside pipelines.

Official References

Commands are compiled from the official docs below. Click to verify the latest usage.

Maintained by LaoHand

Publicly updated on Aug 5, 2026, continuously proofread against official docs.

Found an error? Report it

Wrong command or description? Open an issue to help us fix it.

Found an error? Report it