A command-line interface tool for managing Cursor Background Agents built with Go and Cobra.
- π Easy Setup: Initialize with your API key using
cursor-cli init - π¨ Interactive TUI: Rich text-based user interface with real-time updates
- π List Agents: View all your background agents with pagination support
- π Agent Status: Get detailed status and information about specific agents
- π¬ Conversation History: View the conversation history of any agent
- π€ Follow-up Instructions: Send additional instructions to running agents
- π API Key Management: View information about your current API key
- βοΈ Configuration: Stores API key securely in
~/.cursor-cli.yaml - π Auto-refresh: Real-time agent status updates every 30 seconds
- β¨οΈ Keyboard Shortcuts: Efficient navigation with vim-like key bindings
git clone https://github.com/satishbabariya/cursor-background-agent-cli.git
cd cursor-background-agent-cli
go build -o cursor-cli
sudo mv cursor-cli /usr/local/bin/go install github.com/satishbabariya/cursor-background-agent-cli@latest-
Initialize the CLI with your API key:
cursor-cli init
Get your API key from Cursor Dashboard β Integrations.
-
Launch the interactive TUI (recommended):
cursor-cli tui
-
Or use individual CLI commands:
cursor-cli list # List agents cursor-cli status bc_abc123 # Get agent status cursor-cli conversation bc_abc123 # View conversation
Launch the interactive Text User Interface for the best experience managing your background agents.
Features:
- π Real-time Dashboard: Live agent status updates with color-coded indicators
- π Agent Details: Comprehensive view of agent information, source, and target details
- π¬ Conversation Viewer: Scrollable conversation history with message threading
- π Follow-up Composer: Send additional instructions with both short and long message modes
- βοΈ Settings Panel: Configure auto-refresh and other preferences
- β Built-in Help: Comprehensive keyboard shortcut reference
Keyboard Shortcuts:
β/βorj/k: Navigate up/downEnter: Select/view detailsd: View agent detailsc: View conversationf: Send follow-up (running agents only)t: Toggle show all/active agentsr: Refresh agentss: Settings?: Helpq: Quit
Views:
- Dashboard: Main view showing all agents in a table format
- Details: Detailed agent information including repository, branch, and summary
- Conversation: Full conversation history with the agent
- Follow-up: Compose and send additional instructions
- Settings: Configure application preferences
- Help: Comprehensive keyboard shortcut reference
Initialize cursor-cli with your API key. This will prompt you to enter your API key and validate it.
List background agents associated with your account. By default, only active agents (running, completed, failed, cancelled) are shown, excluding expired ones.
Flags:
-l, --limit int: Number of agents to return (1-100, default: 20)-c, --cursor string: Pagination cursor from previous response-a, --all: Show all agents including expired ones
Examples:
cursor-cli list # Show only active agents
cursor-cli list --all # Show all agents including expired
cursor-cli list --limit 50 # Show 50 active agents
cursor-cli list --cursor bc_def456 # Get next pageGet the current status and detailed information about a specific background agent.
Example:
cursor-cli status bc_abc123Retrieve the conversation history of a background agent.
Example:
cursor-cli conversation bc_abc123Send an additional instruction to a running background agent.
Example:
cursor-cli followup bc_abc123 "Also add a section about troubleshooting"Display information about your current API key.
Example:
cursor-cli keyinfoThe CLI stores your API key in ~/.cursor-cli.yaml. You can also set the API key using:
- Environment variable:
CURSOR_API_KEY - Command-line flag:
--api-key
This CLI is built on top of the Cursor Background Agents API. The following endpoints are supported:
GET /v0/agents- List AgentsGET /v0/agents/{id}- Agent StatusGET /v0/agents/{id}/conversation- Agent ConversationPOST /v0/agents/{id}/followup- Add Follow-upGET /v0/me- User/API Key Info
The CLI provides clear error messages for common issues:
- API key not set: Run
cursor-cli initto set up your API key - Invalid API key: Check that your API key is correct and active
- Network errors: Check your internet connection
- Agent not found: Verify the agent ID is correct
- Go 1.21 or later
- Access to Cursor Background Agents API
git clone https://github.com/satishbabariya/cursor-background-agent-cli.git
cd cursor-background-agent-cli
go mod download
go build -o cursor-cliβββ cmd/ # Cobra commands
β βββ root.go # Root command and configuration
β βββ init.go # API key initialization
β βββ list.go # List agents command
β βββ status.go # Agent status command
β βββ conversation.go # Agent conversation command
β βββ followup.go # Add follow-up command
β βββ keyinfo.go # API key info command
βββ internal/
β βββ client/ # API client
β β βββ client.go # HTTP client and API methods
β βββ config/ # Configuration management
β βββ config.go # Config file handling
βββ main.go # Entry point
βββ go.mod # Go module file
βββ README.md # This file
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
- π Cursor Background Agents Documentation
- π Report Issues
- π¬ Cursor Discord - #background-agent channel