Cursor Editor CLI Cheatsheet - AI Editor Command Line & Agent Flags
Cursor is the VS Code-based AI editor; its CLI and cursor-agent target developers who open projects quickly, manage windows/extensions, and want editor + AI capability inside scripts. Unlike a plain editor CLI, Cursor adds in-editor AI coding and the headless-callable cursor-agent. This sheet covers opening/comparing files from the terminal, agent automation, and git editor integration.
Open Files & Folders 6
cursor .Open the current directory as a workspace
cursor /path/to/file.tsOpen a specific file
cursor /path/to/file.ts:42Open a file and jump to line 42
cursor /path/to/file.ts:42:10Jump to a specific line and column
cursor /path/to/projectOpen an entire folder
cursor file1.ts file2.ts file3.tsOpen multiple files at once
Window Management 6
cursor -n /path/to/projectOpen in a new window (--new-window)
cursor -r /path/to/fileReuse an already-open window (--reuse-window)
cursor -w /path/to/fileWait for the window to close (--wait, good as git editor)
cursor --mergeMerge all windows into a single window
cursor --add /path/to/folderAdd a folder to the current workspace (--add/-a)
cursor --locale zh-TWSpecify the UI locale
Diff & Merge 2
cursor -d file1.ts file2.tsCompare two files side by side (--diff)
cursor -m base.ts mine.ts theirs.ts out.tsThree-way merge (--merge)
Extension Management 4
cursor --list-extensionsList installed extensions
cursor --install-extension esbenp.prettier-vscodeInstall a specific extension
cursor --uninstall-extension <id>Uninstall a specific extension
cursor --disable-extensionsLaunch with all extensions disabled
Rendering & Performance 7
cursor --disable-gpuDisable GPU hardware acceleration
cursor --disable-hardware-accelerationDisable hardware-accelerated rendering
cursor --user-data-dir /path/to/dataCustom user data directory
cursor --extensions-dir /path/to/extCustom extensions directory
cursor --max-memory 4096Cap maximum memory (MB)
cursor --verbose /path/to/fileEnable verbose logging
cursor --statusPrint process usage info
Remote Development 5
cursor --remote ssh-remote+hostConnect to a configured SSH remote
cursor --folder-uri vscode-remote://ssh-remote+host/pathOpen a remote folder URI
cursor --file-uri vscode-remote://.../file.tsOpen a remote file URI
cursor --proxy-server http://proxy:8080Use a proxy server
cursor --no-proxy-serverDo not use a proxy
Debug & Diagnostics 5
cursor --inspectEnable debugging (default port 9229)
cursor --inspect-brkEnable debugging and pause on first line
cursor --log errorSet log level: trace/debug/info/warn/error/critical
cursor --log-file /tmp/cursor.logSpecify a log file path
cursor --enable-proposed-apiEnable an extension's proposed API
Cursor Agent & Git Integration 3
cursor-agent -p "your question" --mode=ask --output-format textCall 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:128Jump 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
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Aug 5, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us