Skip to content

Record a walkthrough from a collected PR

This agent records a walkthrough for a pull request you already opened. The host fetches title, body, and files, writes pr.md and files.md, then starts the turn. The model reads those files. It does not fetch the PR.

Scaffold

bash
npx @cursor/july init ./demo-agent --template demo

init writes the project, installs dependencies, and puts agent-sdk on PATH.

Log in

Model turns use your Cursor account.

bash
cd demo-agent
agent-sdk login

The command opens a browser if you have no stored credential.

Collect the PR

The host needs GitHub credentials so it can read the PR and comment: GITHUB_TOKEN, GH_TOKEN, or gh auth.

In the playground, run /queue/pr and paste a PR URL or owner/repo#N.

bash
curl -X POST http://127.0.0.1:3000/demo-agent/v1/channels/queue/pr \
  -H 'content-type: application/json' \
  -d '{ "pr": "acme/shop#42" }'

The host fetches title, body, and files, writes pr.md and files.md, and starts the turn. Retries coalesce on pr:owner/repo#N.

GitHub label demo or comment /demo when you terminate webhooks yourself: self-host and set GITHUB_WEBHOOK_SECRET. Hosted Cursor aliases require X-Agent-Alias-Token, which GitHub cannot send.

record_demo comments on that key. Eval sessions skip the comment.

First walkthrough

bash
agent-sdk dev

Open the playground. Run /queue/pr with a PR. The model reads the seeded files and calls record_demo once. Turns are sandboxed with read and grep only: PR title and body are untrusted.

Evals

One smoke case. The host seeds pr.md and files.md. No GitHub call.

bash
agent-sdk eval

Deploy

bash
agent-sdk deploy

Run it from the agent's git checkout. It infers repository, ref, path, and slug, builds on Cursor-managed hosting, and prints the URL. agent-sdk deployments shows status.

Playground and /queue/pr need the alias token. GitHub label and /demo stay on a self-hosted agent with a webhook secret.