Skip to content

Agent SDK documentation

Use the Agent SDK to define Cursor agents in TypeScript and Markdown. See Project layout for the directory structure.

Use Node 22.13 or newer. Bun isn't supported.

Create a project:

bash
npx @cursor/july init ./my-agent
cd my-agent
agent-sdk dev

If agent-sdk isn't on PATH, use npx @cursor/july <command>.

Open the docs locally:

bash
npx @cursor/july docs

Where to start

You are...Start with
New to the Agent SDKQuickstart (PR reviewer), then Concepts
Building a new agent with CursorScaffold an agent with Cursor
Turning a Cursor Automation into a projectConvert a Cursor Automation
Learning from working agentsExample agents
Wiring an agent to SlackSlack guide
Starting from a packaged templateDemo, Security reviewer, or Triage
Wiring an agent to GitHub webhooksGitHub guide
Driving PRs from a cloud VMPR autofixer template
Driving an agent from Linear (or another tracker)Webhooks guide: Linear example
Making an existing agent measurably betterEvals, then Hillclimbing
Comparing variants on live trafficLive A/B metrics
Deploying with Cursor or on your own infrastructureDeployment
Debugging something that misbehavesFix common agent problems

Documentation

Core

Templates

Self-improving Agents

  • Building agents with agents: use a coding agent to scaffold, run, and iterate on your agent.
  • Evals: author defineEval cases, pick fixtures, and use evals as regression checks.
  • Live A/B metrics: assign sticky variants and compare cumulative metrics on live sessions.
  • Storage: point durable storage at a backend you own with defineStorage.
  • Hillclimbing: measure and improve an agent iteratively.

Guides

Example agents

  • Choose the right example: compare all twelve agents by runtime, channels, tools, state, and architecture.
  • Weather agent: explore tools, MCP, approvals, skills, subagents, schedules, hooks, A/B metrics, and evals.
  • Slack agent: put a minimal agent in Slack through an account-linked transport.
  • Concierge: delegate work to a peer agent with its own context and sessions.
  • Playbook router: route Slack intake through inherited repository playbooks.
  • Alert investigator: watch a Slack alerts channel and pin a self-rechecking investigation to every alert thread.
  • PR evidence reviewer: review a host-prepared, diff-first pull-request evidence tree.
  • Approval Buddy: keep approval policy in code while subagents supply review findings.
  • Security Reviewer: run a staged, parallel security pipeline with live playground progress.
  • Remote PR coordinator: hand PR triage from local chat and webhooks to durable remote sessions.
  • Knowledge base: turn conversations about people, systems, decisions, and preferences into shared markdown.
  • Codebase wiki: ingest merged PRs into per-feature pages with a daily digest schedule.
  • Codeowners review: route PR reviews by ownership to per-area playbooks and aggregate verdicts.

Operating

Reference

Run the CLI

Docs use agent-sdk <command>. If it isn't on PATH, use npx @cursor/july <command>.

From packages/agent-serve in a source checkout:

bash
alias agent-sdk="pnpm exec tsx $PWD/src/bin/agent-serve.ts"

Credentials

Sign in to Cursor or set CURSOR_API_KEY:

bash
agent-sdk login
# or: export CURSOR_API_KEY=key_...
agent-sdk whoami

Confirm agent-sdk whoami shows the expected account.