@cursor/july 0.1.114 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channels/slack/channel-watch.d.ts +19 -3
- package/dist/channels/slack/channel-watch.d.ts.map +1 -1
- package/dist/channels/slack/channel-watch.js +48 -9
- package/dist/channels/slack/inbound.d.ts +7 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +23 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +87 -8
- package/dist/channels/slack/types.d.ts +11 -12
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.BqkJwOZ-.js → app.D23Y-7Tp.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.CzCCM7N8.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BJAi2KiV.js → VPLocalSearchBox.CWBeTFRZ.js} +1 -1
- package/dist/docs/assets/chunks/{arc.BZpXTgvV.js → arc.DSF2O3pm.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.WYI-7F-Y.js → architectureDiagram-Q4EWVU46.J52Wzbkg.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.CZaUPpg0.js → baseUniq.CQS3LPCt.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.D6UES2pD.js → blockDiagram-DXYQGD6D.Dw339Gr5.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.cwebIe4i.js → c4Diagram-AHTNJAMY.BUdtOaRZ.js} +1 -1
- package/dist/docs/assets/chunks/channel.Bfu4df88.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.fVyFnjxg.js → chunk-4BX2VUAB.CuOrkEqk.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BanufG1c.js → chunk-4TB4RGXK.BJNBcY7U.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.VaSMz5-2.js → chunk-55IACEB6.VJK5LAm_.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.CN2diZOM.js → chunk-EDXVE4YY.BYYLihvj.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.g4ivypu3.js → chunk-FMBD7UC4.CmoW8BXP.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.GZXKn9JJ.js → chunk-OYMX7WX6.DTGY4C-M.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.itXxJZCd.js → chunk-QZHKN3VN.Cg5n67vl.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.-rw2GfvX.js → chunk-YZCP3GAM.C3GR_ia5.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DdfgtaWs.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DdfgtaWs.js +1 -0
- package/dist/docs/assets/chunks/clone.rkmfti6d.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.CmaI5br0.js → cose-bilkent-S5V4N54A.BTRG8N3b.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.4wY9S4Kt.js → dagre-KV5264BT.Bob_bp_p.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.Pc3c0u9W.js → diagram-5BDNPKRD.ggPcs9uO.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CYrWz-nj.js → diagram-G4DWMVQ6.BP0qyJkp.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.Bgj5hukb.js → diagram-MMDJMWI5.B0X24UKr.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.DGMEXalS.js → diagram-TYMM5635.B4rXHFVt.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.GepTV9Im.js → erDiagram-SMLLAGMA._55Rt9oX.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.DVKywg3j.js → flowDiagram-DWJPFMVM.DGP4XvR5.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.C7qt9Mlo.js → ganttDiagram-T4ZO3ILL.BtXtkL4E.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.U30_r82P.js → gitGraphDiagram-UUTBAWPF.B9cPWblK.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CyyMyAWv.js → graph.D8HzNexS.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.Dn9ACW3y.js → infoDiagram-42DDH7IO.Bw7CQUpi.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DlIdIGOA.js → ishikawaDiagram-UXIWVN3A.MwkzF6nQ.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.DZj4vy4E.js → journeyDiagram-VCZTEJTY.DIGFF-3C.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.Dl63eMUV.js → kanban-definition-6JOO6SKY.DhYef2BN.js} +1 -1
- package/dist/docs/assets/chunks/{layout.BLHZLWPH.js → layout.C0XUxuPi.js} +1 -1
- package/dist/docs/assets/chunks/{linear.aXKGKaNw.js → linear.BwNPpZex.js} +1 -1
- package/dist/docs/assets/chunks/{min.zWnFcpcc.js → min.CwAQdL7z.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.Qs4MQBea.js → mindmap-definition-QFDTVHPH.pWsSVLsP.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.BmPHgsk7.js → pieDiagram-DEJITSTG.BDJ3FbBy.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.D5MQ3gwA.js → quadrantDiagram-34T5L4WZ.Co80izyB.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CkdUFrO7.js → requirementDiagram-MS252O5E.JveKw4yx.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.KZrljrAV.js → sankeyDiagram-XADWPNL6.B0A7adPi.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.XMoEW-Lx.js → sequenceDiagram-FGHM5R23.d6JZ5Hre.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BmTzePLj.js → stateDiagram-FHFEXIEX.DWnL0NQl.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.ZEetPk0E.js +1 -0
- package/dist/docs/assets/chunks/{theme.BfQzpxsg.js → theme.MJTLx0hh.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Dug0oamp.js → timeline-definition-GMOUNBTQ.CFS7Ai4c.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BOTHrEFu.js → vennDiagram-DHZGUBPP.CwSlnjCf.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.3gurI8YA.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CoXKdfi6.js → wardleyDiagram-NUSXRM2D.B_8mvtjh.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.DXoSCjAW.js → xychartDiagram-5P7HB3ND.DtjU5H85.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.Bo96y42E.js → guides_slack.md.Bjw2r2gL.js} +5 -5
- package/dist/docs/assets/{guides_slack.md.Bo96y42E.lean.js → guides_slack.md.Bjw2r2gL.lean.js} +1 -1
- package/dist/docs/assets/reference_cli.md.BvnQM8wd.js +97 -0
- package/dist/docs/assets/reference_cli.md.BvnQM8wd.lean.js +1 -0
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +35 -35
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +39 -39
- package/dist/docs/guides/slack.md +16 -1
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +699 -752
- package/dist/docs/llms.txt +1 -1
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +127 -125
- package/dist/docs/reference/cli.md +685 -753
- package/dist/docs/reference/connections.html +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +35 -35
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/pr-autofixer.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/files-backends/cursor-hosted.d.ts +11 -17
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +13 -41
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/artifacts-store.d.ts +11 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -1
- package/dist/internal/artifacts-store.js +113 -18
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +9 -1
- package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
- package/dist/internal/cursor/cursor-api-transport.js +44 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +21 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +26 -0
- package/dist/internal/cursor/store-api-client.d.ts +82 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +227 -0
- package/dist/internal/deploy-client.d.ts +6 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -0
- package/dist/internal/deploy-manifest.d.ts +8 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +7 -1
- package/dist/internal/discovery/agent-config.d.ts +3 -1
- package/dist/internal/discovery/agent-config.d.ts.map +1 -1
- package/dist/internal/discovery/agent-config.js +7 -4
- package/dist/internal/framework-storage-selection.d.ts +1 -1
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +20 -2
- package/dist/internal/reminder-runner.d.ts +79 -1
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +287 -46
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +7 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +13 -15
- package/dist/internal/store-api-protocol.d.ts +134 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +126 -0
- package/dist/memory.d.ts +49 -10
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +193 -50
- package/dist/playground/assets/{index-CrMWlgUU.js → index-Cs0MKsv4.js} +30 -30
- package/dist/playground/assets/index-DLwnR9ys.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/reminders.d.ts +1 -1
- package/dist/reminders.d.ts.map +1 -1
- package/dist/types.d.ts +44 -10
- package/dist/types.d.ts.map +1 -1
- package/docs/guides/slack.md +16 -1
- package/docs/reference/cli.md +686 -754
- package/package.json +1 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/src/channels/slack/channel-watch.ts +57 -8
- package/src/channels/slack/inbound.ts +24 -0
- package/src/channels/slack/slack-channel.ts +127 -4
- package/src/channels/slack/types.ts +11 -12
- package/src/files-backends/cursor-hosted.ts +31 -68
- package/src/index.ts +1 -0
- package/src/internal/artifacts-store.ts +131 -25
- package/src/internal/cli-deploy.ts +12 -1
- package/src/internal/cursor/cursor-api-transport.ts +73 -0
- package/src/internal/cursor/hosted-store-secrets.ts +35 -0
- package/src/internal/cursor/store-api-client.ts +360 -0
- package/src/internal/deploy-client.ts +9 -0
- package/src/internal/deploy-manifest.ts +15 -0
- package/src/internal/discovery/agent-config.ts +8 -6
- package/src/internal/framework-storage-selection.ts +1 -1
- package/src/internal/platform-timers.ts +24 -2
- package/src/internal/reminder-runner.ts +454 -66
- package/src/internal/server.ts +8 -0
- package/src/internal/session-engine.ts +17 -22
- package/src/internal/store-api-protocol.ts +222 -0
- package/src/memory.ts +240 -59
- package/src/reminders.ts +1 -0
- package/src/types.ts +47 -10
- package/dist/docs/assets/chunks/@localSearchIndexroot.BnSgidYE.js +0 -1
- package/dist/docs/assets/chunks/channel.DdM5EfNW.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CjfGHeg2.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CjfGHeg2.js +0 -1
- package/dist/docs/assets/chunks/clone.wSOICb_f.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Cu5X28zZ.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.DXy2i1LS.js +0 -162
- package/dist/docs/assets/reference_cli.md.DLWDz9ij.js +0 -95
- package/dist/docs/assets/reference_cli.md.DLWDz9ij.lean.js +0 -1
- package/dist/playground/assets/index-C61EWMBK.css +0 -1
package/dist/docs/llms-full.txt
CHANGED
|
@@ -3149,11 +3149,16 @@ This example watches `#triage-alerts`, so any substantial top-level
|
|
|
3149
3149
|
message starts a thread even when nobody mentions the bot. The length
|
|
3150
3150
|
guard filters out short posts before they can start a turn.
|
|
3151
3151
|
|
|
3152
|
+
Mentions are global — the bot answers an @mention in any channel it has
|
|
3153
|
+
joined — but listening without a mention names its channels: `allow`
|
|
3154
|
+
must include at least one channel id (`C…`/`G…`) and at most 10 distinct
|
|
3155
|
+
ids. `#name` entries may accompany the ids for readability.
|
|
3156
|
+
|
|
3152
3157
|
```ts
|
|
3153
3158
|
export default slackChannel({
|
|
3154
3159
|
engagement: {
|
|
3155
3160
|
channelPosts: {
|
|
3156
|
-
allow: ["#triage-alerts"],
|
|
3161
|
+
allow: ["C0123ABCDEF", "#triage-alerts"],
|
|
3157
3162
|
posts: "top-level",
|
|
3158
3163
|
debounceMs: 15_000,
|
|
3159
3164
|
},
|
|
@@ -3171,6 +3176,16 @@ export default slackChannel({
|
|
|
3171
3176
|
When you create the app, pass `--channel-posts` and invite the bot to
|
|
3172
3177
|
every channel in the allowlist.
|
|
3173
3178
|
|
|
3179
|
+
On Cursor-managed hosting the id entries also define the delivery set:
|
|
3180
|
+
each becomes a channel-scoped subscription, and a channel post outside
|
|
3181
|
+
the allowlist is dropped at ingress before any compute wakes (replies in
|
|
3182
|
+
threads the agent is already part of still arrive). The same watch runs
|
|
3183
|
+
at admission for each delivered event. `debounceMs` is ignored there:
|
|
3184
|
+
the control plane answers every delivery immediately, and edits arrive
|
|
3185
|
+
as separate deliveries that are dropped at the edge. Channel ids match
|
|
3186
|
+
without any Slack call; `#name` entries are resolved once per pod with
|
|
3187
|
+
the bot token and need the `channels:read` scope.
|
|
3188
|
+
|
|
3174
3189
|
## Control who can message
|
|
3175
3190
|
|
|
3176
3191
|
By default, people outside your workspace get no reply. This matters
|
|
@@ -4631,549 +4646,505 @@ for the full contract.
|
|
|
4631
4646
|
|
|
4632
4647
|
Source: /docs/reference/cli.md
|
|
4633
4648
|
|
|
4634
|
-
# CLI
|
|
4635
|
-
|
|
4636
|
-
`@cursor/july`
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
|
4650
|
-
|
|
|
4651
|
-
|
|
|
4652
|
-
| [`
|
|
4653
|
-
| [`
|
|
4654
|
-
| [`docs`](#docs)
|
|
4655
|
-
| [`
|
|
4656
|
-
| [`
|
|
4657
|
-
| [`
|
|
4658
|
-
| [`
|
|
4659
|
-
| [`
|
|
4660
|
-
| [`
|
|
4661
|
-
| [`
|
|
4662
|
-
| [`
|
|
4663
|
-
| [`
|
|
4664
|
-
| [`
|
|
4665
|
-
| `
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
|
4670
|
-
|
|
|
4671
|
-
| [`
|
|
4672
|
-
| [`
|
|
4673
|
-
| [`
|
|
4674
|
-
| [`
|
|
4675
|
-
| [`
|
|
4676
|
-
| [`
|
|
4677
|
-
| [`
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4649
|
+
# CLI
|
|
4650
|
+
|
|
4651
|
+
`@cursor/july` provides the `agent-sdk` command for developing, inspecting,
|
|
4652
|
+
testing, and deploying Agent SDK projects. Run it with Node 22.13 or newer;
|
|
4653
|
+
Bun isn't supported. Commands exit nonzero when validation or a synchronous
|
|
4654
|
+
request fails; asynchronous commands can exit `0` once work is accepted.
|
|
4655
|
+
|
|
4656
|
+
Use `npx @cursor/july <command>` to run the CLI without a global install.
|
|
4657
|
+
`agent-sdk help` prints top-level help; the Slack, GitHub, GitLab, and
|
|
4658
|
+
Bitbucket command packs provide their own `help` subcommands.
|
|
4659
|
+
|
|
4660
|
+
## Command catalog
|
|
4661
|
+
|
|
4662
|
+
### Development commands
|
|
4663
|
+
|
|
4664
|
+
| Command | Contract |
|
|
4665
|
+
| --- | --- |
|
|
4666
|
+
| `help`, `--help`, `-h` | Print top-level help |
|
|
4667
|
+
| [`serve`](#serve) | Serve one or more agents over HTTP |
|
|
4668
|
+
| [`dev`](#dev) | Serve agents with local-development behavior |
|
|
4669
|
+
| [`docs`](#docs) | Serve the documentation bundled with `@cursor/july` |
|
|
4670
|
+
| [`init`](#init) | Scaffold an Agent SDK project |
|
|
4671
|
+
| [`convert-automation`](#convert-automation) | Export a Cursor Automation into a project |
|
|
4672
|
+
| [`install-skills`](#install-skills) | Refresh the bundled coding-agent skills |
|
|
4673
|
+
| [`info`](#info) | Print the discovered project surface |
|
|
4674
|
+
| [`validate`](#validate) | Check project diagnostics and set the exit status |
|
|
4675
|
+
| [`manifest`](#manifest) | Print deployment metadata as JSON |
|
|
4676
|
+
| [`version`](#version) | Print the installed package version |
|
|
4677
|
+
| [`update`](#update) | Upgrade the installed CLI |
|
|
4678
|
+
| [`login`](#login-logout-whoami) | Sign the host in to Cursor |
|
|
4679
|
+
| [`logout`](#login-logout-whoami) | Remove the stored Cursor credential |
|
|
4680
|
+
| [`whoami`](#login-logout-whoami) | Show the active Cursor credential |
|
|
4681
|
+
|
|
4682
|
+
### Session and eval commands
|
|
4683
|
+
|
|
4684
|
+
| Command | Contract |
|
|
4685
|
+
| --- | --- |
|
|
4686
|
+
| [`chat`](#chat) | Talk to a running agent |
|
|
4687
|
+
| [`resume`](#resume) | Reattach chat to a previous session |
|
|
4688
|
+
| [`run`](#run) | Start or continue work on a local, running, or managed agent |
|
|
4689
|
+
| [`call`](#call) | Call a server tool without a model turn |
|
|
4690
|
+
| [`skill`](#skill) | Read an authored skill without a model turn |
|
|
4691
|
+
| [`logs`](#logs) | Follow or dump agent logs |
|
|
4692
|
+
| [`sessions`](#sessions) | List sessions |
|
|
4693
|
+
| [`session`](#session) | Inspect a session or start a managed session turn |
|
|
4694
|
+
| [`cost`](#cost) | Report token usage and estimated cost |
|
|
4695
|
+
| [`playground`](#playground) | Open an agent's playground |
|
|
4696
|
+
| [`trajectory`](#trajectory) | Summarize a saved event stream |
|
|
4697
|
+
| [`eval`](#eval) | List, run, inspect, or cancel evals |
|
|
4698
|
+
|
|
4699
|
+
### Managed hosting commands
|
|
4700
|
+
|
|
4701
|
+
| Command | Contract |
|
|
4702
|
+
| --- | --- |
|
|
4703
|
+
| [`deploy`](#deploy) | Deploy one or more agents |
|
|
4704
|
+
| [`deployments`](#deployments) | List deployments |
|
|
4705
|
+
| [`deployment`](#deployment) | Inspect one deployment |
|
|
4706
|
+
| [`stop`](#stop) | Stop a deployment |
|
|
4707
|
+
| [`cancel-runs`](#cancel-runs) | Cancel active runs and reminder wakes |
|
|
4708
|
+
| [`event-repos`](#event-repos) | Replace a managed application's event repositories |
|
|
4709
|
+
| [`upgrade`](#upgrade) | Move a managed application to a release |
|
|
4710
|
+
| [`delete`](#delete) | Delete a deployment |
|
|
4711
|
+
| [`rotate-token`](#rotate-token) | Replace a deployment's alias token |
|
|
4712
|
+
| [`secrets`](#secrets) | Set, list, or remove deployment secrets |
|
|
4713
|
+
|
|
4714
|
+
### Connection and channel commands
|
|
4715
|
+
|
|
4716
|
+
| Command | Contract |
|
|
4717
|
+
| --- | --- |
|
|
4718
|
+
| [`mcp`](#mcp) | Proxy an agent's MCP endpoint over stdio |
|
|
4719
|
+
| [`mcp install`](#mcp) | Add the agent to an MCP client config |
|
|
4720
|
+
| [`mcp oauth`](#mcp-oauth) | Authorize an MCP connection |
|
|
4721
|
+
| [`slack`](#slack) | Provision and check Slack channel apps |
|
|
4722
|
+
| [`github`](#github) | Forward, replay, and inspect GitHub webhooks |
|
|
4723
|
+
| [`gitlab`](#gitlab) | Replay and inspect GitLab webhooks |
|
|
4724
|
+
| [`bitbucket`](#bitbucket) | Replay and inspect Bitbucket webhooks |
|
|
4725
|
+
|
|
4726
|
+
## Targets {#choose-a-target}
|
|
4727
|
+
|
|
4728
|
+
Commands that send requests support these targets:
|
|
4729
|
+
|
|
4730
|
+
| Target | Selection | Commands |
|
|
4684
4731
|
| --- | --- | --- |
|
|
4685
|
-
| Ephemeral local server | Omit `--url` and `--prod` | `run`, `call`, `eval` |
|
|
4686
|
-
| Running server | Pass `--url <baseUrl
|
|
4687
|
-
|
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
multi-agent server, such as
|
|
4692
|
-
`--slug`
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
Cursor team. The slug defaults to the `--dir` basename. The team
|
|
4697
|
-
defaults to the signed-in account's team. `--url` and `--prod` are
|
|
4698
|
-
mutually exclusive.
|
|
4699
|
-
|
|
4700
|
-
Use `--bearer-token <token>` when a running server requires bearer
|
|
4701
|
-
authentication. Hosted commands use your Cursor credential to request
|
|
4702
|
-
short-lived engine access. `--api-key` overrides the Cursor credential
|
|
4703
|
-
for `login`, `serve`, hosted targets, and managed-hosting commands.
|
|
4704
|
-
`--state-root` applies to `serve` and ephemeral `run`, `call`, and
|
|
4705
|
-
`eval` servers. Running and hosted targets ignore it.
|
|
4706
|
-
|
|
4707
|
-
For ephemeral `run`, `call`, and `eval` commands, omitting `--slug`
|
|
4708
|
-
selects an unslugged root mount when one exists. Otherwise, the Agent SDK
|
|
4709
|
-
selects the first discovered agent.
|
|
4710
|
-
|
|
4711
|
-
## serve
|
|
4712
|
-
|
|
4713
|
-
`serve` hosts every agent under `--dir` in multi-agent mode by default.
|
|
4714
|
-
|
|
4715
|
-
```bash
|
|
4716
|
-
agent-sdk serve [--dir <path>] [--port 3000] [--host 127.0.0.1] [--dev]
|
|
4717
|
-
[--mode multi|single] [--api-key <key>]
|
|
4718
|
-
[--state-root <path>] [--bearer-token <secret> | --allow-anonymous]
|
|
4719
|
-
[--allow-anonymous-cursor-github]
|
|
4720
|
-
[--allow-anonymous-cursor-account-mcp]
|
|
4721
|
-
[--public-url <url>] [--cloud-tools-url <url>]
|
|
4722
|
-
[--no-schedules] [--no-playground]
|
|
4723
|
-
[--no-docs] [--cursor-events --repo owner/name]...
|
|
4724
|
-
```
|
|
4725
|
-
|
|
4726
|
-
If `--dir` is an agent project, it mounts under its directory name. If
|
|
4727
|
-
it contains agent projects, each child mounts separately. The index
|
|
4728
|
-
lives at `/`. Each agent is available at `/<slug>/v1/*` and
|
|
4729
|
-
`/<slug>/playground`. On a TTY, press Enter to restart.
|
|
4730
|
-
Unless `--state-root` is set, each mount uses a state directory under
|
|
4731
|
-
the agent project. Slugged mounts get a subdirectory named for the slug.
|
|
4732
|
-
|
|
4733
|
-
| Flag | Meaning |
|
|
4732
|
+
| Ephemeral local server | Omit `--url` and `--prod` | `run`, `call`, `skill`, `eval` |
|
|
4733
|
+
| Running server | Pass `--url <baseUrl>` | `chat`, `resume`, `run`, `call`, `skill`, `eval`, `logs`, `sessions`, `session`, `cost`, `playground`, `mcp` |
|
|
4734
|
+
| Default local server | Omit `--url` and `--prod`; uses `http://127.0.0.1:3000` | `chat`, `resume`, `logs`, `sessions`, `session`, `cost`, `playground` |
|
|
4735
|
+
| Hosted deployment | Pass `--prod` | `chat`, `resume`, `run`, `call`, `skill`, `eval`, `logs`, `sessions`, `session`, `cost`, `playground`, `mcp` |
|
|
4736
|
+
| Managed application | Pass `--prod` | `run`, `session` |
|
|
4737
|
+
|
|
4738
|
+
An explicit `--url` must include the slug for a multi-agent server, such as
|
|
4739
|
+
`http://127.0.0.1:3000/pr-approver`. `--slug` never changes an explicit URL.
|
|
4740
|
+
`--url` and `--prod` are mutually exclusive.
|
|
4741
|
+
|
|
4742
|
+
| Option | Contract |
|
|
4734
4743
|
| --- | --- |
|
|
4735
|
-
| `--
|
|
4736
|
-
| `--
|
|
4737
|
-
| `--
|
|
4738
|
-
| `--
|
|
4739
|
-
| `--
|
|
4740
|
-
| `--
|
|
4741
|
-
| `--bearer-token
|
|
4742
|
-
| `--
|
|
4743
|
-
| `--
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4744
|
+
| `--dir <path>` | Select the project root. The default is the current directory. |
|
|
4745
|
+
| `--url <baseUrl>` | Use a running agent instead of local project discovery. |
|
|
4746
|
+
| `--prod` | Use a hosted deployment or managed application. Command support depends on the target type as listed above. |
|
|
4747
|
+
| `--slug <slug>` | Select an agent from a multi-agent project or a hosted resource. Under `--prod`, the default is the `--dir` basename. |
|
|
4748
|
+
| `--team <id>` | Select a Cursor team. The signed-in account's team is the default. |
|
|
4749
|
+
| `--api-key <key>` | Override the Cursor credential for commands that authenticate with Cursor. |
|
|
4750
|
+
| `--bearer-token <token>` | Authenticate to a running server with a bearer token. |
|
|
4751
|
+
| `--state-root <path>` | Select local state for `serve` and ephemeral `run`, `call`, `skill`, and `eval` targets. Running and `--prod` targets ignore it. |
|
|
4752
|
+
| `--json` | Request machine-readable output when the command supports it. `run` already defaults to JSON. |
|
|
4753
|
+
|
|
4754
|
+
## Local servers
|
|
4755
|
+
|
|
4756
|
+
### Serve agents {#serve}
|
|
4757
|
+
|
|
4758
|
+
`serve` mounts every project discovered under `--dir`:
|
|
4759
|
+
|
|
4760
|
+
```bash
|
|
4761
|
+
agent-sdk serve [--dir <path>] [--port <n>] [--host <host>]
|
|
4762
|
+
[--mode multi|single] [--dev] [--api-key <key>]
|
|
4763
|
+
[--state-root <path>]
|
|
4764
|
+
[--bearer-token <secret> | --allow-anonymous]
|
|
4765
|
+
[--allow-anonymous-cursor-github]
|
|
4766
|
+
[--allow-anonymous-cursor-account-mcp]
|
|
4767
|
+
[--public-url <url>] [--cloud-tools-url <url>]
|
|
4768
|
+
[--no-schedules] [--no-playground] [--no-docs]
|
|
4769
|
+
[--cursor-events --repo <owner/name>]...
|
|
4770
|
+
```
|
|
4771
|
+
|
|
4772
|
+
| Option | Contract |
|
|
4773
|
+
| --- | --- |
|
|
4774
|
+
| `--port <n>` | Listen on this port. The default is `3000`; `0` selects an available port. When an omitted default is occupied, the CLI selects the next port. An occupied explicit port fails with a next-port hint. |
|
|
4775
|
+
| `--host <host>` | Bind this host. The default is loopback-only `127.0.0.1`. |
|
|
4776
|
+
| `--mode multi` | Mount projects at `/<slug>/v1/*` and `/<slug>/playground`, with an index at `/`. This is the default. |
|
|
4777
|
+
| `--mode single` | Mount one project at `/v1/*` and `/playground`. |
|
|
4778
|
+
| `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and enable local playground access. |
|
|
4779
|
+
| `--state-root <path>` | Store local sessions, streams, workspaces, and channel state here. Keep durable state outside a repository whose rules shouldn't reach agent workspaces. |
|
|
4780
|
+
| `--bearer-token <secret>` | Require this token on routes without authored authentication. Mutually exclusive with `--allow-anonymous`. |
|
|
4781
|
+
| `--allow-anonymous` | Admit callers as one anonymous principal. Use it only behind a trusted network boundary. |
|
|
4782
|
+
| `--allow-anonymous-cursor-github` | Let anonymous callers use sessions with a Cursor account's repository-scoped GitHub credential. Requires an authenticating proxy. |
|
|
4783
|
+
| `--allow-anonymous-cursor-account-mcp` | Let anonymous callers use Cursor account MCP connections. Requires an authenticating proxy. |
|
|
4784
|
+
| `--public-url <url>` | Publish the externally reachable host URL for peer-agent callbacks. |
|
|
4785
|
+
| `--cloud-tools-url <url>` | Publish the authenticated server-tool MCP URL used by cloud turns. Managed hosting sets it automatically. |
|
|
4786
|
+
| `--no-schedules` | Disable schedule firing outside dev mode. |
|
|
4787
|
+
| `--no-playground` | Skip the playground. |
|
|
4749
4788
|
| `--no-docs` | Skip the documentation site at `/docs`. |
|
|
4750
|
-
| `--cursor-events` |
|
|
4789
|
+
| `--cursor-events` | Receive SCM events through Cursor. Requires sign-in and one or more repeatable `--repo owner/name` values. |
|
|
4751
4790
|
|
|
4752
|
-
Multi-agent slugs
|
|
4753
|
-
|
|
4754
|
-
and `docs`.
|
|
4791
|
+
Multi-agent slugs start with a letter or digit and contain only letters,
|
|
4792
|
+
digits, `_`, or `-`. The reserved slugs are `v1`, `playground`, and `docs`.
|
|
4755
4793
|
|
|
4756
|
-
|
|
4794
|
+
### Develop locally {#dev}
|
|
4757
4795
|
|
|
4758
|
-
`dev` is
|
|
4759
|
-
agent folder as a positional path, or run it from inside the project:
|
|
4796
|
+
`dev` is `serve --dev` with an optional positional project path:
|
|
4760
4797
|
|
|
4761
4798
|
```bash
|
|
4762
4799
|
agent-sdk dev
|
|
4763
|
-
agent-sdk dev ./sdk-pr-reviewer
|
|
4764
4800
|
agent-sdk dev ./sdk-pr-reviewer --port 3000
|
|
4765
4801
|
```
|
|
4766
4802
|
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
Dev mode is always on: schedules and reminders wait for manual dispatch,
|
|
4770
|
-
and GitHub accepts unsigned loopback deliveries. Prefer this over
|
|
4771
|
-
`serve --dev` while iterating. Pass at most one positional path. Don't
|
|
4772
|
-
combine a positional path with a different `--dir`.
|
|
4803
|
+
It accepts every `serve` option. Pass at most one positional path, and don't
|
|
4804
|
+
combine it with a different `--dir`.
|
|
4773
4805
|
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
`chat` talks to a running agent from the terminal. It never starts a
|
|
4777
|
-
server.
|
|
4806
|
+
### Serve the docs {#docs}
|
|
4778
4807
|
|
|
4779
4808
|
```bash
|
|
4780
|
-
|
|
4781
|
-
agent-sdk
|
|
4782
|
-
agent-sdk chat --message "Inspect PR 42" --json
|
|
4783
|
-
agent-sdk chat --prod --slug pr-approver --team 123
|
|
4809
|
+
npx @cursor/july docs
|
|
4810
|
+
agent-sdk docs [--port <n>] [--host 127.0.0.1] [--print]
|
|
4784
4811
|
```
|
|
4785
4812
|
|
|
4786
|
-
`
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
newline-delimited messages until EOF. `--json` requires `--message`,
|
|
4790
|
-
runs one turn, and prints
|
|
4791
|
-
`{ ok, sessionId, continuationToken, trajectory }`. `--text` prints a
|
|
4792
|
-
compact trajectory when combined with `--json`. `--no-color` forces
|
|
4793
|
-
plain interactive output.
|
|
4813
|
+
`docs` serves the bundled documentation without an agent project. It uses an
|
|
4814
|
+
available loopback port by default and stays open until Ctrl-C. `--print`
|
|
4815
|
+
prints the URL without opening a browser.
|
|
4794
4816
|
|
|
4795
|
-
|
|
4796
|
-
its continuation token when you omit `--continuation-token`. Use
|
|
4797
|
-
`--resume` to select the most recently updated session with a
|
|
4798
|
-
continuation token.
|
|
4817
|
+
## Sessions and turns
|
|
4799
4818
|
|
|
4800
|
-
|
|
4819
|
+
### Chat with an agent {#chat}
|
|
4801
4820
|
|
|
4802
|
-
`
|
|
4821
|
+
`chat` connects to a running server and never starts an ephemeral one:
|
|
4803
4822
|
|
|
4804
4823
|
```bash
|
|
4805
|
-
agent-sdk
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
agent-sdk resume ses_123 --message "Continue the review" --json
|
|
4824
|
+
agent-sdk chat [--url <baseUrl> | --prod] [--message <text>]
|
|
4825
|
+
[--session <id> | --resume] [--continuation-token <token>]
|
|
4826
|
+
[--slug <slug>] [--team <id>] [--json] [--text] [--no-color]
|
|
4809
4827
|
```
|
|
4810
4828
|
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4829
|
+
| Input mode | Behavior |
|
|
4830
|
+
| --- | --- |
|
|
4831
|
+
| TTY without `--message` | Open an interactive REPL. |
|
|
4832
|
+
| TTY with `--message` | Send the message, then keep the REPL open. |
|
|
4833
|
+
| Non-TTY with `--message` | Send one turn and exit. |
|
|
4834
|
+
| Non-TTY without `--message` | Read newline-delimited messages until EOF. |
|
|
4835
|
+
| `--json --message <text>` | Send one turn and print `{ ok, sessionId, continuationToken, trajectory }`. |
|
|
4836
|
+
| `--json --text --message <text>` | Print a compact trajectory instead of JSON. |
|
|
4837
|
+
|
|
4838
|
+
Use `--session <id>` to reattach a stored session. If you omit
|
|
4839
|
+
`--continuation-token`, the CLI looks it up from the target's session list.
|
|
4840
|
+
`--resume` selects the most recently updated session with a continuation
|
|
4841
|
+
token. An explicit session ID takes precedence.
|
|
4816
4842
|
|
|
4817
|
-
|
|
4843
|
+
### Resume a session {#resume}
|
|
4818
4844
|
|
|
4819
|
-
`
|
|
4845
|
+
`resume` provides the same reattachment contract as `chat --session`:
|
|
4820
4846
|
|
|
4821
4847
|
```bash
|
|
4822
|
-
agent-sdk
|
|
4823
|
-
|
|
4848
|
+
agent-sdk resume [sessionId] [--url <baseUrl> | --prod]
|
|
4849
|
+
[--message <text>] [--json] [--text]
|
|
4850
|
+
[--continuation-token <token>] [--slug <slug>] [--team <id>]
|
|
4824
4851
|
```
|
|
4825
4852
|
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
The command follows until Ctrl-C by default. `--once` prints the current
|
|
4830
|
-
buffer and exits. `--json` emits newline-delimited JSON events.
|
|
4853
|
+
Omit the session ID to select the most recently updated followable session.
|
|
4854
|
+
The command replays the transcript before accepting follow-ups.
|
|
4855
|
+
`resume --json` requires `--message`.
|
|
4831
4856
|
|
|
4832
|
-
|
|
4857
|
+
### Run turns {#run}
|
|
4833
4858
|
|
|
4834
|
-
`
|
|
4859
|
+
`run` sends messages to an ephemeral, running, or `--prod` target:
|
|
4835
4860
|
|
|
4836
4861
|
```bash
|
|
4837
|
-
agent-sdk
|
|
4838
|
-
|
|
4862
|
+
agent-sdk run [--dir <path>] [--message <text>]...
|
|
4863
|
+
[--messages-file <path>] [--url <baseUrl> | --prod]
|
|
4864
|
+
[--session <id>] [--continuation-token <token>]
|
|
4865
|
+
[--events <file> | --no-events] [--text]
|
|
4866
|
+
[--timeout-ms <n>] [--no-stream] [--slug <slug>] [--team <id>]
|
|
4867
|
+
[--dry-run] [--as-of <instant>] [--component <key>]
|
|
4839
4868
|
```
|
|
4840
4869
|
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
`
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4870
|
+
| Option | Contract |
|
|
4871
|
+
| --- | --- |
|
|
4872
|
+
| `--message <text>` | Send a user message. Repeat it for a multi-turn local or `--url` run. Managed starts accept one message. |
|
|
4873
|
+
| `--messages-file <path>` | Read a JSON array of strings. File messages run before repeated `--message` values. |
|
|
4874
|
+
| `--session <id>` | Continue a session. Managed session starts accept a hosted `ses_...` ID. |
|
|
4875
|
+
| `--continuation-token <token>` | Continue the session selected by `--session` on a running server. Managed session starts use `--session` instead. |
|
|
4876
|
+
| `--events <file>` | Write the raw NDJSON stream to this path. |
|
|
4877
|
+
| `--no-events` | Skip the NDJSON trace. |
|
|
4878
|
+
| `--text` | Print a compact trajectory instead of JSON. |
|
|
4879
|
+
| `--timeout-ms <n>` | Stop waiting after a positive number of milliseconds. There is no default timeout. |
|
|
4880
|
+
| `--no-stream` | Hide live tool and reply progress on stderr. |
|
|
4881
|
+
| `--dry-run` | Mark a managed session turn as non-mutating. |
|
|
4882
|
+
| `--as-of <instant>` | Freeze a managed session's clock at a timezone-bearing ISO-8601 instant. |
|
|
4883
|
+
| `--component <key>` | Select a managed application's component instead of its default. |
|
|
4884
|
+
|
|
4885
|
+
For local and running-server targets, JSON output contains `ok`, `sessionId`,
|
|
4886
|
+
`continuationToken`, `trace`, `playgroundUrl`, `playgroundHint`, `visualize`,
|
|
4887
|
+
and `trajectory`. The `trace` value gives the saved path when event output is
|
|
4888
|
+
enabled. A managed session start confirms acceptance; a continuation also
|
|
4889
|
+
returns `sessionId`. Managed starts return before the turn finishes and ignore
|
|
4890
|
+
`--events`, `--no-events`, `--text`, `--timeout-ms`, and `--no-stream`.
|
|
4891
|
+
A successful managed start exits `0` on acceptance, before its turn outcome is
|
|
4892
|
+
known. A fresh start doesn't return `sessionId` synchronously.
|
|
4893
|
+
|
|
4894
|
+
### Call a tool {#call}
|
|
4895
|
+
|
|
4896
|
+
`call` invokes a server tool without a model turn:
|
|
4848
4897
|
|
|
4849
4898
|
```bash
|
|
4850
|
-
agent-sdk
|
|
4851
|
-
|
|
4852
|
-
|
|
4899
|
+
agent-sdk call <tool> [--input <json>]
|
|
4900
|
+
[--dir <path> | --url <baseUrl> | --prod]
|
|
4901
|
+
[--session <id>] [--slug <slug>] [--team <id>]
|
|
4853
4902
|
```
|
|
4854
4903
|
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4904
|
+
`--input` accepts JSON and defaults to `{}`. `--session` uses the session
|
|
4905
|
+
workspace and records the call on its event stream. The command prints the
|
|
4906
|
+
server's JSON response and succeeds only when the HTTP response succeeds with
|
|
4907
|
+
`ok: true`.
|
|
4908
|
+
|
|
4909
|
+
See [Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn) for validation,
|
|
4910
|
+
busy-session behavior, and error codes.
|
|
4862
4911
|
|
|
4863
|
-
|
|
4912
|
+
### Read a skill {#skill}
|
|
4864
4913
|
|
|
4865
|
-
`
|
|
4914
|
+
`skill` reads an authored skill without a model turn:
|
|
4866
4915
|
|
|
4867
4916
|
```bash
|
|
4868
|
-
agent-sdk
|
|
4869
|
-
|
|
4917
|
+
agent-sdk skill <name> [--dir <path> | --url <baseUrl> | --prod]
|
|
4918
|
+
[--slug <slug>] [--team <id>] [--text]
|
|
4870
4919
|
```
|
|
4871
4920
|
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
the target plus a total. Costs are the engine's recorded estimates from
|
|
4875
|
-
`turn.completed` events; turns persisted before cost tracking count as
|
|
4876
|
-
unpriced. `--json` prints the underlying report, or `{ sessions }` when
|
|
4877
|
-
aggregating. Like `session`, the command supports `--dir`,
|
|
4878
|
-
`--bearer-token`, and the `--url`/`--prod` targets, and defaults to the
|
|
4879
|
-
local server.
|
|
4880
|
-
|
|
4881
|
-
## playground
|
|
4921
|
+
The default output is the server's JSON response. `--text` prints the rendered
|
|
4922
|
+
`SKILL.md` content.
|
|
4882
4923
|
|
|
4883
|
-
|
|
4924
|
+
### List sessions {#sessions}
|
|
4884
4925
|
|
|
4885
4926
|
```bash
|
|
4886
|
-
agent-sdk
|
|
4887
|
-
|
|
4888
|
-
[--bearer-token <token>] [--print]
|
|
4927
|
+
agent-sdk sessions [--url <baseUrl> | --prod]
|
|
4928
|
+
[--slug <slug>] [--team <id>] [--bearer-token <token>] [--json]
|
|
4889
4929
|
```
|
|
4890
4930
|
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
For an unauthenticated local URL, `playground` opens the browser and
|
|
4895
|
-
exits. `--prod` and `--bearer-token` start a loopback proxy to inject
|
|
4896
|
-
browser-inaccessible credentials. The proxy stays open until Ctrl-C,
|
|
4897
|
-
including when you pass `--print`.
|
|
4898
|
-
|
|
4899
|
-
## docs
|
|
4931
|
+
Text output shows the session ID, channel, mode, turn count, running status,
|
|
4932
|
+
and update time. `--json` prints `{ sessions }`, including continuation
|
|
4933
|
+
tokens.
|
|
4900
4934
|
|
|
4901
|
-
|
|
4902
|
-
it in a browser. You don't need an agent project.
|
|
4935
|
+
### Inspect a session {#session}
|
|
4903
4936
|
|
|
4904
4937
|
```bash
|
|
4905
|
-
|
|
4906
|
-
|
|
4938
|
+
agent-sdk session <sessionId> [--url <baseUrl> | --prod]
|
|
4939
|
+
[--slug <slug>] [--team <id>]
|
|
4940
|
+
[--json | --text | --events] [--out <file.ndjson>]
|
|
4941
|
+
|
|
4942
|
+
agent-sdk session --prod [<sessionId>] --slug <slug> --message <text>
|
|
4943
|
+
[--dry-run] [--as-of <instant>] [--component <key>]
|
|
4907
4944
|
```
|
|
4908
4945
|
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4946
|
+
| Option | Contract |
|
|
4947
|
+
| --- | --- |
|
|
4948
|
+
| No output option | Print a compact trajectory. |
|
|
4949
|
+
| `--text` | Select the compact trajectory explicitly. |
|
|
4950
|
+
| `--json` | Print the trajectory object. |
|
|
4951
|
+
| `--events` | Print `{ sessionId, events }` with the raw event list. |
|
|
4952
|
+
| `--out <file.ndjson>` | Write the raw NDJSON trace instead of printing it. |
|
|
4953
|
+
| `--prod --message <text>` | Start a managed session or continue the supplied managed session ID. |
|
|
4913
4954
|
|
|
4914
|
-
|
|
4955
|
+
`--events` and `--json` are mutually exclusive. Managed sessions without an
|
|
4956
|
+
event trajectory return hosted execution status and logs in text or JSON;
|
|
4957
|
+
`--events` and `--out` require an event trajectory. Use [`resume`](#resume) to
|
|
4958
|
+
continue a conversational session.
|
|
4915
4959
|
|
|
4916
|
-
|
|
4960
|
+
### Follow logs {#logs}
|
|
4917
4961
|
|
|
4918
4962
|
```bash
|
|
4919
|
-
agent-sdk
|
|
4920
|
-
|
|
4921
|
-
agent-sdk run --url http://127.0.0.1:3000/pr-approver --message "Inspect PR 42"
|
|
4922
|
-
agent-sdk run --prod --slug pr-approver --team 123 --message "Inspect PR 42"
|
|
4923
|
-
agent-sdk run --dir . --messages-file ./prompts.json
|
|
4963
|
+
agent-sdk logs [--url <baseUrl> | --prod]
|
|
4964
|
+
[--slug <slug>] [--team <id>] [--once] [--json]
|
|
4924
4965
|
```
|
|
4925
4966
|
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
after the turns finish.
|
|
4967
|
+
The command follows logs until Ctrl-C. `--once` prints the current buffer and
|
|
4968
|
+
exits; `--json` emits newline-delimited JSON events. A hosted deployment
|
|
4969
|
+
reports deployment progress before runtime logs become available.
|
|
4930
4970
|
|
|
4931
|
-
|
|
4932
|
-
| --- | --- |
|
|
4933
|
-
| `--message <text>` | Send a user message. Repeat the flag for a multi-turn run. |
|
|
4934
|
-
| `--messages-file <path>` | Read a JSON array of strings. File messages run before repeated `--message` values. |
|
|
4935
|
-
| `--session <id>` | Follow up an existing session. Unlike `chat`, `run` doesn't look up a missing continuation token. |
|
|
4936
|
-
| `--continuation-token <token>` | Continue the existing session selected by `--session`. |
|
|
4937
|
-
| `--events <file>` | Write the raw NDJSON event stream to this path. |
|
|
4938
|
-
| `--no-events` | Don't write an event stream. |
|
|
4939
|
-
| `--text` | Print a compact trajectory instead of the JSON result. |
|
|
4940
|
-
| `--timeout-ms <n>` | Abort the turn after a positive number of milliseconds. There is no default timeout. |
|
|
4941
|
-
| `--no-stream` | Hide live tool and reply progress on stderr. Progress is on by default when stderr is a TTY. |
|
|
4942
|
-
| `--slug <slug>` | Pick one agent when local discovery mounts several agents. With `--prod`, select the hosted deployment. |
|
|
4971
|
+
### Report costs {#cost}
|
|
4943
4972
|
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
non-zero when the trajectory fails.
|
|
4973
|
+
```bash
|
|
4974
|
+
agent-sdk cost [sessionId] [--url <baseUrl> | --prod]
|
|
4975
|
+
[--slug <slug>] [--team <id>] [--json]
|
|
4976
|
+
```
|
|
4949
4977
|
|
|
4950
|
-
|
|
4978
|
+
With a session ID, `cost` prints per-turn token usage and estimated cost.
|
|
4979
|
+
Without one, it prints one row per session and a total. Turns saved before
|
|
4980
|
+
cost tracking appear as unpriced. `--json` prints the underlying report or
|
|
4981
|
+
`{ sessions }` for an aggregate.
|
|
4951
4982
|
|
|
4952
|
-
|
|
4983
|
+
### Open the playground {#playground}
|
|
4953
4984
|
|
|
4954
4985
|
```bash
|
|
4955
|
-
agent-sdk
|
|
4956
|
-
--
|
|
4957
|
-
|
|
4958
|
-
--input '{"prUrl":"https://github.com/acme/checkout/pull/42"}'
|
|
4959
|
-
agent-sdk call refresh_cache --url http://127.0.0.1:3000/pr-approver \
|
|
4960
|
-
--session ses_123
|
|
4961
|
-
agent-sdk call inspect_pr --prod --slug pr-approver --team 123 --input '{}'
|
|
4962
|
-
```
|
|
4963
|
-
|
|
4964
|
-
`call` sends `POST /v1/tools/:toolName` and runs the tool in the serving
|
|
4965
|
-
process without a model turn. `--input` accepts any valid JSON and
|
|
4966
|
-
defaults to `{}`. Tools with a Zod input schema validate and transform
|
|
4967
|
-
the value before execution. A local call needs no inference credential.
|
|
4968
|
-
A hosted call still needs Cursor credentials to reach the deployment.
|
|
4969
|
-
|
|
4970
|
-
`--session` runs the tool inside an existing session and records it on
|
|
4971
|
-
the event stream. If a model turn is active or pending, a read-effect
|
|
4972
|
-
tool runs alongside it and a write-effect tool gets `session_busy`;
|
|
4973
|
-
retry after the turn finishes. The command
|
|
4974
|
-
prints the server's JSON response and exits non-zero unless the HTTP
|
|
4975
|
-
response succeeds with `ok: true`. See
|
|
4976
|
-
[Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn).
|
|
4977
|
-
|
|
4978
|
-
## eval
|
|
4979
|
-
|
|
4980
|
-
`eval` runs the project's filesystem evals.
|
|
4981
|
-
|
|
4982
|
-
```bash
|
|
4983
|
-
agent-sdk eval --dir . --list # discovered datapoints
|
|
4984
|
-
agent-sdk eval --dir . # run all
|
|
4985
|
-
agent-sdk eval --dir . builds/checkout # one datapoint
|
|
4986
|
-
agent-sdk eval --dir . builds # every datapoint in the file
|
|
4987
|
-
agent-sdk eval --dir . --tag smoke # by tag (repeatable)
|
|
4988
|
-
agent-sdk eval --dir . --json # machine-readable results
|
|
4989
|
-
agent-sdk eval --dir . --verbose # stream t.log lines + reply snippets
|
|
4990
|
-
agent-sdk eval --prod --slug pr-approver --team 123
|
|
4991
|
-
# prints Eval ID immediately on --prod/--url; then:
|
|
4992
|
-
agent-sdk eval status <evalId> --prod --slug pr-approver
|
|
4993
|
-
agent-sdk eval cancel <evalId> --prod --slug pr-approver
|
|
4994
|
-
```
|
|
4995
|
-
|
|
4996
|
-
`eval` runs `evals/**/*.eval.{ts,js}` on an ephemeral server. With
|
|
4997
|
-
`--prod` or `--url`, the target server runs its own evals as a
|
|
4998
|
-
server-side batch. Select one or more exact case IDs, file ID prefixes,
|
|
4999
|
-
or tags.
|
|
5000
|
-
Omit selectors to run all cases. Repeated `--tag` flags use OR matching.
|
|
5001
|
-
|
|
5002
|
-
An eval run requires `evals/evals.config.{ts,js}` with `maxConcurrency`
|
|
5003
|
-
between 1 and 200. Timeout priority is the case's `timeoutMs`, the CLI's
|
|
5004
|
-
`--timeout-ms`, the config's `timeoutMs`, then 180 seconds.
|
|
5005
|
-
|
|
5006
|
-
| Flag | Meaning |
|
|
5007
|
-
| --- | --- |
|
|
5008
|
-
| `--list` | Print discovered cases without running. `--list --json` prints them as an array. |
|
|
5009
|
-
| `--tag <tag>` | Run cases with this tag. Repeated flags use OR matching. |
|
|
5010
|
-
| `--json` | Print `{ ok, passed, failed, scored, skipped, strict, results }`; see [Run evals in CI](/docs/evals.md#run-evals-in-ci) for the result shape. |
|
|
5011
|
-
| `--verbose` | Stream `t.log` lines and reply snippets. |
|
|
5012
|
-
| `--no-stream` | Hide live progress on stderr. |
|
|
5013
|
-
| `--strict` | Exit `1` when a scored case misses a soft threshold. |
|
|
5014
|
-
| `--max-concurrency <n>` | Override `maxConcurrency` from `evals.config.ts`. |
|
|
5015
|
-
| `--junit <path>` | Write JUnit XML for CI annotations. |
|
|
5016
|
-
| `--artifacts <dir>` | Write run artifacts here. The default is a timestamped directory under `evals/` in the project state directory (not affected by `--state-root`). |
|
|
5017
|
-
| `--no-artifacts` | Skip run artifacts. |
|
|
5018
|
-
| `--skip-report` | Ignore reporters from `evals.config.ts` and eval files. |
|
|
5019
|
-
| `--out <path>` | Also write the full results JSON to this path (also for `eval status <evalId>`). |
|
|
5020
|
-
| `--no-wait` | Return with the Eval ID as soon as a `--prod` or `--url` batch is accepted. |
|
|
5021
|
-
| `--timeout-ms <n>` | Per-case timeout override. |
|
|
5022
|
-
|
|
5023
|
-
Failed cases exit `1`. A scored case also exits `1` under `--strict`.
|
|
5024
|
-
No matching cases exit `2`. `eval status` exits `3` while the remote batch
|
|
5025
|
-
is still running.
|
|
4986
|
+
agent-sdk playground [--url <baseUrl> | --prod] [--session <id>]
|
|
4987
|
+
[--slug <slug>] [--team <id>] [--bearer-token <token>] [--print]
|
|
4988
|
+
```
|
|
5026
4989
|
|
|
5027
|
-
|
|
4990
|
+
The command prints the playground URL and opens it unless `--print` is set.
|
|
4991
|
+
`--session` opens a deep link. A running target with credentials that a
|
|
4992
|
+
browser can't send starts a loopback proxy and stays open until Ctrl-C.
|
|
5028
4993
|
|
|
5029
|
-
|
|
4994
|
+
### Inspect a trajectory {#trajectory}
|
|
5030
4995
|
|
|
5031
4996
|
```bash
|
|
5032
|
-
agent-sdk trajectory --events
|
|
4997
|
+
agent-sdk trajectory --events <file.ndjson> [--text]
|
|
5033
4998
|
```
|
|
5034
4999
|
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
non-zero when the reconstructed trajectory failed.
|
|
5000
|
+
The command converts an NDJSON stream into the trajectory JSON returned by
|
|
5001
|
+
`run`. `--text` prints the compact view.
|
|
5038
5002
|
|
|
5039
|
-
##
|
|
5003
|
+
## Evals
|
|
5040
5004
|
|
|
5041
|
-
|
|
5005
|
+
### Run evals {#eval}
|
|
5006
|
+
|
|
5007
|
+
`eval` discovers `evals/**/*.eval.{ts,js}` and runs selected cases:
|
|
5042
5008
|
|
|
5043
5009
|
```bash
|
|
5044
|
-
agent-sdk
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
agent-sdk init ./thermo-quality --template thermo-quality-review # review PRs for code quality
|
|
5052
|
-
agent-sdk init ./security-help --template security-help # answer security questions in Slack
|
|
5053
|
-
agent-sdk init ./my-triage --template triage-linear # comment on Linear issues
|
|
5054
|
-
agent-sdk init ./my-triage --template triage-jira # comment on Jira issues
|
|
5055
|
-
agent-sdk init ./my-owners --template agentic-owners # review PRs via owners policies
|
|
5056
|
-
agent-sdk init ./pr-autofixer --template pr-autofixer # fix PRs on a cloud VM
|
|
5057
|
-
agent-sdk init ./pr-autofixer --template pr-autofixer \
|
|
5058
|
-
--var repos=acme/widgets,acme/api --json
|
|
5059
|
-
agent-sdk init ./my-agent --json # machine-readable summary for tooling
|
|
5060
|
-
agent-sdk init # no directory: print the setup guide
|
|
5010
|
+
agent-sdk eval [--dir <path>] [evalId...]
|
|
5011
|
+
[--list] [--tag <tag>]... [--json] [--verbose]
|
|
5012
|
+
[--timeout-ms <n>] [--strict] [--max-concurrency <n>]
|
|
5013
|
+
[--junit <path>] [--artifacts <dir> | --no-artifacts]
|
|
5014
|
+
[--skip-report] [--out <file.json>] [--no-stream]
|
|
5015
|
+
[--url <baseUrl> | --prod] [--no-wait]
|
|
5016
|
+
[--slug <slug>] [--team <id>]
|
|
5061
5017
|
```
|
|
5062
5018
|
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5019
|
+
Select an exact case such as `weather/nyc`, a file prefix such as `weather`,
|
|
5020
|
+
several IDs, or no IDs for every case. Repeat `--tag` for OR matching.
|
|
5021
|
+
Projects must provide `evals/evals.config.{ts,js}` with `maxConcurrency`
|
|
5022
|
+
between 1 and 200.
|
|
5066
5023
|
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
`
|
|
5070
|
-
|
|
5071
|
-
`--
|
|
5072
|
-
`--
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5024
|
+
| Option | Contract |
|
|
5025
|
+
| --- | --- |
|
|
5026
|
+
| `--list` | List matching cases without running them. `--list --json` prints an array. |
|
|
5027
|
+
| `--tag <tag>` | Select a tag. Repeat the option for OR matching. |
|
|
5028
|
+
| `--json` | Print `{ ok, passed, failed, scored, skipped, strict, results }`. |
|
|
5029
|
+
| `--verbose` | Stream `t.log` lines and reply snippets. |
|
|
5030
|
+
| `--no-stream` | Hide live progress on stderr. |
|
|
5031
|
+
| `--strict` | Treat a scored case below its soft threshold as a failure. |
|
|
5032
|
+
| `--max-concurrency <n>` | Override `maxConcurrency` from the eval config for an ephemeral local run. |
|
|
5033
|
+
| `--timeout-ms <n>` | Override the per-case timeout. A case timeout takes precedence, followed by this option, the config timeout, and the 180-second default. |
|
|
5034
|
+
| `--junit <path>` | Write JUnit XML for an ephemeral local run. |
|
|
5035
|
+
| `--artifacts <dir>` | Select the artifact directory for an ephemeral local run. The default is a timestamped directory under the project's state directory. |
|
|
5036
|
+
| `--no-artifacts` | Skip artifacts for an ephemeral local run. |
|
|
5037
|
+
| `--skip-report` | Ignore reporters from eval files and the eval config during an ephemeral local run. |
|
|
5038
|
+
| `--out <file.json>` | Also write the full result JSON. |
|
|
5039
|
+
| `--no-wait` | Return after a running server or hosted deployment accepts the batch. |
|
|
5040
|
+
|
|
5041
|
+
A running server or hosted deployment prints its Eval ID when it accepts the
|
|
5042
|
+
batch.
|
|
5043
|
+
Use these commands to inspect or cancel it:
|
|
5079
5044
|
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5045
|
+
```bash
|
|
5046
|
+
agent-sdk eval status [evalId] --prod [--slug <slug>] [--team <id>]
|
|
5047
|
+
agent-sdk eval status [evalId] --url <baseUrl>
|
|
5048
|
+
agent-sdk eval cancel <evalId> --prod [--slug <slug>] [--team <id>]
|
|
5049
|
+
agent-sdk eval cancel <evalId> --url <baseUrl>
|
|
5050
|
+
```
|
|
5083
5051
|
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
`next` list includes `login` when the host is unsigned.
|
|
5052
|
+
`eval status` without an ID lists recent remote runs. `eval status --out`
|
|
5053
|
+
requires an ID. The `status` and `cancel` subcommands require `--url` or
|
|
5054
|
+
`--prod`.
|
|
5088
5055
|
|
|
5089
|
-
##
|
|
5056
|
+
## Projects
|
|
5090
5057
|
|
|
5091
|
-
|
|
5058
|
+
### Scaffold a project {#init}
|
|
5092
5059
|
|
|
5093
5060
|
```bash
|
|
5094
|
-
agent-sdk
|
|
5061
|
+
agent-sdk init [directory] [--template <name>] [--var id=value]... [--json]
|
|
5095
5062
|
```
|
|
5096
5063
|
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5064
|
+
Without a directory, `init` prints the setup guide and changes no files. With
|
|
5065
|
+
a directory, it preserves existing scaffold files, adds missing files,
|
|
5066
|
+
installs dependencies, and tries to put `agent-sdk` on `PATH`.
|
|
5067
|
+
|
|
5068
|
+
| Option | Contract |
|
|
5069
|
+
| --- | --- |
|
|
5070
|
+
| `--template <name>` | Use a bundled template: `agentic-owners`, `agents-md`, `code-wiki`, `demo`, `grokbot-agents`, `pr-autofixer`, `security-help`, `security-reviewer`, `thermo-quality-review`, `thermo-review`, `triage-jira`, or `triage-linear`. |
|
|
5071
|
+
| `--var id=value` | Answer a template question without a prompt. Repeat for multiple answers. |
|
|
5072
|
+
| `--json` | Skip interactive login and skill prompts, then print `{ ok, directory, template, created, skipped, installed, installError, cliOnPath, cliLinkError, next }`. `ok` reflects dependency installation. |
|
|
5073
|
+
|
|
5074
|
+
On a TTY, templates with questions run their interview before writing files.
|
|
5075
|
+
`init` also offers to refresh the bundled coding-agent skills and starts login
|
|
5076
|
+
when the host has no Cursor credential.
|
|
5104
5077
|
|
|
5105
|
-
|
|
5106
|
-
The project contains their names, not server URLs or credentials.
|
|
5107
|
-
Local runs use the signed-in account. Hosted deployments use a separate
|
|
5108
|
-
service account; authorize each generated connection with
|
|
5109
|
-
[`mcp oauth`](#mcp-oauth) after the first deploy. Review the generated
|
|
5110
|
-
project, then run `validate` and `dev`.
|
|
5078
|
+
### Convert an Automation {#convert-automation}
|
|
5111
5079
|
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5080
|
+
```bash
|
|
5081
|
+
agent-sdk convert-automation <url-or-uuid> [--dir <path>] [--json]
|
|
5082
|
+
```
|
|
5083
|
+
|
|
5084
|
+
The input can be a Cursor Automation dashboard URL or its UUID. The output
|
|
5085
|
+
directory defaults to `./<automation-name>`. Generated files don't overwrite
|
|
5086
|
+
existing paths, and missing scaffold files are added. The following
|
|
5087
|
+
`npm install` can update lockfiles and run lifecycle scripts from an existing
|
|
5088
|
+
`package.json`.
|
|
5115
5089
|
|
|
5116
5090
|
`--json` prints
|
|
5117
5091
|
`{ ok, directory, files, warnings, setupSteps, installed, installError, mcpConnections }`.
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
The [Convert a Cursor Automation](/docs/guides/convert-automation.md) guide
|
|
5122
|
-
covers generated files and behavior the converter cannot reproduce.
|
|
5092
|
+
Conversion warnings and dependency-install failures remain visible in this
|
|
5093
|
+
output without failing a completed file conversion. Invalid input,
|
|
5094
|
+
authentication, export, and file-write failures exit nonzero.
|
|
5123
5095
|
|
|
5124
|
-
|
|
5096
|
+
See [Convert a Cursor Automation](/docs/guides/convert-automation.md) for the
|
|
5097
|
+
generated project and features that need manual review.
|
|
5125
5098
|
|
|
5126
|
-
|
|
5127
|
-
`~/.cursor/skills/agentsdk/` with `alwaysApply: true` so Cursor loads
|
|
5128
|
-
them as global rules. Installing `@cursor/july` already does this in
|
|
5129
|
-
postinstall (`npm install`, `npx`, a version bump). Use this command
|
|
5130
|
-
to refresh without reinstalling the package, or from a monorepo
|
|
5131
|
-
source checkout (postinstall skips that tree).
|
|
5099
|
+
### Install coding-agent skills {#install-skills}
|
|
5132
5100
|
|
|
5133
5101
|
```bash
|
|
5134
5102
|
agent-sdk install-skills [--print] [--json]
|
|
5135
5103
|
```
|
|
5136
5104
|
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
previews the skills, the removals, and the install path without writing
|
|
5141
|
-
anything. `--json` prints
|
|
5105
|
+
The command replaces the installed Agent SDK skills under
|
|
5106
|
+
`~/.cursor/skills/agentsdk/` with the package copy and removes stale bundled
|
|
5107
|
+
skills. `--print` previews the change. `--json` prints
|
|
5142
5108
|
`{ ok, dryRun, directory, firstInstall, skills, removed }`.
|
|
5143
5109
|
|
|
5144
|
-
|
|
5145
|
-
`
|
|
5110
|
+
Package installation already performs this copy. Set
|
|
5111
|
+
`CURSOR_JULY_SKIP_SKILL_INSTALL=1` to skip that install hook, or set
|
|
5112
|
+
`CURSOR_JULY_SKILLS_HOME` to choose another skills directory.
|
|
5146
5113
|
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
`info` prints the discovered agent surface.
|
|
5114
|
+
### Inspect a project {#info}
|
|
5150
5115
|
|
|
5151
5116
|
```bash
|
|
5152
|
-
agent-sdk info --dir
|
|
5117
|
+
agent-sdk info [--dir <path>] [--json]
|
|
5153
5118
|
```
|
|
5154
5119
|
|
|
5155
|
-
|
|
5156
|
-
connections, subagents,
|
|
5157
|
-
diagnostics.
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5120
|
+
Text output lists the model, instructions, tools, skills, extensions,
|
|
5121
|
+
connections, subagents, channels, schedules, hooks, hosting settings, and
|
|
5122
|
+
diagnostics. For one unslugged project, `--json` prints its project info
|
|
5123
|
+
object. For slugged or multi-agent discovery, it prints `{ agents }`.
|
|
5124
|
+
|
|
5125
|
+
### Validate a project {#validate}
|
|
5126
|
+
|
|
5127
|
+
```bash
|
|
5128
|
+
agent-sdk validate [--dir <path>]
|
|
5129
|
+
```
|
|
5161
5130
|
|
|
5162
|
-
|
|
5131
|
+
`validate` prints every discovered project's diagnostics and exits nonzero
|
|
5132
|
+
when any diagnostic has error severity. Use it instead of `info --json` when a
|
|
5133
|
+
script needs validation status.
|
|
5163
5134
|
|
|
5164
|
-
|
|
5135
|
+
### Print a deployment manifest {#manifest}
|
|
5165
5136
|
|
|
5166
5137
|
```bash
|
|
5167
|
-
agent-sdk
|
|
5138
|
+
agent-sdk manifest [--dir <path>] [--json]
|
|
5168
5139
|
```
|
|
5169
5140
|
|
|
5170
|
-
`
|
|
5171
|
-
|
|
5172
|
-
|
|
5141
|
+
`manifest` validates one project and prints its deployment metadata without a
|
|
5142
|
+
network request. Default output is indented JSON; `--json` prints one compact
|
|
5143
|
+
line.
|
|
5173
5144
|
|
|
5174
|
-
##
|
|
5145
|
+
## Credentials and versions
|
|
5175
5146
|
|
|
5176
|
-
|
|
5147
|
+
### Manage credentials {#login-logout-whoami}
|
|
5177
5148
|
|
|
5178
5149
|
```bash
|
|
5179
5150
|
agent-sdk login [--api-key <key>] [--key-name <name>]
|
|
@@ -5181,421 +5152,397 @@ agent-sdk whoami [--json]
|
|
|
5181
5152
|
agent-sdk logout
|
|
5182
5153
|
```
|
|
5183
5154
|
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
key you already created.
|
|
5155
|
+
| Command | Contract |
|
|
5156
|
+
| --- | --- |
|
|
5157
|
+
| `login` | Use a supplied API key, or open browser sign-in and store the resulting dashboard-revocable key in the CLI config directory. `--key-name` labels a browser-created key. |
|
|
5158
|
+
| `whoami` | Show the active credential and its source. `--json` returns the same identity as JSON. |
|
|
5159
|
+
| `logout` | Remove the stored credential file. It doesn't revoke the API key; revoke the key in the Cursor dashboard. |
|
|
5190
5160
|
|
|
5191
|
-
|
|
5192
|
-
wins, then `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default
|
|
5193
|
-
`/run/cursor/secrets/CURSOR_API_KEY` when unset), then
|
|
5194
|
-
`CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login. A host that has
|
|
5195
|
-
both the service-account key and a bind file authenticates as the file
|
|
5196
|
-
principal. `logout` removes the local credential file but doesn't
|
|
5197
|
-
revoke the API key. Revoke it in the Cursor dashboard when it should
|
|
5198
|
-
stop working.
|
|
5161
|
+
### Print the version {#version}
|
|
5199
5162
|
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5163
|
+
```bash
|
|
5164
|
+
agent-sdk version [--json]
|
|
5165
|
+
agent-sdk --version
|
|
5166
|
+
agent-sdk -V
|
|
5167
|
+
```
|
|
5203
5168
|
|
|
5204
|
-
|
|
5169
|
+
Text output is the version number. `--json` prints
|
|
5170
|
+
`{ name, version }`.
|
|
5205
5171
|
|
|
5206
|
-
|
|
5172
|
+
### Update the CLI {#update}
|
|
5207
5173
|
|
|
5208
5174
|
```bash
|
|
5209
5175
|
agent-sdk update
|
|
5210
5176
|
```
|
|
5211
5177
|
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
running the package-manager command.
|
|
5178
|
+
`update` checks npm's `latest` tag and upgrades a recognized global or project
|
|
5179
|
+
install with its package manager. If it can't identify an installed copy, it
|
|
5180
|
+
prints a manual upgrade command instead.
|
|
5216
5181
|
|
|
5217
|
-
|
|
5218
|
-
|
|
5182
|
+
Published installs check for updates at most once every 24 hours. Set
|
|
5183
|
+
`AGENT_SERVE_NO_UPDATE_CHECK`, `NO_UPDATE_NOTIFIER`, or `CI` to disable the
|
|
5184
|
+
automatic warning.
|
|
5219
5185
|
|
|
5220
|
-
|
|
5221
|
-
hours and print an update warning on stderr. Source checkouts, CI, and
|
|
5222
|
-
commands with an explicit `--json` flag skip this automatic check.
|
|
5186
|
+
## Managed hosting
|
|
5223
5187
|
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
`deploy` sends one or more agents to Cursor managed hosting.
|
|
5188
|
+
### Deploy agents {#deploy}
|
|
5227
5189
|
|
|
5228
5190
|
```bash
|
|
5229
5191
|
agent-sdk deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
the
|
|
5245
|
-
|
|
5246
|
-
`--
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
returns after the deployment request is accepted. Multi-agent deploys
|
|
5263
|
-
run sequentially. When several agents are selected, `--path` is ignored
|
|
5264
|
-
and each project infers its own path. A single-target `--json` run
|
|
5265
|
-
prints one object; a multi-target run prints an array.
|
|
5266
|
-
|
|
5267
|
-
The first deployment can return an alias token. It appears once in text
|
|
5268
|
-
or JSON output and can't be retrieved later. Store it as a secret. Send
|
|
5269
|
-
it as `X-Agent-Alias-Token` when calling the stable alias URL, or use it
|
|
5270
|
-
to sign in to the hosted playground.
|
|
5271
|
-
|
|
5272
|
-
See [Deployment](/docs/deployment.md) for the hosting security model and
|
|
5273
|
-
state layout.
|
|
5274
|
-
|
|
5275
|
-
## deployments
|
|
5276
|
-
|
|
5277
|
-
`deployments` lists the selected team's deployments.
|
|
5192
|
+
[--repo <https-url>] [--ref <git-ref>] [--path <agent-path>]
|
|
5193
|
+
[--cursor-events-repo <owner/name>]...
|
|
5194
|
+
[--allow-domain <domain>]... [--no-wait] [--json]
|
|
5195
|
+
```
|
|
5196
|
+
|
|
5197
|
+
Managed hosting requires a team with agent hosting enabled. A team
|
|
5198
|
+
service-account API key with agent access can deploy.
|
|
5199
|
+
|
|
5200
|
+
| Option | Contract |
|
|
5201
|
+
| --- | --- |
|
|
5202
|
+
| `--slug <slug>` | Select one project and set its deployment slug. |
|
|
5203
|
+
| `--all` | Deploy every child project under a multi-agent `--dir`. Mutually exclusive with `--slug`. |
|
|
5204
|
+
| `--team <id>` | Select the Cursor team. |
|
|
5205
|
+
| `--repo <https-url>` | Set the source repository. The CLI infers it from the current checkout when possible. HTTPS is required. |
|
|
5206
|
+
| `--ref <git-ref>` | Set the source Git ref. The CLI infers the current branch when possible. |
|
|
5207
|
+
| `--path <agent-path>` | Set the project path relative to the repository root. |
|
|
5208
|
+
| `--cursor-events-repo <owner/name>` | Add a repository whose SCM events reach the deployment. Repeat for multiple repositories. |
|
|
5209
|
+
| `--allow-domain <domain>` | Add an egress hostname. Repeat for multiple domains; values are combined with `hosting.egressDomains`. |
|
|
5210
|
+
| `--no-wait` | Return after the deployment request is accepted. |
|
|
5211
|
+
| `--json` | Print one object for one target or an array for multiple targets. |
|
|
5212
|
+
|
|
5213
|
+
Deployment slugs contain lowercase letters, digits, `_`, or `-`, start with a
|
|
5214
|
+
letter or digit, and have at most 64 characters. Egress entries are lowercase
|
|
5215
|
+
hostnames with an alphabetic top-level domain; one leading `*.` wildcard is
|
|
5216
|
+
allowed, with at most 20 entries.
|
|
5217
|
+
|
|
5218
|
+
By default, `deploy` waits until the deployment is running and exits nonzero
|
|
5219
|
+
if it reaches a failed state. A first deployment can return an alias token
|
|
5220
|
+
once. Store it as a secret and send it as `X-Agent-Alias-Token` when calling
|
|
5221
|
+
the stable alias URL.
|
|
5222
|
+
|
|
5223
|
+
### List deployments {#deployments}
|
|
5278
5224
|
|
|
5279
5225
|
```bash
|
|
5280
5226
|
agent-sdk deployments [--team <id>] [--json]
|
|
5281
5227
|
```
|
|
5282
5228
|
|
|
5283
|
-
Text output shows
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
## deployment
|
|
5229
|
+
Text output shows slug, status, generation, kind, and update time. `--json`
|
|
5230
|
+
prints `{ deployments }` and may also include `applications`. An empty list
|
|
5231
|
+
succeeds.
|
|
5287
5232
|
|
|
5288
|
-
|
|
5233
|
+
### Inspect a deployment {#deployment}
|
|
5289
5234
|
|
|
5290
5235
|
```bash
|
|
5291
5236
|
agent-sdk deployment <slug> [--team <id>] [--json]
|
|
5292
5237
|
```
|
|
5293
5238
|
|
|
5294
|
-
Text output includes status,
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
`engineAccess.headers`, so handle JSON output as a credential.
|
|
5239
|
+
Text output includes status, source, routes, secret names, egress domains, and
|
|
5240
|
+
the latest error. `--json` can include short-lived access headers, so handle
|
|
5241
|
+
its output as a credential.
|
|
5298
5242
|
|
|
5299
|
-
|
|
5243
|
+
### Stop a deployment {#stop}
|
|
5300
5244
|
|
|
5301
|
-
|
|
5245
|
+
```bash
|
|
5246
|
+
agent-sdk stop <slug> [--team <id>] [--no-wait] [--cancel-runs] [--json]
|
|
5247
|
+
```
|
|
5248
|
+
|
|
5249
|
+
The command waits for `stopped` by default. `--no-wait` returns after the
|
|
5250
|
+
request is accepted. `--cancel-runs` also requests cancellation of active
|
|
5251
|
+
runs and reminder wakes for a managed application. Other deployment types
|
|
5252
|
+
reject this option.
|
|
5253
|
+
|
|
5254
|
+
### Cancel active runs {#cancel-runs}
|
|
5302
5255
|
|
|
5303
5256
|
```bash
|
|
5304
|
-
agent-sdk
|
|
5257
|
+
agent-sdk cancel-runs <slug> [--team <id>] [--json]
|
|
5305
5258
|
```
|
|
5306
5259
|
|
|
5307
|
-
The command
|
|
5308
|
-
|
|
5260
|
+
The command requests cancellation for a managed application's active runs and
|
|
5261
|
+
reminder wakes. Other deployment types reject it. For a multi-tenant
|
|
5262
|
+
application, this cancels every install; use `stop --cancel-runs` for
|
|
5263
|
+
install-local cancellation. It exits nonzero if any cancellation request fails
|
|
5264
|
+
to start.
|
|
5309
5265
|
|
|
5310
|
-
|
|
5266
|
+
### Replace event repositories {#event-repos}
|
|
5311
5267
|
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5268
|
+
```bash
|
|
5269
|
+
agent-sdk event-repos <slug> [--repo <owner/name>]...
|
|
5270
|
+
[--team <id>] [--json]
|
|
5271
|
+
```
|
|
5272
|
+
|
|
5273
|
+
The supplied repositories replace the managed application's complete event
|
|
5274
|
+
repository list; they aren't merged with the previous list. Omit `--repo` to
|
|
5275
|
+
clear the list.
|
|
5276
|
+
|
|
5277
|
+
### Upgrade a managed application {#upgrade}
|
|
5315
5278
|
|
|
5316
5279
|
```bash
|
|
5317
|
-
agent-sdk
|
|
5280
|
+
agent-sdk upgrade <slug> [--release <id-or-version>]
|
|
5281
|
+
[--team <id>] [--json]
|
|
5318
5282
|
```
|
|
5319
5283
|
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5284
|
+
`--release` accepts a release ID or version. Omit it to select the newest
|
|
5285
|
+
ready release. `--json` prints `{ releaseId }`.
|
|
5286
|
+
|
|
5287
|
+
### Delete a deployment {#delete}
|
|
5323
5288
|
|
|
5324
|
-
|
|
5289
|
+
```bash
|
|
5290
|
+
agent-sdk delete <slug> [--team <id>] [--no-wait] [--json]
|
|
5291
|
+
```
|
|
5325
5292
|
|
|
5326
|
-
`
|
|
5327
|
-
|
|
5293
|
+
`delete` removes the deployment and frees its slug. It waits until the
|
|
5294
|
+
deployment is gone unless `--no-wait` is set.
|
|
5295
|
+
|
|
5296
|
+
### Rotate an alias token {#rotate-token}
|
|
5328
5297
|
|
|
5329
5298
|
```bash
|
|
5330
5299
|
agent-sdk rotate-token <slug> [--team <id>] [--json]
|
|
5331
5300
|
```
|
|
5332
5301
|
|
|
5333
|
-
The old token stops working immediately. The replacement
|
|
5302
|
+
The old token stops working immediately. The replacement appears once;
|
|
5334
5303
|
`--json` prints `{ aliasToken }`.
|
|
5335
5304
|
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
`mcp` proxies an agent's MCP endpoint over stdio for MCP clients that
|
|
5339
|
-
spawn local servers, such as Cursor.
|
|
5305
|
+
### Manage deployment secrets {#secrets}
|
|
5340
5306
|
|
|
5341
5307
|
```bash
|
|
5342
|
-
agent-sdk
|
|
5343
|
-
|
|
5344
|
-
agent-sdk
|
|
5345
|
-
|
|
5308
|
+
agent-sdk secrets set <slug> NAME [NAME2 ...]
|
|
5309
|
+
[--team <id>] [--from-argv] [--json]
|
|
5310
|
+
agent-sdk secrets list <slug> [--team <id>] [--json]
|
|
5311
|
+
agent-sdk secrets unset <slug> NAME [--team <id>] [--json]
|
|
5346
5312
|
```
|
|
5347
5313
|
|
|
5348
|
-
|
|
5349
|
-
one
|
|
5350
|
-
`--
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5314
|
+
Pass secret names to `set`. On a TTY, the CLI prompts for hidden values; with
|
|
5315
|
+
piped input, provide one line per name. It rejects `NAME=VALUE` arguments
|
|
5316
|
+
unless `--from-argv` is set because command-line values can enter shell
|
|
5317
|
+
history and captured terminals.
|
|
5318
|
+
|
|
5319
|
+
Names use `UPPER_SNAKE_CASE`, start with a letter, and contain at most 64
|
|
5320
|
+
characters. Names beginning with `CURSOR_` are reserved. Values contain at
|
|
5321
|
+
most 4096 bytes, and each deployment holds at most 32 secrets.
|
|
5354
5322
|
|
|
5355
|
-
`
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
`--print` prints the entry instead of writing the file, and `--json`
|
|
5359
|
-
prints a machine-readable result. `--remote` (with `--prod`) writes a
|
|
5360
|
-
remote HTTP entry pointing at the stable Cursor MCP gateway instead of
|
|
5361
|
-
the local stdio proxy, for MCP hosts that can't spawn stdio servers.
|
|
5362
|
-
The remote entry carries your API key in plain text, so treat the file
|
|
5363
|
-
as a credential.
|
|
5323
|
+
`list` returns names and creation times, never values. JSON output is
|
|
5324
|
+
`{ secretNames }` for `set`, `{ secrets }` for `list`, and `{ removed }` for
|
|
5325
|
+
`unset`. Changes are available to subsequent hosted work.
|
|
5364
5326
|
|
|
5365
|
-
##
|
|
5327
|
+
## MCP connections
|
|
5328
|
+
|
|
5329
|
+
### Connect an MCP client {#mcp}
|
|
5330
|
+
|
|
5331
|
+
```bash
|
|
5332
|
+
agent-sdk mcp --prod [--slug <slug>] [--team <id>]
|
|
5333
|
+
agent-sdk mcp --url <baseUrl> [--bearer-token <token>]
|
|
5366
5334
|
|
|
5367
|
-
|
|
5368
|
-
|
|
5335
|
+
agent-sdk mcp install --prod [--slug <slug>] [--team <id>]
|
|
5336
|
+
[--name <server-name>] [--print] [--json] [--remote]
|
|
5337
|
+
agent-sdk mcp install --url <baseUrl> [--bearer-token <token>]
|
|
5338
|
+
[--name <server-name>] [--print] [--json]
|
|
5339
|
+
```
|
|
5369
5340
|
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
`
|
|
5373
|
-
`
|
|
5374
|
-
|
|
5375
|
-
current process retry.
|
|
5341
|
+
| Command | Contract |
|
|
5342
|
+
| --- | --- |
|
|
5343
|
+
| `mcp` | Read newline-delimited JSON-RPC from stdin and proxy it to the selected agent's MCP endpoint. stdout is reserved for MCP messages. A target is required. |
|
|
5344
|
+
| `mcp install` | Add the selected agent to `~/.cursor/mcp.json`. `--name` sets the server name, `--print` previews the entry, and `--json` prints a machine-readable result. A `--url` entry with `--bearer-token` contains that token; handle printed and written copies as credentials. |
|
|
5345
|
+
| `mcp install --remote --prod` | Write a remote HTTP entry for clients that can't spawn a stdio process. The entry contains the API key in plain text and must be handled as a credential. |
|
|
5376
5346
|
|
|
5377
|
-
|
|
5378
|
-
account through the Cursor backend's connector consent flow. Those
|
|
5379
|
-
tokens live on the Cursor backend, so `--store` isn't needed; the
|
|
5380
|
-
command prints a note when you pass it anyway.
|
|
5347
|
+
### Authorize MCP OAuth {#mcp-oauth}
|
|
5381
5348
|
|
|
5382
5349
|
```bash
|
|
5383
|
-
agent-sdk mcp oauth <connection> [--dir
|
|
5350
|
+
agent-sdk mcp oauth <connection> [--dir <path>] [--store]
|
|
5351
|
+
[--slug <slug>] [--team <id>]
|
|
5384
5352
|
```
|
|
5385
5353
|
|
|
5386
5354
|
`<connection>` is the basename under `agent/mcp-connections/` or
|
|
5387
5355
|
`agent/host-connections/`.
|
|
5388
|
-
`--slug` defaults to the `--dir` basename. `--team` defaults to the
|
|
5389
|
-
signed-in account's team. You need `agent-sdk login` (or `--api-key`)
|
|
5390
|
-
before `--store`.
|
|
5391
5356
|
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5357
|
+
| Connection | Result |
|
|
5358
|
+
| --- | --- |
|
|
5359
|
+
| `defineConnection({ url, oauth: true })` | Open a browser PKCE flow and save tokens in `mcp-auth.json` under the CLI config directory. `--store` also sets the matching deployment secrets. |
|
|
5360
|
+
| `defineConnection({ cursorAccount: true })` | Authorize the managed deployment's service account through Cursor. `--store` isn't needed. |
|
|
5396
5361
|
|
|
5397
|
-
|
|
5398
|
-
|
|
5362
|
+
Stored secret names are `MCP_OAUTH_<NAME>_ACCESS_TOKEN`,
|
|
5363
|
+
`MCP_OAUTH_<NAME>_REFRESH_TOKEN`, and `MCP_OAUTH_<NAME>_CLIENT_ID`. Declare
|
|
5364
|
+
them in `hosting.secretNames`. URL-connection tokens are bound to the resource
|
|
5365
|
+
URL; authorize again after changing it.
|
|
5399
5366
|
|
|
5400
|
-
See
|
|
5367
|
+
See [Host MCP OAuth](/docs/guides/mcp-oauth.md) for the full setup flow.
|
|
5401
5368
|
|
|
5402
|
-
##
|
|
5369
|
+
## Channel helpers
|
|
5403
5370
|
|
|
5404
|
-
|
|
5371
|
+
### Configure Slack {#slack}
|
|
5405
5372
|
|
|
5406
5373
|
```bash
|
|
5407
|
-
agent-sdk
|
|
5408
|
-
agent-sdk
|
|
5409
|
-
|
|
5374
|
+
agent-sdk slack setup
|
|
5375
|
+
agent-sdk slack create [--dir <path>] [--name <name>] [--prod]
|
|
5376
|
+
[--slack-team <id>] [--team <id>] [--icon <url-or-file>]
|
|
5377
|
+
[--prefix <prefix> | --no-prefix] [--channel-posts] [--json]
|
|
5378
|
+
agent-sdk slack destroy [--dir <path>] [--prod]
|
|
5379
|
+
[--slack-team <id>] [--team <id>] [--json]
|
|
5380
|
+
agent-sdk slack icon <url-or-file> [--dir <path>] [--prod]
|
|
5381
|
+
[--slack-team <id>] [--team <id>] [--json]
|
|
5382
|
+
agent-sdk slack init --manual [--dir <path>] [--name <name>]
|
|
5383
|
+
[--prefix <prefix> | --no-prefix] [--channel-posts]
|
|
5384
|
+
[--install | --no-install] [--slack-team <id>] [--prod]
|
|
5385
|
+
agent-sdk slack manifest [--dir <path>] [--name <name>]
|
|
5386
|
+
[--env dev|prod|both] [--channel-posts] [--print]
|
|
5387
|
+
agent-sdk slack doctor [--dir <path>]
|
|
5388
|
+
[--prefix <prefix> | --no-prefix] [--channel <id>]... [--json]
|
|
5410
5389
|
```
|
|
5411
5390
|
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5391
|
+
| Subcommand | Contract |
|
|
5392
|
+
| --- | --- |
|
|
5393
|
+
| `setup` | Print the setup choices without changing files. |
|
|
5394
|
+
| `create` | Open the signed-in Cursor dashboard wizard, write the resulting token pair to `.env.local`, and run `doctor`. The development app is the default; `--prod` selects production. A second create overwrites the live app manifest. |
|
|
5395
|
+
| `destroy` | Delete the provisioned app. Existing local token entries remain but stop working. |
|
|
5396
|
+
| `icon` | Set an HTTPS or local PNG, JPG, or GIF icon of at most 512 KB. |
|
|
5397
|
+
| `init --manual` | Write the channel, manifests, Slack CLI project, and setup files for a manually managed app. |
|
|
5398
|
+
| `manifest` | Generate Slack manifests. `--env` defaults to `both`; with `--print`, select one environment when you need one JSON document. |
|
|
5399
|
+
| `doctor` | Check both tokens, Socket Mode connectivity, Slack authentication, and any repeatable `--channel` values. |
|
|
5400
|
+
|
|
5401
|
+
The default token prefix is the project directory name normalized to upper
|
|
5402
|
+
snake case. `--no-prefix` uses `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`.
|
|
5403
|
+
Channel-post subscriptions are off by default; `--channel-posts` adds message
|
|
5404
|
+
events for public and private channels as required by
|
|
5405
|
+
`engagement.channelPosts`.
|
|
5406
|
+
Multi-agent servers need one token pair per agent.
|
|
5415
5407
|
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
a human is not at the prompt:
|
|
5408
|
+
See [Slack](/docs/guides/slack.md) for app consent and manual setup.
|
|
5409
|
+
|
|
5410
|
+
### Test GitHub webhooks {#github}
|
|
5420
5411
|
|
|
5421
5412
|
```bash
|
|
5422
|
-
agent-sdk
|
|
5413
|
+
agent-sdk github forward [--dir <path>] [--slug <slug>] [--channel <id>]
|
|
5414
|
+
[--repo owner/repo | --org <org>] [--events a,b,c]
|
|
5415
|
+
[--url <url>] [--host <host>] [--port <n>]
|
|
5416
|
+
[--secret <secret>] [--install]
|
|
5417
|
+
agent-sdk github replay <pr-url-or-owner/repo#N>
|
|
5418
|
+
[--events a,b,c | '*'] [--action <action>] [--conclusion <result>]
|
|
5419
|
+
[--comment <body>] [--context <name>] [--dir <path>]
|
|
5420
|
+
[--slug <slug>] [--channel <id>] [--url <url>]
|
|
5421
|
+
[--secret <secret>] [--dry-run] [--out <dir>] [--json]
|
|
5422
|
+
agent-sdk github events [--dir <path>] [--host <host>] [--port <n>] [--json]
|
|
5423
|
+
agent-sdk github doctor [--install] [--json]
|
|
5423
5424
|
```
|
|
5424
5425
|
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5426
|
+
| Subcommand | Contract |
|
|
5427
|
+
| --- | --- |
|
|
5428
|
+
| `forward` | Forward live deliveries with `gh webhook forward`. The CLI derives URLs and events from discovered channels and can fan out to several matches. |
|
|
5429
|
+
| `replay` | Read a pull request, synthesize selected webhook payloads, and post them to matching channels. The default event is `pull_request`; `'*'` selects the channel's supported declared events. |
|
|
5430
|
+
| `events` | List discovered channel URLs and event sets. No channels is a successful empty result. |
|
|
5431
|
+
| `doctor` | Check the GitHub CLI, its login, and the pinned webhook extension. `--install` installs or repairs the extension. |
|
|
5428
5432
|
|
|
5429
|
-
`
|
|
5430
|
-
|
|
5431
|
-
|
|
5433
|
+
Replay supports `pull_request`, `issue_comment`,
|
|
5434
|
+
`pull_request_review_comment`, `check_run`, `check_suite`, `workflow_run`, and
|
|
5435
|
+
`status`. `--dry-run` prints without posting. `--out` writes fixtures and
|
|
5436
|
+
still posts unless combined with `--dry-run`.
|
|
5432
5437
|
|
|
5433
|
-
|
|
5434
|
-
|
|
5438
|
+
Forwarding requires repository admin access, or organization owner access for
|
|
5439
|
+
`--org`. It uses the GitHub CLI's stored login; unset `GITHUB_TOKEN` and
|
|
5440
|
+
`GH_TOKEN` before forwarding. Replay needs only pull-request read access.
|
|
5435
5441
|
|
|
5436
|
-
|
|
5442
|
+
See [GitHub](/docs/guides/github.md) for channel setup and live delivery.
|
|
5437
5443
|
|
|
5438
|
-
|
|
5439
|
-
setup.
|
|
5444
|
+
### Test GitLab webhooks {#gitlab}
|
|
5440
5445
|
|
|
5441
5446
|
```bash
|
|
5442
|
-
agent-sdk
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
agent-sdk
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
`
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
(`agent-sdk login` or `CURSOR_API_KEY`). A team service-account key
|
|
5467
|
-
cannot create Slack apps. `--prod` provisions the production app; the
|
|
5468
|
-
default is the development app. `--name` / `--icon`
|
|
5469
|
-
/ `--channel-posts` prefill the wizard. A second create for the same
|
|
5470
|
-
slug and env overwrites the live Slack app. If Slack needs a workspace
|
|
5471
|
-
admin's approval, the wizard waits; keep the CLI running, open Slack's
|
|
5472
|
-
**Request approval** page (the CLI prints the link), and click **Retry**
|
|
5473
|
-
after the admin approves. Token values never print.
|
|
5474
|
-
|
|
5475
|
-
`slack destroy` deletes the provisioned app for the selected
|
|
5476
|
-
environment. Tokens already written to `.env.local` stay in place and
|
|
5477
|
-
stop working.
|
|
5478
|
-
|
|
5479
|
-
`slack icon` sets the provisioned app's icon from an https image URL or
|
|
5480
|
-
a local png, jpg, or gif file of at most 512KB.
|
|
5481
|
-
|
|
5482
|
-
`slack init` without `--manual` exits non-zero and writes no files. Use
|
|
5483
|
-
`slack create` for the dashboard wizard. `slack init --manual` writes
|
|
5484
|
-
the channel file, development and production manifests, a Slack CLI
|
|
5485
|
-
`.slack/` project (hook + manifests, committed with the repo). When
|
|
5486
|
-
Slack CLI is logged in, it installs the app. Otherwise `next` asks
|
|
5487
|
-
you to install it. `--install` requires that install. `--no-install`
|
|
5488
|
-
skips it. `--prod` selects the deployed app.
|
|
5489
|
-
`--slack-team` picks the workspace. Slack CLI keeps install tokens in
|
|
5490
|
-
that process; copy `xoxb` and mint `xapp` (`connections:write`) into
|
|
5491
|
-
`.env.local`. Tokens that appear in `.env` during that install are
|
|
5492
|
-
copied onto the prefixed names. Paste `.slack/manifest.dev.json` at
|
|
5493
|
-
api.slack.com when the Slack CLI is missing. Do not run
|
|
5494
|
-
`slack deploy`. The command refuses to overwrite the channel file.
|
|
5495
|
-
It updates the Slack CLI hook and manifests when `.slack/` already
|
|
5496
|
-
exists. If a collision occurs, it exits non-zero; files created
|
|
5497
|
-
earlier in the run remain. The token prefix defaults to the directory
|
|
5498
|
-
basename normalized to uppercase snake case.
|
|
5499
|
-
Explicit `--prefix` values use the same normalization. For example,
|
|
5500
|
-
`pr-approver` becomes `PR_APPROVER_SLACK_BOT_TOKEN`. `--no-prefix`
|
|
5501
|
-
uses shared `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`.
|
|
5502
|
-
`--channel-posts` subscribes the manifests to channel-post events.
|
|
5503
|
-
The command always prints a JSON summary.
|
|
5504
|
-
|
|
5505
|
-
`slack manifest` regenerates selected manifest files. `--env` defaults
|
|
5506
|
-
to `both`, and `--name` defaults to the directory name. `--print` writes
|
|
5507
|
-
the manifest JSON to stdout instead of changing files. With the default
|
|
5508
|
-
`--env both`, it prints development JSON, a `--- prod ---` separator,
|
|
5509
|
-
then production JSON.
|
|
5510
|
-
|
|
5511
|
-
`slack doctor` checks both tokens, Socket Mode connectivity, and
|
|
5512
|
-
Slack's `auth.test`. It exits non-zero when any check fails.
|
|
5513
|
-
|
|
5514
|
-
See the [Slack guide](/docs/guides/slack.md).
|
|
5515
|
-
|
|
5516
|
-
## github
|
|
5517
|
-
|
|
5518
|
-
The `github` pack discovers `githubChannel()` definitions and sends live
|
|
5519
|
-
or synthesized deliveries to them.
|
|
5447
|
+
agent-sdk gitlab replay <mr-url-or-group/project!N>
|
|
5448
|
+
[--events a,b,c | '*'] [--action <action>]
|
|
5449
|
+
[--conclusion <status>] [--comment <body>]
|
|
5450
|
+
[--dir <path>] [--slug <slug>] [--channel <id>]
|
|
5451
|
+
[--url <url>] [--host <host>] [--port <n>]
|
|
5452
|
+
[--secret <secret>] [--dry-run] [--out <dir>] [--json]
|
|
5453
|
+
agent-sdk gitlab events [--dir <path>] [--host <host>] [--port <n>] [--json]
|
|
5454
|
+
agent-sdk gitlab forward [--dir <path>] [--host <host>] [--port <n>]
|
|
5455
|
+
```
|
|
5456
|
+
|
|
5457
|
+
| Subcommand | Contract |
|
|
5458
|
+
| --- | --- |
|
|
5459
|
+
| `replay` | Read a merge request, synthesize selected webhook payloads, and post them to matching channels. The default event is `merge_request`; `'*'` selects the channel's declared events. |
|
|
5460
|
+
| `events` | List discovered GitLab channel URLs and object kinds. |
|
|
5461
|
+
| `forward` | Print the public-hook and tunnel recipe for live deliveries. |
|
|
5462
|
+
|
|
5463
|
+
Replay supports `merge_request`, `note`, `pipeline`, and `push`. It requires
|
|
5464
|
+
`GITLAB_TOKEN` with project read access. `--secret` defaults to
|
|
5465
|
+
`GITLAB_WEBHOOK_SECRET`; `--dry-run` and `--out` follow the GitHub replay
|
|
5466
|
+
contract.
|
|
5467
|
+
|
|
5468
|
+
See [GitLab](/docs/guides/gitlab.md) for channel setup and self-managed hosts.
|
|
5469
|
+
|
|
5470
|
+
### Test Bitbucket webhooks {#bitbucket}
|
|
5520
5471
|
|
|
5521
5472
|
```bash
|
|
5522
|
-
agent-sdk
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
agent-sdk
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
`
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
`
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
matched channel can supply the event set.
|
|
5545
|
-
|
|
5546
|
-
Repository forwarding needs repo-admin access. Organization forwarding
|
|
5547
|
-
needs org-owner access. The relay authenticates with the GitHub CLI's
|
|
5548
|
-
stored login. A `GITHUB_TOKEN` or `GH_TOKEN` environment override can
|
|
5549
|
-
make delivery requests return `401`, even when hook creation succeeds.
|
|
5550
|
-
Unset those variables before forwarding.
|
|
5551
|
-
|
|
5552
|
-
Pass `--secret` or set `GITHUB_WEBHOOK_SECRET` to sign deliveries.
|
|
5553
|
-
`serve --dev` accepts unsigned loopback deliveries. A non-dev target
|
|
5554
|
-
requires the same secret on both sides.
|
|
5555
|
-
|
|
5556
|
-
`github replay` needs read access, not admin access. It reads the pull
|
|
5557
|
-
request through `gh api`, builds GitHub webhook payloads, and posts them
|
|
5558
|
-
to the selected channels. Supported events are `pull_request`,
|
|
5559
|
-
`issue_comment`, `pull_request_review_comment`, `check_run`,
|
|
5560
|
-
`check_suite`, `workflow_run`, and `status`. The default is
|
|
5561
|
-
`pull_request` with action `synchronize`. Comment events need
|
|
5562
|
-
`--comment`.
|
|
5563
|
-
|
|
5564
|
-
Use `--events '*'` to replay every supported event declared by the
|
|
5565
|
-
channel. `--dry-run` prints payloads without posting them. `--out`
|
|
5566
|
-
writes fixture files but still posts unless you also pass `--dry-run`.
|
|
5567
|
-
|
|
5568
|
-
`github doctor` checks `gh`, its login, and the pinned
|
|
5569
|
-
`cli/gh-webhook` extension. `--install` installs or repairs the
|
|
5570
|
-
extension. An environment-token override is a warning and doesn't make
|
|
5571
|
-
`github doctor` fail.
|
|
5572
|
-
|
|
5573
|
-
See the [GitHub guide](/docs/guides/github.md).
|
|
5473
|
+
agent-sdk bitbucket replay <pr-url-or-workspace/repo#N>
|
|
5474
|
+
[--events a,b,c | '*'] [--comment <body>]
|
|
5475
|
+
[--dir <path>] [--slug <slug>] [--channel <id>]
|
|
5476
|
+
[--url <url>] [--host <host>] [--port <n>]
|
|
5477
|
+
[--secret <secret>] [--dry-run] [--out <dir>] [--json]
|
|
5478
|
+
agent-sdk bitbucket events [--dir <path>] [--host <host>] [--port <n>] [--json]
|
|
5479
|
+
agent-sdk bitbucket forward [--dir <path>] [--host <host>] [--port <n>]
|
|
5480
|
+
```
|
|
5481
|
+
|
|
5482
|
+
| Subcommand | Contract |
|
|
5483
|
+
| --- | --- |
|
|
5484
|
+
| `replay` | Read a pull request, synthesize webhook payloads in the host's Cloud or Data Center format, and post them to matching channels. |
|
|
5485
|
+
| `events` | List discovered Bitbucket channel URLs and event keys. |
|
|
5486
|
+
| `forward` | Print the repository-hook and tunnel recipe for live deliveries. |
|
|
5487
|
+
|
|
5488
|
+
Replay supports `pullrequest:created`, `pullrequest:updated`,
|
|
5489
|
+
`pullrequest:comment_created`, and `repo:push`, along with their supported Data
|
|
5490
|
+
Center forms. It requires `BITBUCKET_TOKEN` with pull-request read access.
|
|
5491
|
+
`--secret` defaults to `BITBUCKET_WEBHOOK_SECRET`; `--dry-run` and `--out`
|
|
5492
|
+
follow the GitHub replay contract.
|
|
5493
|
+
|
|
5494
|
+
See [Bitbucket](/docs/guides/bitbucket.md) for Cloud and Data Center setup.
|
|
5574
5495
|
|
|
5575
5496
|
## Environment variables
|
|
5576
5497
|
|
|
5577
|
-
|
|
5498
|
+
Credential resolution follows this order: `--api-key`, `CURSOR_API_KEY`,
|
|
5499
|
+
`CURSOR_API_KEY_FILE`, `CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login.
|
|
5578
5500
|
|
|
5579
|
-
| Variable |
|
|
5501
|
+
| Variable | Contract |
|
|
5502
|
+
| --- | --- |
|
|
5503
|
+
| `CURSOR_API_KEY` | Cursor credential. |
|
|
5504
|
+
| `CURSOR_API_KEY_FILE` | Path to a Cursor credential file. |
|
|
5505
|
+
| `CURSOR_SERVICE_ACCOUNT_KEY` | Team service-account credential used after the API key and key-file sources. |
|
|
5506
|
+
| `CURSOR_API_BASE_URL` | Backend for login, account, deployment, and event commands. |
|
|
5507
|
+
| `CURSOR_BACKEND_URL` | Backend for Agent SDK turns. Set it with `CURSOR_API_BASE_URL` when using a non-default backend. |
|
|
5508
|
+
| `AGENT_SERVE_CONFIG_DIR` | Override the CLI config directory for stored credentials and update state. |
|
|
5509
|
+
| `AGENT_SERVE_NO_UPDATE_CHECK`, `NO_UPDATE_NOTIFIER`, `CI` | Disable published-version checks when set to a non-empty value other than `0`. |
|
|
5510
|
+
| `CURSOR_JULY_SKIP_SKILL_INSTALL` | Skip the package install hook that refreshes coding-agent skills. |
|
|
5511
|
+
| `CURSOR_JULY_SKILLS_HOME` | Override the coding-agent skills directory. |
|
|
5512
|
+
| `GITHUB_WEBHOOK_SECRET` | Default signature secret for GitHub forwarding and replay. |
|
|
5513
|
+
| `GITHUB_APP_ID`, `GITHUB_APP_PRIVATE_KEY`, `GITHUB_APP_INSTALLATION_ID` | GitHub App credentials for outbound API calls. |
|
|
5514
|
+
| `GITHUB_TOKEN`, `GH_TOKEN` | Token credentials for outbound GitHub calls. Unset both for `github forward`. |
|
|
5515
|
+
| `GITLAB_TOKEN` | Token for GitLab API reads and direct channel calls. |
|
|
5516
|
+
| `GITLAB_API_BASE_URL` | Override the GitLab REST base URL for self-managed hosts. |
|
|
5517
|
+
| `GITLAB_WEBHOOK_SECRET` | Default GitLab webhook token for replay and channel verification. |
|
|
5518
|
+
| `BITBUCKET_TOKEN` | Token for Bitbucket API reads and direct channel calls. |
|
|
5519
|
+
| `BITBUCKET_API_BASE_URL` | Override the Bitbucket Data Center REST base URL. |
|
|
5520
|
+
| `BITBUCKET_WEBHOOK_SECRET` | Default Bitbucket signing secret for replay and channel verification. |
|
|
5521
|
+
| `SLACK_BOT_TOKEN`, `SLACK_APP_TOKEN` | Slack tokens for one agent. Multi-agent servers use `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN`. |
|
|
5522
|
+
|
|
5523
|
+
## Exit status
|
|
5524
|
+
|
|
5525
|
+
| Command | Nonzero contract |
|
|
5580
5526
|
| --- | --- |
|
|
5581
|
-
|
|
|
5582
|
-
| `
|
|
5583
|
-
| `
|
|
5584
|
-
| `
|
|
5585
|
-
| `
|
|
5586
|
-
| `
|
|
5587
|
-
| `
|
|
5588
|
-
| `
|
|
5589
|
-
| `
|
|
5590
|
-
| `
|
|
5591
|
-
|
|
|
5592
|
-
| `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN` | Slack tokens for one agent. Use `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN` for each agent on a multi-agent host. |
|
|
5527
|
+
| No command | Print help and exit `1`. Explicit `help`, `--help`, and `-h` exit `0`. |
|
|
5528
|
+
| `run` | For local and running-server trajectories, exit `1` when the trajectory fails. |
|
|
5529
|
+
| `call` | Exit `1` unless the response succeeds with `ok: true`. |
|
|
5530
|
+
| `skill` | Exit `2` when the name is missing and `1` when the request fails. |
|
|
5531
|
+
| `trajectory` | Exit `1` when the reconstructed trajectory failed. |
|
|
5532
|
+
| `eval` | Exit `1` for failed cases, or scored cases below threshold with `--strict`; exit `2` for invalid eval options or an execution with no matching cases. An empty `--list` succeeds. |
|
|
5533
|
+
| `eval status` | Exit `3` while the batch runs, `1` when it failed or was cancelled, and `2` for invalid usage. |
|
|
5534
|
+
| `chat`, `session` | Exit `2` for documented option conflicts or missing required input. |
|
|
5535
|
+
| `validate` | Exit `1` when any project diagnostic has error severity. |
|
|
5536
|
+
| `convert-automation` | Exit `1` for invalid input, authentication, export, or file-write failure. Warnings and dependency-install failure don't change a successful conversion exit. |
|
|
5537
|
+
| Other commands | Exit nonzero when validation, authentication, a request, or the requested operation fails. |
|
|
5593
5538
|
|
|
5594
|
-
##
|
|
5539
|
+
## Related
|
|
5595
5540
|
|
|
5596
|
-
- [Project layout](/docs/reference/project-layout.md)
|
|
5597
|
-
- [
|
|
5598
|
-
- [
|
|
5541
|
+
- [Project layout](/docs/reference/project-layout.md)
|
|
5542
|
+
- [Sessions, events, and streaming](/docs/reference/sessions.md)
|
|
5543
|
+
- [Evals](/docs/reference/evals.md)
|
|
5544
|
+
- [HTTP API](/docs/reference/http-api.md)
|
|
5545
|
+
- [Deployment](/docs/deployment.md)
|
|
5599
5546
|
|
|
5600
5547
|
---
|
|
5601
5548
|
|