Cursor CLI Tutorial — Overview
Cursor CLI brings your AI assistant to the terminal: write, edit, and ask questions without opening the IDE. Perfect for servers, scripts, and keyboard-driven workflows.
8 articles
Cursor CLI brings your AI assistant to the terminal: write, edit, and ask questions without opening the IDE. Perfect for servers, scripts, and keyboard-driven workflows.
Install Cursor CLI in one terminal command using the official script. Supports macOS, Linux, WSL, and Windows.
The most common approach: use cursor agent to run commands or enter conversation mode; cursor ask for read-only questions; use --path to specify a working directory.
Agent modifies files, Plan drafts a plan before acting, Ask is read-only. One sentence to tell them apart — and learn to switch with slash commands mid-conversation.
Use --no-interactive to let the AI run to completion without waiting for input. Perfect for scripts and CI. Optionally pick --model or use -c to run in the cloud.
Resume conversations with --resume, confirm before running commands, use CLI alongside the IDE, plus answers to FAQs about command not found, pricing, and server usage.
Worktree gives the same repo multiple directories; CLI acts on whichever directory it runs in. Together they enable parallel work across branches with multiple terminals.
Write a shell script that has cursor agent automatically fix code, run tests, and if tests fail let the AI fix again — repeating until all tests pass.