cursor-cloud-agentsDeploy Cursor AI agents to GitHub repos. Automatically write code, generate tests, create documentation, and open PRs using your existing Cursor subscription.
Install via ClawdBot CLI:
clawdbot install ParcostaBot/cursor-cloud-agentsMost common commands and patterns:
# Launch an agent (uses default model: gpt-5.2)
cursor-api.sh launch --repo owner/repo --prompt "Add tests for auth module"
# Check agent status
cursor-api.sh status <agent-id>
# Get conversation history
cursor-api.sh conversation <agent-id>
# Send follow-up message
cursor-api.sh followup <agent-id> --prompt "Also add edge case tests"
# List all agents
cursor-api.sh list
# Check usage/quota
cursor-api.sh usage
Common Options:
--model - Specify model (default: gpt-5.2)--branch - Target branch--no-pr - Don't auto-create PR--no-cache - Bypass cache--verbose - Debug output--background - Run agent in background modeBackground Tasks:
cursor-api.sh launch --repo owner/repo --prompt "..." --background
cursor-api.sh bg-list
cursor-api.sh bg-status <task-id>
cursor-api.sh bg-logs <task-id>
Max Runtime (Background Tasks):
# Default is 24 hours
cursor-api.sh launch --repo owner/repo --prompt "..." --background
# Custom max runtime (2 hours)
cursor-api.sh launch --repo owner/repo --prompt "..." --background --max-runtime 7200
# Unlimited runtime (not recommended)
cursor-api.sh launch --repo owner/repo --prompt "..." --background --max-runtime 0
# Set default via environment variable
export CURSOR_BG_MAX_RUNTIME=43200 # 12 hours
cursor-api.sh launch --repo owner/repo --prompt "..." --background
Short Commands (cca aliases):
For faster daily usage, source the cca-aliases.sh file:
source scripts/cca-aliases.sh
Then use cca instead of cursor-api.sh:
cca list # List agents
cca launch --repo ... # Launch agent
cca status <id> # Check status
cca conversation <id> # Get conversation
cca followup <id> --prompt # Send followup
cca delete <id> # Delete agent
Exit Codes: 0=Success, 1=API Error, 2=Auth, 3=Rate Limit, 4=Repo Access, 5=Invalid Args
This skill wraps the Cursor Cloud Agents HTTP API, allowing OpenClaw to dispatch coding tasks to Cursor's cloud agents, monitor their progress, and incorporate results.
Use this skill when you need to:
The skill automatically discovers your Cursor API key from these locations (in order):
CURSOR_API_KEY~/.openclaw/.env~/.openclaw/.env.local.env in current directory~/.cursor/config.jsonRecommended: Add to ~/.openclaw/.env:
CURSOR_API_KEY=your_cursor_api_key_here
To get your API key:
Verify it's working:
cursor-api.sh me
Launch an agent and let it work independently. Check back later.
# Launch agent (uses default model: gpt-5.2)
cursor-api.sh launch --repo owner/repo --prompt "Add comprehensive tests for auth module"
# Launch with specific model
cursor-api.sh launch --repo owner/repo --prompt "Add tests" --model claude-4-opus
# Response: {"id": "agent_123", "status": "CREATING", ...}
# Later - check status
cursor-api.sh status agent_123
Note: If no --model is specified, the default model (gpt-5.2) will be used automatically. You'll see a message indicating which model is being used.
Best for: Tasks that don't need immediate attention, exploratory work
Launch, monitor, and report results when complete.
# 1. Launch
cursor-api.sh launch --repo owner/repo --prompt "Implement user authentication"
# 2. Poll for completion (check every 60 seconds)
while true; do
status=$(cursor-api.sh status agent_123)
if [[ $(echo "$status" | jq -r '.status') == "FINISHED" ]]; then
break
fi
sleep 60
done
# 3. Get results
cursor-api.sh conversation agent_123 | jq -r '.messages[] | select(.role == "assistant") | .content'
Best for: Important tasks where you want to report completion
Launch, review, and send follow-ups to refine work.
# 1. Launch initial task
cursor-api.sh launch --repo owner/repo --prompt "Add login page"
# 2. Review conversation
cursor-api.sh conversation agent_123
# 3. Send follow-up
cursor-api.sh followup agent_123 --prompt "Also add form validation and error handling"
# 4. Final review when done
cursor-api.sh conversation agent_123
Best for: Complex tasks requiring multiple iterations
For long-running tasks, launch agents in background mode and check on them later.
# Launch in background
result=$(cursor-api.sh launch --repo owner/repo --prompt "Refactor entire codebase" --background)
task_id=$(echo "$result" | jq -r '.background_task_id')
echo "Task started: $task_id"
# List active background tasks
cursor-api.sh bg-list
# Check specific task status
cursor-api.sh bg-status $task_id
# View logs
cursor-api.sh bg-logs $task_id
# List all tasks including completed ones
cursor-api.sh bg-list --all
Background tasks are monitored automatically and logs are saved to ~/.cache/cursor-api/background-tasks/.
Best for: Long-running tasks (10+ minutes), batch operations, CI/CD integration
cursor-api.sh list
Returns all agents with status, repo, and creation time.
cursor-api.sh launch --repo owner/repo --prompt "Your task description" [--model model-name] [--branch branch-name] [--no-pr] [--background]
Options:
--repo (required): Repository in owner/repo format--prompt (required): Initial instructions for the agent--model (optional): Model to use (defaults to gpt-5.2 if not specified)--branch (optional): Target branch name (auto-generated if omitted)--no-pr (optional): Don't auto-create a PR--background (optional): Run agent in background modeNote: When launched without --model, the skill automatically uses gpt-5.2 and displays a message indicating which model is being used.
Background Mode: When using --background, the command returns immediately with a background_task_id. Use bg-list, bg-status, and bg-logs to monitor progress.
cursor-api.sh status <agent-id>
Returns:
status: CREATING, RUNNING, FINISHED, STOPPED, ERRORsummary: Summary of work done (if finished)prUrl: URL to created PR (if any)cursor-api.sh conversation <agent-id>
Returns full message history including all prompts and responses.
cursor-api.sh followup <agent-id> --prompt "Additional instructions"
Resumes a stopped or finished agent with new instructions.
cursor-api.sh stop <agent-id>
Stops a running agent gracefully.
cursor-api.sh delete <agent-id>
Permanently deletes an agent and its conversation history.
cursor-api.sh models
Returns available models for agent tasks.
cursor-api.sh me
Returns account information including subscription tier.
cursor-api.sh verify owner/repo
Checks if the specified repository is accessible by Cursor agents.
Exit code 4 if repository not accessible.
cursor-api.sh usage
Returns usage information including:
cursor-api.sh clear-cache
Clears the response cache.
cursor-api.sh bg-list [--all]
List background tasks. By default, excludes completed tasks. Use --all to include finished tasks.
cursor-api.sh bg-status <task-id>
Get detailed status of a background task including current agent state.
cursor-api.sh bg-logs <task-id>
Show logs for a background task. Logs include status changes and any PR URLs created.
The skill enforces a 1 request per second rate limit locally to avoid API rate limits. This is applied automatically to all API calls.
If you hit Cursor's API rate limit (HTTP 429), the script exits with code 3.
GET requests (list, status, conversation, models, me) are cached for 60 seconds by default. To disable caching for a command:
cursor-api.sh --no-cache status agent_123
To change the cache TTL, set the environment variable:
export CURSOR_CACHE_TTL=120 # 2 minutes
cursor-api.sh status agent_123
| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | API error (including non-existent resources) |
| 2 | Authentication missing or invalid |
| 3 | Rate limited |
| 4 | Repository not accessible |
| 5 | Invalid arguments |
The skill includes a comprehensive test suite (cca-comprehensive-test.sh) that validates:
All tests pass with proper exit codes. Error conditions are correctly handled and return appropriate exit codes.
Based on available documentation and API behavior, Cursor Cloud Agents have the following limits:
| Tier | Concurrent Agents | Notes |
|------|-------------------|-------|
| Free | 1 | Limited to basic models |
| Pro | 3 | Access to most models |
| Ultra | 5 | Full model access, priority queue |
These limits are enforced at the account level across all agents. If you exceed the limit, the API returns HTTP 429 with code CONCURRENT_LIMIT.
To check your current usage:
cursor-api.sh usage | jq '.usage.agentsUsed, .limits.concurrentAgents'
Best practices:
cursor-api.sh list to monitor active agentsNote: Concurrent limits are subject to change. Check cursor-api.sh usage for your current account limits.
Before launching, verify the repository is accessible:
if cursor-api.sh verify owner/repo >/dev/null 2>&1; then
cursor-api.sh launch --repo owner/repo --prompt "..."
else
echo "Repository not accessible. Install the Cursor GitHub App."
fi
Good prompt:
"Add comprehensive unit tests for the auth module in src/auth/, covering login, logout, and token refresh. Use Jest and mock external API calls."
Bad prompt:
"Add some tests"
Monitor your quota:
cursor-api.sh usage | jq '.usage'
Delete agents you no longer need:
cursor-api.sh list | jq -r '.[] | select(.status == "FINISHED") | .id' | while read id; do
cursor-api.sh delete "$id"
done
Typical task durations:
--max-runtime 900--max-runtime 3600--max-runtime 21600--max-runtime 86400 (default)# Check remaining time
cursor-api.sh bg-status <task-id> | jq '.remaining_seconds'
# Set custom max runtime
cursor-api.sh launch --repo owner/repo --prompt "Migrate database schema" --background --max-runtime 43200 # 12 hours
Always check exit codes in scripts:
if ! response=$(cursor-api.sh launch --repo owner/repo --prompt "..." 2>&1); then
case $? in
2) echo "Authentication error - check CURSOR_API_KEY" ;;
3) echo "Rate limited - try again later" ;;
4) echo "Repository not accessible" ;;
*) echo "API error: $response" ;;
esac
fi
Use these templates for common follow-up scenarios:
Also add tests for edge cases: empty input, null values, and maximum length limits.
The current implementation doesn't handle [specific case]. Please update it to [requirement].
Add comprehensive JSDoc comments to all public functions and a brief README section explaining the feature.
Refactor the code to use more descriptive variable names and extract complex logic into helper functions.
For local tasks (not on GitHub repos), also configure the Cursor Agent CLI as a cliBackend:
// In your OpenClaw config
{
"cliBackends": {
"cursor-agent": {
"command": "agent",
"args": ["-p", "--force", "--output-format", "text"],
"output": "text",
"input": "arg",
"env": {
"CURSOR_API_KEY": "${CURSOR_API_KEY}"
}
}
}
}
This enables cursor-agent as a backend for local file operations, while this skill handles Cloud Agents for GitHub repos.
owner/repo format)CURSOR_API_KEY is set in your environmentcursor-api.sh usageAgents may take 1-2 minutes to start. If stuck longer:
AI Usage Analysis
Analysis is being generated⦠refresh in a few seconds.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection