Cursor CLI Tutorial — Overview
2 min read
Cursor CLI lets you invoke Cursor's AI capabilities directly from the terminal — no Cursor window required. You can still ask the AI to write code, edit files, or answer questions. For engineers who live in the terminal, it's like having an assistant on call at all times.
Why Learn the CLI?
| Scenario | Using Cursor Window | Using Cursor CLI |
|---|---|---|
| Editing code on a server | Requires SSH + remote setup or sync | Run commands directly in the terminal |
| Writing scripts, CI automation | Hard to integrate into a pipeline | Non-interactive mode, one command to run |
| Already working in the terminal | Have to switch to the IDE and back | Ask the AI in the same window |
| Prefer keyboard-driven workflow | Mouse clicks unavoidable | Everything done with commands |
In short: the CLI lets the AI follow your workflow, instead of forcing you to adapt to the IDE.
Course Map
| File | Topic | Estimated Time |
|---|---|---|
| 01-install | Installation & verification | 5 min |
| 02-basic-usage | Basic usage: commands & conversation | 10 min |
| 03-modes | Three modes: Agent / Plan / Ask | 8 min |
| 04-non-interactive | Non-interactive mode & scripts | 8 min |
| 05-tips | Tips & FAQ | 5 min |
| 06-cursor-cli-with-worktree | CLI with Worktree for parallel development | 8 min |
| 07-unlimit-loop-debug | Infinite debug loop: run until tests pass | 10 min |
Prerequisites
- Cursor installed (or at least a Cursor account you can log into)
- A Cursor subscription (the CLI requires a subscription)
- Basic terminal proficiency
Start at 01-install to get the CLI set up first.