# Cursor CLI
A terminal-based interface for [[Cursor.com]]'s AI agents. Supports interactive sessions, non-interactive automation (CI/CD, scripts), and cloud agent dispatch.
## Installation
- macOS/Linux/WSL: `curl https://cursor.com/install -fsS | bash`
- Windows PowerShell: `irm 'https://cursor.com/install?win32=true' | iex`
## Operating Modes
- **Agent Mode** (default): full tool access for complex coding tasks
- **Plan Mode** (`--plan` or `/plan` or Shift+Tab): design approach before coding, with clarifying questions
- **Ask Mode** (`--mode=ask` or `/ask`): read-only exploration, no file changes
## Key Commands
```bash
agent # Start interactive session
agent "prompt" # Start with initial instruction
agent ls # List previous conversations
agent resume # Resume latest session
agent --resume="chat-id" # Resume specific conversation
agent -p "prompt" # Non-interactive (piped) mode for scripts/CI
agent -c "prompt" # Start in cloud mode (remote agent)
agent --model "model-name" # Select model
agent --output-format text # Control output format
```
## In-Session Commands
- `& message` -- send a task to [[Cursor Cloud Agents]] mid-conversation
- `/sandbox` or `--sandbox <mode>` -- toggle sandboxed terminal
- `/max-mode [on|off]` -- toggle [[Cursor Max Mode]]
## Notes
- Sudo handling uses a secure masked prompt with direct IPC; the AI never sees passwords
- Vim mode supported
## References
- Documentation: https://www.cursor.com/docs/cli
- Changelog: https://cursor.com/changelog
## Related
- [[Cursor.com]]
- [[Cursor Cloud Agents]]
- [[Cursor Max Mode]]
- [[Claude Code]]