Overview
Cursor Agent CLI is Cursor’s AI-powered coding assistant that provides intelligent code assistance, file operations, and browser automation. PraisonAI integrates with Cursor CLI to use it as an external agent.Installation
Authentication
Login with your Cursor account:Basic Usage with PraisonAI
CLI Options Reference
Core Options
| Option | Description | Default |
|---|---|---|
prompt (positional) | Initial prompt for the agent | - |
-v, --version | Output version number | - |
-h, --help | Display help | - |
Authentication
| Option | Description |
|---|---|
--api-key <key> | API key (or use CURSOR_API_KEY env var) |
-H, --header <header> | Add custom header (format: Name: Value) |
Output Options
| Option | Description | Default |
|---|---|---|
-p, --print | Print responses to console (non-interactive) | false |
--output-format <format> | Output format: text, json, or stream-json | text |
--stream-partial-output | Stream partial output as text deltas | false |
Model Selection
| Option | Description |
|---|---|
--model <model> | Model to use (e.g., gpt-5, sonnet-4, sonnet-4-thinking) |
Execution Modes
| Option | Description | Default |
|---|---|---|
-f, --force | Force allow commands unless explicitly denied | false |
-c, --cloud | Start in cloud mode (open composer picker) | false |
--browser | Enable browser automation support | false |
--approve-mcps | Auto-approve all MCP servers (headless only) | false |
Workspace
| Option | Description |
|---|---|
--workspace <path> | Workspace directory (defaults to current directory) |
Session Management
| Option | Description |
|---|---|
--resume [chatId] | Resume a chat session |
Commands
| Command | Description |
|---|---|
cursor-agent [prompt...] | Start the Cursor Agent (default) |
cursor-agent agent [prompt...] | Start the Cursor Agent |
cursor-agent login | Authenticate with Cursor |
cursor-agent logout | Sign out and clear authentication |
cursor-agent status / whoami | View authentication status |
cursor-agent update / upgrade | Update to latest version |
cursor-agent mcp | Manage MCP servers |
cursor-agent create-chat | Create new empty chat and return ID |
cursor-agent ls | List chat sessions |
cursor-agent resume | Resume latest chat session |
cursor-agent install-shell-integration | Install shell integration to ~/.zshrc |
cursor-agent uninstall-shell-integration | Remove shell integration |
Examples
Basic Query
Non-Interactive Mode
Force Mode
Model Selection
Output Formats
Browser Automation
Session Management
Cloud Mode
Python Integration
Environment Variables
| Variable | Description |
|---|---|
CURSOR_API_KEY | Cursor API key |
NO_OPEN_BROWSER | Disable browser opening during login |
Output Formats
Text Format (Default)
JSON Format
Stream JSON Format
Shell Integration
Install shell integration for easier access:cursor command directly in your terminal.

