Cursor API SDK for cloud agents, runs, artifacts, workers, models, repositories, and raw requests.
- Other
- cursor
- cloud-agents
- api
- sdk
- automation
- License
- MIT
- Published
- August 21, 2026
- Pinned commit
a6cc602- Rating
- No ratings yet
- Forks
- 0
- Stars
- 0
- Adaptation effort
- —
README
@kentcdodds/cursor
Intent
SDK for the Cursor Cloud Agents API. Transport is one compact authenticated request helper against https://api.cursor.com (Bearer {{secret:cursorApiKey}}). Domain modules keep agent lifecycle conveniences, artifact download shaping, run stream parsing, and GitHub PR enrichment. Use ./request for any unwrapped path (Enterprise Admin, Analytics, AI-Code-Tracking, Bugbot, etc.).
createAgent always enables the agent's ManagePullRequest tools.
No public Cursor OpenAPI document was available for scaffolding; plumbing is intentionally thin rather than hand-rolled per endpoint.
When To Use
- Launch or manage Cursor Cloud Agents (create, list, follow-up runs, artifacts).
- Inspect fleet/worker utilization for self-hosted pools.
- Discover models and accessible GitHub repositories before creating agents.
- Call unwrapped Cursor API endpoints via
cursorRequest.
Required setup
- Secret
cursorApiKey(user scope): raw API key from cursor.com/dashboard → API Keys (key only, not an Authorization header). Cursor accepts Basic (API_KEY:) or Bearer; this package uses Bearer. - Optional
githubPersonalAccessToken: only foragentsWithOpenGithubPrs.
Exports
| Export | Description |
|---|---|
. | Package overview and domain map |
./request | cursorRequest — raw API escape hatch |
./agents | createAgent, listAgents, getAgent, archiveAgent, unarchiveAgent, deleteAgent, agentStatusOverview, agentsWithOpenGithubPrs |
./runs | createRun, listRuns, getRun, cancelRun, getAgentUsage, readRunStream |
./artifacts | listArtifacts, downloadArtifact |
./workers | listWorkers, getFleetSummary, getWorker, listPendingPoolRequests, createWorkerToken |
./models | listModels |
./repositories | listRepositories |
./me | apiKeyInfo |
Default exports: ./request → cursorRequest; ./agents → listAgents; ./runs → listRuns; ./artifacts → listArtifacts; ./workers → getFleetSummary; ./models → listModels; ./repositories → listRepositories; ./me → apiKeyInfo.
Example
import { createAgent } from 'kody:@kentcdodds/cursor/agents'
import { createRun } from 'kody:@kentcdodds/cursor/runs'
const { agent } = await createAgent({
prompt: 'Add a README with setup instructions',
repository: 'https://github.com/your-org/your-repo',
ref: 'main',
})
const { run } = await createRun({
agentId: agent.id,
prompt: 'Also add a troubleshooting section',
})createAgent always enables ManagePullRequest. If you create an agent through raw cursorRequest, send autoCreatePR: true so those tools are available.
Enterprise-only endpoints via ./request:
import { cursorRequest } from 'kody:@kentcdodds/cursor/request'
await cursorRequest({ path: '/v1/admin/...' })Docs
Report this listing
Log in to report this listing.