Cursor CLI Basic Usage
2 min read
The Most Common Approach: cursor agent
Run this inside your project directory:
cursor agent "Add a README to this project"- Interactive: the AI will ask questions and make suggestions; you can accept or reject changes
- Context-aware: it reads files in the current directory to inform its responses and edits
One-Shot vs. Conversation
Want to delegate a task directly: Put the instruction in quotes and send it all at once.
cursor agent "Refactor the auth module to use JWT"Want to discuss before acting: Run cursor agent without any arguments to enter conversation mode, where you can describe your requirements step by step and the AI will clarify before making changes.
Specify Which Directory to Work In
By default, it uses the current directory. To specify a path, add --path:
cursor agent "Check and fix TypeScript types" --path ./srcQuick Command Reference
| Command | Description |
|---|---|
cursor agent "do something" |
Ask the AI to do it (can modify files) |
cursor agent |
Enter conversation mode without a task |
cursor ask "question" |
Ask a question only, no file edits (read-only) |
cursor --help |
See all available options |
Summary
- Most common:
cursor agent "your instruction" - Want to chat first: just run
cursor agent - Ask without editing: use
cursor ask "question" - Specify directory: add
--path <path>
Next: 03-modes — Learn about the Agent / Plan / Ask modes