Skip to content
← Community packages

Cursor API SDK for cloud agents, runs, artifacts, workers, models, repositories, and raw requests.

Browse files

  • 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 for agentsWithOpenGithubPrs.

Exports

ExportDescription
.Package overview and domain map
./requestcursorRequest — raw API escape hatch
./agentscreateAgent, listAgents, getAgent, archiveAgent, unarchiveAgent, deleteAgent, agentStatusOverview, agentsWithOpenGithubPrs
./runscreateRun, listRuns, getRun, cancelRun, getAgentUsage, readRunStream
./artifactslistArtifacts, downloadArtifact
./workerslistWorkers, getFleetSummary, getWorker, listPendingPoolRequests, createWorkerToken
./modelslistModels
./repositorieslistRepositories
./meapiKeyInfo

Default exports: ./requestcursorRequest; ./agentslistAgents; ./runslistRuns; ./artifactslistArtifacts; ./workersgetFleetSummary; ./modelslistModels; ./repositorieslistRepositories; ./meapiKeyInfo.

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.