Get started with Cursor CLI to code in your terminal
Cursor CLI lets you interact with AI agents directly from your terminal to write, review, and modify code. Whether you prefer an interactive terminal interface or print automation for scripts and CI pipelines, the CLI provides powerful coding assistance right where you work.
Copy
Ask AI
# Installcurl https://cursor.com/install -fsS | bash# Run interactive sessioncursor-agent
Cursor CLI is currently in beta, we’d love your feedback on it!
Use print mode for non-interactive scenarios like scripts, CI pipelines, or automation:
Copy
Ask AI
# Run with specific prompt and modelcursor-agent -p "find and fix performance issues" --model "gpt-5"# Use with git changes included for reviewcursor-agent -p "review these changes for security issues" --output-format text
Resume previous conversations to maintain context across multiple interactions:
Copy
Ask AI
# List all previous chatscursor-agent ls# Resume latest conversation cursor-agent resume# Resume specific conversationcursor-agent --resume="chat-id-here"