@cursor/july 0.1.114 → 0.2.0

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.
Files changed (160) hide show
  1. package/dist/channels/slack/inbound.d.ts +7 -0
  2. package/dist/channels/slack/inbound.d.ts.map +1 -1
  3. package/dist/channels/slack/inbound.js +23 -0
  4. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  5. package/dist/channels/slack/slack-channel.js +83 -4
  6. package/dist/docs/404.html +2 -2
  7. package/dist/docs/assets/{app.BqkJwOZ-.js → app.9eAtsjAM.js} +4 -4
  8. package/dist/docs/assets/chunks/@localSearchIndexroot.DjNBgxTF.js +1 -0
  9. package/dist/docs/assets/chunks/{VPLocalSearchBox.BJAi2KiV.js → VPLocalSearchBox.C9s69nxj.js} +1 -1
  10. package/dist/docs/assets/chunks/{arc.BZpXTgvV.js → arc.DmWDRaF-.js} +1 -1
  11. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.WYI-7F-Y.js → architectureDiagram-Q4EWVU46.BE1Wj4f3.js} +1 -1
  12. package/dist/docs/assets/chunks/{baseUniq.CZaUPpg0.js → baseUniq.pmEZGnWu.js} +1 -1
  13. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.D6UES2pD.js → blockDiagram-DXYQGD6D.D6mM-5XN.js} +1 -1
  14. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.cwebIe4i.js → c4Diagram-AHTNJAMY.ZQYTPC1b.js} +1 -1
  15. package/dist/docs/assets/chunks/channel.BNF8VK-B.js +1 -0
  16. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.fVyFnjxg.js → chunk-4BX2VUAB.CKJ7gaK8.js} +1 -1
  17. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BanufG1c.js → chunk-4TB4RGXK.CL61HnvB.js} +1 -1
  18. package/dist/docs/assets/chunks/{chunk-55IACEB6.VaSMz5-2.js → chunk-55IACEB6.DsA4XA1m.js} +1 -1
  19. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.CN2diZOM.js → chunk-EDXVE4YY.BODHCHFW.js} +1 -1
  20. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.g4ivypu3.js → chunk-FMBD7UC4.D6NBaZTa.js} +1 -1
  21. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.GZXKn9JJ.js → chunk-OYMX7WX6.BLPuqFXg.js} +1 -1
  22. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.itXxJZCd.js → chunk-QZHKN3VN.BFs_ML8Z.js} +1 -1
  23. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.-rw2GfvX.js → chunk-YZCP3GAM.BDjuFyZv.js} +1 -1
  24. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.iViHzfrK.js +1 -0
  25. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.iViHzfrK.js +1 -0
  26. package/dist/docs/assets/chunks/clone.CJoR2BBM.js +1 -0
  27. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.CmaI5br0.js → cose-bilkent-S5V4N54A.D85HNEsi.js} +1 -1
  28. package/dist/docs/assets/chunks/{dagre-KV5264BT.4wY9S4Kt.js → dagre-KV5264BT.V463KlSF.js} +1 -1
  29. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.Pc3c0u9W.js → diagram-5BDNPKRD.DhBDu1ab.js} +1 -1
  30. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CYrWz-nj.js → diagram-G4DWMVQ6.v6sC68zl.js} +1 -1
  31. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.Bgj5hukb.js → diagram-MMDJMWI5.DhHsdXYv.js} +1 -1
  32. package/dist/docs/assets/chunks/{diagram-TYMM5635.DGMEXalS.js → diagram-TYMM5635.BPWNSFZc.js} +1 -1
  33. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.GepTV9Im.js → erDiagram-SMLLAGMA.Cq0wTMPL.js} +1 -1
  34. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.DVKywg3j.js → flowDiagram-DWJPFMVM.MveMtucC.js} +1 -1
  35. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.C7qt9Mlo.js → ganttDiagram-T4ZO3ILL.BzKfGUSf.js} +1 -1
  36. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.U30_r82P.js → gitGraphDiagram-UUTBAWPF.OToXTSW_.js} +1 -1
  37. package/dist/docs/assets/chunks/{graph.CyyMyAWv.js → graph.D82tam-l.js} +1 -1
  38. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.Dn9ACW3y.js → infoDiagram-42DDH7IO.DzFlRmcE.js} +1 -1
  39. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DlIdIGOA.js → ishikawaDiagram-UXIWVN3A.CVPRJiKe.js} +1 -1
  40. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.DZj4vy4E.js → journeyDiagram-VCZTEJTY.CQvNTfQC.js} +1 -1
  41. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.Dl63eMUV.js → kanban-definition-6JOO6SKY.BwywywUl.js} +1 -1
  42. package/dist/docs/assets/chunks/{layout.BLHZLWPH.js → layout.C4BkPPba.js} +1 -1
  43. package/dist/docs/assets/chunks/{linear.aXKGKaNw.js → linear.FoSfGKD4.js} +1 -1
  44. package/dist/docs/assets/chunks/{min.zWnFcpcc.js → min.yLh8jqfl.js} +1 -1
  45. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.Qs4MQBea.js → mindmap-definition-QFDTVHPH.C9Dq2_CN.js} +1 -1
  46. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.BmPHgsk7.js → pieDiagram-DEJITSTG.CiGyBcES.js} +1 -1
  47. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.D5MQ3gwA.js → quadrantDiagram-34T5L4WZ.1FWea9nj.js} +1 -1
  48. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CkdUFrO7.js → requirementDiagram-MS252O5E.B1q7ntiV.js} +1 -1
  49. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.KZrljrAV.js → sankeyDiagram-XADWPNL6.Cpr4oU_k.js} +1 -1
  50. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.XMoEW-Lx.js → sequenceDiagram-FGHM5R23.CUK68STn.js} +1 -1
  51. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BmTzePLj.js → stateDiagram-FHFEXIEX.zU0yL2m4.js} +1 -1
  52. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.nV8Nl-td.js +1 -0
  53. package/dist/docs/assets/chunks/{theme.BfQzpxsg.js → theme.DhnKd0CD.js} +2 -2
  54. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Dug0oamp.js → timeline-definition-GMOUNBTQ.CNYoXo3F.js} +1 -1
  55. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BOTHrEFu.js → vennDiagram-DHZGUBPP.DFWH3G9s.js} +1 -1
  56. package/dist/docs/assets/chunks/{wardley-RL74JXVD.DXy2i1LS.js → wardley-RL74JXVD.Do4PwzeN.js} +1 -1
  57. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CoXKdfi6.js → wardleyDiagram-NUSXRM2D.7WLkqM7s.js} +1 -1
  58. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.DXoSCjAW.js → xychartDiagram-5P7HB3ND.-SyUNgWw.js} +1 -1
  59. package/dist/docs/assets/{guides_slack.md.Bo96y42E.js → guides_slack.md.DVjNyqq5.js} +3 -3
  60. package/dist/docs/assets/{guides_slack.md.Bo96y42E.lean.js → guides_slack.md.DVjNyqq5.lean.js} +1 -1
  61. package/dist/docs/assets/reference_cli.md.BvnQM8wd.js +97 -0
  62. package/dist/docs/assets/reference_cli.md.BvnQM8wd.lean.js +1 -0
  63. package/dist/docs/building-with-agents.html +35 -35
  64. package/dist/docs/deployment.html +35 -35
  65. package/dist/docs/evals.html +35 -35
  66. package/dist/docs/guides/agent-to-agent.html +35 -35
  67. package/dist/docs/guides/bitbucket.html +35 -35
  68. package/dist/docs/guides/cloud-agents.html +35 -35
  69. package/dist/docs/guides/convert-automation.html +35 -35
  70. package/dist/docs/guides/github.html +35 -35
  71. package/dist/docs/guides/gitlab.html +35 -35
  72. package/dist/docs/guides/grokbot-agents.html +35 -35
  73. package/dist/docs/guides/hooks.html +35 -35
  74. package/dist/docs/guides/improve.html +35 -35
  75. package/dist/docs/guides/jev.html +35 -35
  76. package/dist/docs/guides/mcp-oauth.html +35 -35
  77. package/dist/docs/guides/opentelemetry.html +35 -35
  78. package/dist/docs/guides/slack.html +37 -37
  79. package/dist/docs/guides/slack.md +7 -0
  80. package/dist/docs/guides/webhooks.html +35 -35
  81. package/dist/docs/hashmap.json +1 -1
  82. package/dist/docs/hillclimbing.html +35 -35
  83. package/dist/docs/index.html +35 -35
  84. package/dist/docs/llms-full.txt +690 -751
  85. package/dist/docs/llms.txt +1 -1
  86. package/dist/docs/quickstart.html +35 -35
  87. package/dist/docs/reference/agent-config.html +35 -35
  88. package/dist/docs/reference/artifacts.html +35 -35
  89. package/dist/docs/reference/channels.html +35 -35
  90. package/dist/docs/reference/cli.html +127 -125
  91. package/dist/docs/reference/cli.md +685 -753
  92. package/dist/docs/reference/connections.html +35 -35
  93. package/dist/docs/reference/evals.html +35 -35
  94. package/dist/docs/reference/extensions.html +35 -35
  95. package/dist/docs/reference/hooks.html +35 -35
  96. package/dist/docs/reference/http-api.html +35 -35
  97. package/dist/docs/reference/instructions.html +35 -35
  98. package/dist/docs/reference/playground.html +35 -35
  99. package/dist/docs/reference/project-layout.html +35 -35
  100. package/dist/docs/reference/prompt.html +35 -35
  101. package/dist/docs/reference/schedules.html +35 -35
  102. package/dist/docs/reference/sessions.html +35 -35
  103. package/dist/docs/reference/skills.html +35 -35
  104. package/dist/docs/reference/subagents.html +35 -35
  105. package/dist/docs/reference/tools.html +35 -35
  106. package/dist/docs/templates/agentic-owners.html +35 -35
  107. package/dist/docs/templates/pr-autofixer.html +35 -35
  108. package/dist/docs/templates/security-reviewer.html +35 -35
  109. package/dist/docs/templates/thermo-quality-review.html +35 -35
  110. package/dist/docs/templates/thermo-review.html +35 -35
  111. package/dist/docs/templates/triage.html +35 -35
  112. package/dist/docs/troubleshooting.html +35 -35
  113. package/dist/internal/cli-deploy.d.ts.map +1 -1
  114. package/dist/internal/cli-deploy.js +9 -1
  115. package/dist/internal/deploy-client.d.ts +6 -0
  116. package/dist/internal/deploy-client.d.ts.map +1 -1
  117. package/dist/internal/deploy-client.js +3 -0
  118. package/dist/internal/discovery/agent-config.d.ts +3 -1
  119. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  120. package/dist/internal/discovery/agent-config.js +7 -4
  121. package/dist/internal/framework-storage-selection.d.ts +1 -1
  122. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  123. package/dist/internal/platform-timers.d.ts.map +1 -1
  124. package/dist/internal/platform-timers.js +20 -2
  125. package/dist/internal/reminder-runner.d.ts +79 -1
  126. package/dist/internal/reminder-runner.d.ts.map +1 -1
  127. package/dist/internal/reminder-runner.js +276 -44
  128. package/dist/internal/server.d.ts.map +1 -1
  129. package/dist/internal/server.js +7 -0
  130. package/dist/memory.d.ts +4 -0
  131. package/dist/memory.d.ts.map +1 -1
  132. package/dist/memory.js +28 -4
  133. package/dist/playground/assets/index-DLwnR9ys.css +1 -0
  134. package/dist/playground/index.html +2 -2
  135. package/dist/types.d.ts +16 -9
  136. package/dist/types.d.ts.map +1 -1
  137. package/docs/guides/slack.md +7 -0
  138. package/docs/reference/cli.md +686 -754
  139. package/package.json +1 -1
  140. package/src/channels/slack/inbound.ts +24 -0
  141. package/src/channels/slack/slack-channel.ts +123 -1
  142. package/src/internal/cli-deploy.ts +12 -1
  143. package/src/internal/deploy-client.ts +9 -0
  144. package/src/internal/discovery/agent-config.ts +8 -6
  145. package/src/internal/framework-storage-selection.ts +1 -1
  146. package/src/internal/platform-timers.ts +24 -2
  147. package/src/internal/reminder-runner.ts +426 -63
  148. package/src/internal/server.ts +8 -0
  149. package/src/memory.ts +37 -3
  150. package/src/types.ts +16 -9
  151. package/dist/docs/assets/chunks/@localSearchIndexroot.BnSgidYE.js +0 -1
  152. package/dist/docs/assets/chunks/channel.DdM5EfNW.js +0 -1
  153. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CjfGHeg2.js +0 -1
  154. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CjfGHeg2.js +0 -1
  155. package/dist/docs/assets/chunks/clone.wSOICb_f.js +0 -1
  156. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Cu5X28zZ.js +0 -1
  157. package/dist/docs/assets/reference_cli.md.DLWDz9ij.js +0 -95
  158. package/dist/docs/assets/reference_cli.md.DLWDz9ij.lean.js +0 -1
  159. package/dist/playground/assets/index-C61EWMBK.css +0 -1
  160. /package/dist/playground/assets/{index-CrMWlgUU.js → index-CX6oTKwz.js} +0 -0
@@ -3171,6 +3171,13 @@ export default slackChannel({
3171
3171
  When you create the app, pass `--channel-posts` and invite the bot to
3172
3172
  every channel in the allowlist.
3173
3173
 
3174
+ On Cursor-managed hosting the same watch runs at admission for each
3175
+ delivery. `debounceMs` is ignored there: the control plane answers every
3176
+ delivery immediately, and edits arrive as separate deliveries that are
3177
+ dropped at the edge. Channel ids match without any Slack call; `#name`
3178
+ entries are resolved once per pod with the bot token and need the
3179
+ `channels:read` scope.
3180
+
3174
3181
  ## Control who can message
3175
3182
 
3176
3183
  By default, people outside your workspace get no reply. This matters
@@ -4631,549 +4638,505 @@ for the full contract.
4631
4638
 
4632
4639
  Source: /docs/reference/cli.md
4633
4640
 
4634
- # CLI reference
4635
-
4636
- `@cursor/july` installs one command, `agent-sdk`; `npx @cursor/july <cmd>`
4637
- runs it. Run the CLI with Node 22.13 or newer. Don't run it with Bun; Bun
4638
- corrupts tool-result streams from the Cursor SDK.
4639
-
4640
- `agent-sdk help` prints the built-in summary. The Slack and GitHub packs
4641
- also provide `agent-sdk slack help` and `agent-sdk github help`.
4642
-
4643
- | Command | Description |
4644
- | ------------------------------------------------------- | -------------------------------------------------------------- |
4645
- | [`serve`](#serve) | Serve agents over HTTP |
4646
- | [`dev`](#dev) | Start local development with `serve --dev` |
4647
- | [`chat`](#chat) | Talk to a running agent |
4648
- | [`resume`](#resume) | Reattach chat to a previous session |
4649
- | [`logs`](#logs) | Follow local or hosted logs |
4650
- | [`sessions`](#sessions) | List sessions on a running agent |
4651
- | [`session`](#session) | Inspect one session |
4652
- | [`cost`](#cost) | Report per-session token usage and estimated cost |
4653
- | [`playground`](#playground) | Open the local or hosted playground |
4654
- | [`docs`](#docs) | Serve the shipped documentation site locally |
4655
- | [`run`](#run) | Run one or more turns locally, remotely, or on a hosted agent |
4656
- | [`call`](#call) | Call a server tool without a model turn |
4657
- | [`eval`](#eval) | Run filesystem evals |
4658
- | [`trajectory`](#trajectory) | Summarize a saved event stream |
4659
- | [`init`](#init) | Scaffold a project, or print the setup guide |
4660
- | [`convert-automation`](#convert-automation) | Export a Cursor Automation into an agent project |
4661
- | [`install-skills`](#install-skills) | Refresh coding-agent skills (`npm install` already copies them) |
4662
- | [`info`](#info) | Print the discovered agent surface |
4663
- | [`validate`](#validate) | Check a project and fail on errors |
4664
- | [`login` / `logout` / `whoami`](#login-logout-whoami) | Manage the host's Cursor credential |
4665
- | `version` | Print the installed version and exit (also `--version` / `-V`) |
4666
- | [`update`](#update) | Upgrade the installed CLI |
4667
- | [`deploy`](#deploy) | Deploy one or more agents to Cursor managed hosting |
4668
- | [`deployments`](#deployments) | List hosted deployments |
4669
- | [`deployment`](#deployment) | Inspect one hosted deployment |
4670
- | [`stop`](#stop) | Stop a hosted deployment |
4671
- | [`delete`](#delete) | Delete a hosted deployment |
4672
- | [`rotate-token`](#rotate-token) | Replace a deployment's alias token |
4673
- | [`secrets`](#secrets) | Manage deployment secrets |
4674
- | [`mcp`](#mcp) | Proxy the agent's MCP endpoint over stdio; `mcp install` writes `~/.cursor/mcp.json` |
4675
- | [`mcp oauth`](#mcp-oauth) | Authorize host MCP OAuth; optional `--store` to deployment secrets |
4676
- | [`slack ...`](#slack) | Provision, set up, and check Slack channels |
4677
- | [`github ...`](#github) | Forward, replay, and inspect GitHub webhook channels |
4678
-
4679
- ## Choose a target
4680
-
4681
- Request-sending commands support three target types.
4682
-
4683
- | Target | How to select it | Commands |
4641
+ # CLI
4642
+
4643
+ `@cursor/july` provides the `agent-sdk` command for developing, inspecting,
4644
+ testing, and deploying Agent SDK projects. Run it with Node 22.13 or newer;
4645
+ Bun isn't supported. Commands exit nonzero when validation or a synchronous
4646
+ request fails; asynchronous commands can exit `0` once work is accepted.
4647
+
4648
+ Use `npx @cursor/july <command>` to run the CLI without a global install.
4649
+ `agent-sdk help` prints top-level help; the Slack, GitHub, GitLab, and
4650
+ Bitbucket command packs provide their own `help` subcommands.
4651
+
4652
+ ## Command catalog
4653
+
4654
+ ### Development commands
4655
+
4656
+ | Command | Contract |
4657
+ | --- | --- |
4658
+ | `help`, `--help`, `-h` | Print top-level help |
4659
+ | [`serve`](#serve) | Serve one or more agents over HTTP |
4660
+ | [`dev`](#dev) | Serve agents with local-development behavior |
4661
+ | [`docs`](#docs) | Serve the documentation bundled with `@cursor/july` |
4662
+ | [`init`](#init) | Scaffold an Agent SDK project |
4663
+ | [`convert-automation`](#convert-automation) | Export a Cursor Automation into a project |
4664
+ | [`install-skills`](#install-skills) | Refresh the bundled coding-agent skills |
4665
+ | [`info`](#info) | Print the discovered project surface |
4666
+ | [`validate`](#validate) | Check project diagnostics and set the exit status |
4667
+ | [`manifest`](#manifest) | Print deployment metadata as JSON |
4668
+ | [`version`](#version) | Print the installed package version |
4669
+ | [`update`](#update) | Upgrade the installed CLI |
4670
+ | [`login`](#login-logout-whoami) | Sign the host in to Cursor |
4671
+ | [`logout`](#login-logout-whoami) | Remove the stored Cursor credential |
4672
+ | [`whoami`](#login-logout-whoami) | Show the active Cursor credential |
4673
+
4674
+ ### Session and eval commands
4675
+
4676
+ | Command | Contract |
4677
+ | --- | --- |
4678
+ | [`chat`](#chat) | Talk to a running agent |
4679
+ | [`resume`](#resume) | Reattach chat to a previous session |
4680
+ | [`run`](#run) | Start or continue work on a local, running, or managed agent |
4681
+ | [`call`](#call) | Call a server tool without a model turn |
4682
+ | [`skill`](#skill) | Read an authored skill without a model turn |
4683
+ | [`logs`](#logs) | Follow or dump agent logs |
4684
+ | [`sessions`](#sessions) | List sessions |
4685
+ | [`session`](#session) | Inspect a session or start a managed session turn |
4686
+ | [`cost`](#cost) | Report token usage and estimated cost |
4687
+ | [`playground`](#playground) | Open an agent's playground |
4688
+ | [`trajectory`](#trajectory) | Summarize a saved event stream |
4689
+ | [`eval`](#eval) | List, run, inspect, or cancel evals |
4690
+
4691
+ ### Managed hosting commands
4692
+
4693
+ | Command | Contract |
4694
+ | --- | --- |
4695
+ | [`deploy`](#deploy) | Deploy one or more agents |
4696
+ | [`deployments`](#deployments) | List deployments |
4697
+ | [`deployment`](#deployment) | Inspect one deployment |
4698
+ | [`stop`](#stop) | Stop a deployment |
4699
+ | [`cancel-runs`](#cancel-runs) | Cancel active runs and reminder wakes |
4700
+ | [`event-repos`](#event-repos) | Replace a managed application's event repositories |
4701
+ | [`upgrade`](#upgrade) | Move a managed application to a release |
4702
+ | [`delete`](#delete) | Delete a deployment |
4703
+ | [`rotate-token`](#rotate-token) | Replace a deployment's alias token |
4704
+ | [`secrets`](#secrets) | Set, list, or remove deployment secrets |
4705
+
4706
+ ### Connection and channel commands
4707
+
4708
+ | Command | Contract |
4709
+ | --- | --- |
4710
+ | [`mcp`](#mcp) | Proxy an agent's MCP endpoint over stdio |
4711
+ | [`mcp install`](#mcp) | Add the agent to an MCP client config |
4712
+ | [`mcp oauth`](#mcp-oauth) | Authorize an MCP connection |
4713
+ | [`slack`](#slack) | Provision and check Slack channel apps |
4714
+ | [`github`](#github) | Forward, replay, and inspect GitHub webhooks |
4715
+ | [`gitlab`](#gitlab) | Replay and inspect GitLab webhooks |
4716
+ | [`bitbucket`](#bitbucket) | Replay and inspect Bitbucket webhooks |
4717
+
4718
+ ## Targets {#choose-a-target}
4719
+
4720
+ Commands that send requests support these targets:
4721
+
4722
+ | Target | Selection | Commands |
4684
4723
  | --- | --- | --- |
4685
- | Ephemeral local server | Omit `--url` and `--prod` | `run`, `call`, `eval` |
4686
- | Running server | Pass `--url <baseUrl>`, unless the command uses the localhost default described next | `chat`, `resume`, `logs`, `sessions`, `session`, `cost`, `playground`, `run`, `call`, `eval`, `mcp` |
4687
- | Cursor managed hosting | Pass `--prod` | `chat`, `resume`, `logs`, `sessions`, `session`, `cost`, `playground`, `run`, `call`, `eval`, `mcp` |
4688
-
4689
- `chat`, `logs`, `sessions`, `session`, `cost`, and `playground` default to
4690
- `http://127.0.0.1:3000`. A `--url` must include the agent slug for a
4691
- multi-agent server, such as `http://127.0.0.1:3000/pr-approver`.
4692
- `--slug` doesn't change an explicit URL. `mcp` has no default target;
4693
- pass `--url` or `--prod`.
4694
-
4695
- With `--prod`, `--slug` selects the deployment and `--team` selects the
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 |
4724
+ | Ephemeral local server | Omit `--url` and `--prod` | `run`, `call`, `skill`, `eval` |
4725
+ | Running server | Pass `--url <baseUrl>` | `chat`, `resume`, `run`, `call`, `skill`, `eval`, `logs`, `sessions`, `session`, `cost`, `playground`, `mcp` |
4726
+ | Default local server | Omit `--url` and `--prod`; uses `http://127.0.0.1:3000` | `chat`, `resume`, `logs`, `sessions`, `session`, `cost`, `playground` |
4727
+ | Hosted deployment | Pass `--prod` | `chat`, `resume`, `run`, `call`, `skill`, `eval`, `logs`, `sessions`, `session`, `cost`, `playground`, `mcp` |
4728
+ | Managed application | Pass `--prod` | `run`, `session` |
4729
+
4730
+ An explicit `--url` must include the slug for a multi-agent server, such as
4731
+ `http://127.0.0.1:3000/pr-approver`. `--slug` never changes an explicit URL.
4732
+ `--url` and `--prod` are mutually exclusive.
4733
+
4734
+ | Option | Contract |
4734
4735
  | --- | --- |
4735
- | `--port` | Listen on this port. `0` selects an available port. The default is `3000`. When the default is taken, serve tries the next free port and prints a notice; an explicit `--port` fails with a next-port hint instead. |
4736
- | `--host` | Bind this host. The default is loopback-only `127.0.0.1`. |
4737
- | `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and widen playground session access on loopback. |
4738
- | `--mode` | Use `multi` for slugged routes and an index, or `single` for one agent at the unslugged `/v1/*`. The default is `multi`. |
4739
- | `--api-key` | Use this Cursor API key. Otherwise the command uses `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY` when unset), then `CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login. |
4740
- | `--state-root` | Store sessions, streams, workspaces, and channel state here. Keep durable production state outside the agent repository. |
4741
- | `--bearer-token` | Require this bearer token on routes without authored auth. Mutually exclusive with `--allow-anonymous`. |
4742
- | `--allow-anonymous` | Admit every caller as one `anonymous` principal. Use only behind a trusted network boundary. |
4743
- | `--allow-anonymous-cursor-github` | Allow anonymous callers to drive sessions holding a Cursor account's repo-scoped GitHub credential. Use only behind an authenticating proxy. |
4744
- | `--allow-anonymous-cursor-account-mcp` | Allow anonymous callers to drive Cursor account MCP connectors (`defineConnection({ cursorAccount: true })`). Use only behind an authenticating proxy (hosted alias token counts). |
4745
- | `--public-url` | Set the externally reachable host URL. Cloud-runtime peer connections need it to call back into this server. |
4746
- | `--cloud-tools-url` | Authenticated HTTP MCP URL for this deployment's direct server-tool endpoint. Hosted deployments configure it automatically. |
4747
- | `--no-schedules` | Disable the cron runner outside dev mode. |
4748
- | `--no-playground` | Skip the web playground. |
4736
+ | `--dir <path>` | Select the project root. The default is the current directory. |
4737
+ | `--url <baseUrl>` | Use a running agent instead of local project discovery. |
4738
+ | `--prod` | Use a hosted deployment or managed application. Command support depends on the target type as listed above. |
4739
+ | `--slug <slug>` | Select an agent from a multi-agent project or a hosted resource. Under `--prod`, the default is the `--dir` basename. |
4740
+ | `--team <id>` | Select a Cursor team. The signed-in account's team is the default. |
4741
+ | `--api-key <key>` | Override the Cursor credential for commands that authenticate with Cursor. |
4742
+ | `--bearer-token <token>` | Authenticate to a running server with a bearer token. |
4743
+ | `--state-root <path>` | Select local state for `serve` and ephemeral `run`, `call`, `skill`, and `eval` targets. Running and `--prod` targets ignore it. |
4744
+ | `--json` | Request machine-readable output when the command supports it. `run` already defaults to JSON. |
4745
+
4746
+ ## Local servers
4747
+
4748
+ ### Serve agents {#serve}
4749
+
4750
+ `serve` mounts every project discovered under `--dir`:
4751
+
4752
+ ```bash
4753
+ agent-sdk serve [--dir <path>] [--port <n>] [--host <host>]
4754
+ [--mode multi|single] [--dev] [--api-key <key>]
4755
+ [--state-root <path>]
4756
+ [--bearer-token <secret> | --allow-anonymous]
4757
+ [--allow-anonymous-cursor-github]
4758
+ [--allow-anonymous-cursor-account-mcp]
4759
+ [--public-url <url>] [--cloud-tools-url <url>]
4760
+ [--no-schedules] [--no-playground] [--no-docs]
4761
+ [--cursor-events --repo <owner/name>]...
4762
+ ```
4763
+
4764
+ | Option | Contract |
4765
+ | --- | --- |
4766
+ | `--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. |
4767
+ | `--host <host>` | Bind this host. The default is loopback-only `127.0.0.1`. |
4768
+ | `--mode multi` | Mount projects at `/<slug>/v1/*` and `/<slug>/playground`, with an index at `/`. This is the default. |
4769
+ | `--mode single` | Mount one project at `/v1/*` and `/playground`. |
4770
+ | `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and enable local playground access. |
4771
+ | `--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. |
4772
+ | `--bearer-token <secret>` | Require this token on routes without authored authentication. Mutually exclusive with `--allow-anonymous`. |
4773
+ | `--allow-anonymous` | Admit callers as one anonymous principal. Use it only behind a trusted network boundary. |
4774
+ | `--allow-anonymous-cursor-github` | Let anonymous callers use sessions with a Cursor account's repository-scoped GitHub credential. Requires an authenticating proxy. |
4775
+ | `--allow-anonymous-cursor-account-mcp` | Let anonymous callers use Cursor account MCP connections. Requires an authenticating proxy. |
4776
+ | `--public-url <url>` | Publish the externally reachable host URL for peer-agent callbacks. |
4777
+ | `--cloud-tools-url <url>` | Publish the authenticated server-tool MCP URL used by cloud turns. Managed hosting sets it automatically. |
4778
+ | `--no-schedules` | Disable schedule firing outside dev mode. |
4779
+ | `--no-playground` | Skip the playground. |
4749
4780
  | `--no-docs` | Skip the documentation site at `/docs`. |
4750
- | `--cursor-events` | Pull SCM events from Cursor in addition to authored webhook routes. Requires a signed-in host. Pass repeatable `--repo owner/name` values; repos declared by `githubChannel({ cursorAccount })` also enable it. |
4781
+ | `--cursor-events` | Receive SCM events through Cursor. Requires sign-in and one or more repeatable `--repo owner/name` values. |
4751
4782
 
4752
- Multi-agent slugs must start with a letter or digit, then contain only
4753
- letters, digits, `_`, or `-`. The reserved slugs are `v1`, `playground`,
4754
- and `docs`.
4783
+ Multi-agent slugs start with a letter or digit and contain only letters,
4784
+ digits, `_`, or `-`. The reserved slugs are `v1`, `playground`, and `docs`.
4755
4785
 
4756
- ## dev
4786
+ ### Develop locally {#dev}
4757
4787
 
4758
- `dev` is the local-development shortcut for `serve --dev`. Pass the
4759
- agent folder as a positional path, or run it from inside the project:
4788
+ `dev` is `serve --dev` with an optional positional project path:
4760
4789
 
4761
4790
  ```bash
4762
4791
  agent-sdk dev
4763
- agent-sdk dev ./sdk-pr-reviewer
4764
4792
  agent-sdk dev ./sdk-pr-reviewer --port 3000
4765
4793
  ```
4766
4794
 
4767
- `dev` accepts the same flags as [`serve`](#serve). You can use `--dir`
4768
- instead of the positional path.
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`.
4773
-
4774
- ## chat
4795
+ It accepts every `serve` option. Pass at most one positional path, and don't
4796
+ combine it with a different `--dir`.
4775
4797
 
4776
- `chat` talks to a running agent from the terminal. It never starts a
4777
- server.
4798
+ ### Serve the docs {#docs}
4778
4799
 
4779
4800
  ```bash
4780
- agent-sdk chat --url http://127.0.0.1:3000/pr-approver
4781
- agent-sdk chat --message "Is the PR ready to approve?"
4782
- agent-sdk chat --message "Inspect PR 42" --json
4783
- agent-sdk chat --prod --slug pr-approver --team 123
4801
+ npx @cursor/july docs
4802
+ agent-sdk docs [--port <n>] [--host 127.0.0.1] [--print]
4784
4803
  ```
4785
4804
 
4786
- `chat` streams text, tool calls, and a per-turn usage footer.
4787
- On a TTY, `--message` seeds the interactive REPL. With non-TTY input,
4788
- `--message` runs one turn and exits; without it, `chat` reads
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.
4805
+ `docs` serves the bundled documentation without an agent project. It uses an
4806
+ available loopback port by default and stays open until Ctrl-C. `--print`
4807
+ prints the URL without opening a browser.
4794
4808
 
4795
- Use `--session <id>` to reattach a stored session. The command looks up
4796
- its continuation token when you omit `--continuation-token`. Use
4797
- `--resume` to select the most recently updated session with a
4798
- continuation token.
4809
+ ## Sessions and turns
4799
4810
 
4800
- ## resume
4811
+ ### Chat with an agent {#chat}
4801
4812
 
4802
- `resume` is the direct way to reattach the chat REPL.
4813
+ `chat` connects to a running server and never starts an ephemeral one:
4803
4814
 
4804
4815
  ```bash
4805
- agent-sdk resume ses_123 --url http://127.0.0.1:3000/pr-approver
4806
- agent-sdk resume --url http://127.0.0.1:3000/pr-approver
4807
- agent-sdk resume ses_123 --prod --team 123 --slug pr-approver
4808
- agent-sdk resume ses_123 --message "Continue the review" --json
4816
+ agent-sdk chat [--url <baseUrl> | --prod] [--message <text>]
4817
+ [--session <id> | --resume] [--continuation-token <token>]
4818
+ [--slug <slug>] [--team <id>] [--json] [--text] [--no-color]
4809
4819
  ```
4810
4820
 
4811
- Pass a session ID to select it. Omit the ID to select the most recently
4812
- updated followable session from `/v1/sessions`. The command looks up a
4813
- missing continuation token, replays the transcript, and accepts
4814
- follow-ups. `resume --json` requires `--message`. The same operation is
4815
- available as `chat --session <id>` or `chat --resume`.
4821
+ | Input mode | Behavior |
4822
+ | --- | --- |
4823
+ | TTY without `--message` | Open an interactive REPL. |
4824
+ | TTY with `--message` | Send the message, then keep the REPL open. |
4825
+ | Non-TTY with `--message` | Send one turn and exit. |
4826
+ | Non-TTY without `--message` | Read newline-delimited messages until EOF. |
4827
+ | `--json --message <text>` | Send one turn and print `{ ok, sessionId, continuationToken, trajectory }`. |
4828
+ | `--json --text --message <text>` | Print a compact trajectory instead of JSON. |
4829
+
4830
+ Use `--session <id>` to reattach a stored session. If you omit
4831
+ `--continuation-token`, the CLI looks it up from the target's session list.
4832
+ `--resume` selects the most recently updated session with a continuation
4833
+ token. An explicit session ID takes precedence.
4816
4834
 
4817
- ## logs
4835
+ ### Resume a session {#resume}
4818
4836
 
4819
- `logs` follows the local or hosted log buffer.
4837
+ `resume` provides the same reattachment contract as `chat --session`:
4820
4838
 
4821
4839
  ```bash
4822
- agent-sdk logs [--url http://127.0.0.1:3000] [--once] [--json]
4823
- agent-sdk logs --prod [--slug <slug>] [--team <id>] [--once] [--json]
4840
+ agent-sdk resume [sessionId] [--url <baseUrl> | --prod]
4841
+ [--message <text>] [--json] [--text]
4842
+ [--continuation-token <token>] [--slug <slug>] [--team <id>]
4824
4843
  ```
4825
4844
 
4826
- Local mode reads `/v1/logs` from the running server. Hosted mode reports
4827
- deploy progress until the deployment is running or degraded, then
4828
- follows reachable runtime logs.
4829
- The command follows until Ctrl-C by default. `--once` prints the current
4830
- buffer and exits. `--json` emits newline-delimited JSON events.
4845
+ Omit the session ID to select the most recently updated followable session.
4846
+ The command replays the transcript before accepting follow-ups.
4847
+ `resume --json` requires `--message`.
4831
4848
 
4832
- ## sessions
4849
+ ### Run turns {#run}
4833
4850
 
4834
- `sessions` lists sessions on a running or hosted agent.
4851
+ `run` sends messages to an ephemeral, running, or `--prod` target:
4835
4852
 
4836
4853
  ```bash
4837
- agent-sdk sessions [--url <baseUrl> | --prod] [--slug <slug>]
4838
- [--team <id>] [--bearer-token <token>] [--json]
4854
+ agent-sdk run [--dir <path>] [--message <text>]...
4855
+ [--messages-file <path>] [--url <baseUrl> | --prod]
4856
+ [--session <id>] [--continuation-token <token>]
4857
+ [--events <file> | --no-events] [--text]
4858
+ [--timeout-ms <n>] [--no-stream] [--slug <slug>] [--team <id>]
4859
+ [--dry-run] [--as-of <instant>] [--component <key>]
4839
4860
  ```
4840
4861
 
4841
- Text output shows session ID, channel, mode, turn count, running status,
4842
- and update time. `--json` prints full session summaries in
4843
- `{ sessions }`, including continuation tokens.
4844
-
4845
- ## session
4846
-
4847
- `session` inspects the event stream for one session.
4862
+ | Option | Contract |
4863
+ | --- | --- |
4864
+ | `--message <text>` | Send a user message. Repeat it for a multi-turn local or `--url` run. Managed starts accept one message. |
4865
+ | `--messages-file <path>` | Read a JSON array of strings. File messages run before repeated `--message` values. |
4866
+ | `--session <id>` | Continue a session. Managed session starts accept a hosted `ses_...` ID. |
4867
+ | `--continuation-token <token>` | Continue the session selected by `--session` on a running server. Managed session starts use `--session` instead. |
4868
+ | `--events <file>` | Write the raw NDJSON stream to this path. |
4869
+ | `--no-events` | Skip the NDJSON trace. |
4870
+ | `--text` | Print a compact trajectory instead of JSON. |
4871
+ | `--timeout-ms <n>` | Stop waiting after a positive number of milliseconds. There is no default timeout. |
4872
+ | `--no-stream` | Hide live tool and reply progress on stderr. |
4873
+ | `--dry-run` | Mark a managed session turn as non-mutating. |
4874
+ | `--as-of <instant>` | Freeze a managed session's clock at a timezone-bearing ISO-8601 instant. |
4875
+ | `--component <key>` | Select a managed application's component instead of its default. |
4876
+
4877
+ For local and running-server targets, JSON output contains `ok`, `sessionId`,
4878
+ `continuationToken`, `trace`, `playgroundUrl`, `playgroundHint`, `visualize`,
4879
+ and `trajectory`. The `trace` value gives the saved path when event output is
4880
+ enabled. A managed session start confirms acceptance; a continuation also
4881
+ returns `sessionId`. Managed starts return before the turn finishes and ignore
4882
+ `--events`, `--no-events`, `--text`, `--timeout-ms`, and `--no-stream`.
4883
+ A successful managed start exits `0` on acceptance, before its turn outcome is
4884
+ known. A fresh start doesn't return `sessionId` synchronously.
4885
+
4886
+ ### Call a tool {#call}
4887
+
4888
+ `call` invokes a server tool without a model turn:
4848
4889
 
4849
4890
  ```bash
4850
- agent-sdk session <sessionId> [--url <baseUrl> | --prod]
4851
- [--slug <slug>] [--team <id>]
4852
- [--json | --text | --events] [--out <file.ndjson>]
4891
+ agent-sdk call <tool> [--input <json>]
4892
+ [--dir <path> | --url <baseUrl> | --prod]
4893
+ [--session <id>] [--slug <slug>] [--team <id>]
4853
4894
  ```
4854
4895
 
4855
- By default, `session` prints a compact trajectory. `--text` selects the
4856
- same format. `--json` prints the trajectory object. `--events` prints
4857
- `{ sessionId, events }` with the raw event list. You can't combine
4858
- `--events` and `--json`. `--out <file.ndjson>` writes the raw NDJSON
4859
- trace to a file instead of printing. The file uses the same format as
4860
- `run --events` and the playground download. Use
4861
- [`resume`](#resume) to continue the conversation.
4896
+ `--input` accepts JSON and defaults to `{}`. `--session` uses the session
4897
+ workspace and records the call on its event stream. The command prints the
4898
+ server's JSON response and succeeds only when the HTTP response succeeds with
4899
+ `ok: true`.
4900
+
4901
+ See [Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn) for validation,
4902
+ busy-session behavior, and error codes.
4862
4903
 
4863
- ## cost
4904
+ ### Read a skill {#skill}
4864
4905
 
4865
- `cost` reports token usage and estimated cost.
4906
+ `skill` reads an authored skill without a model turn:
4866
4907
 
4867
4908
  ```bash
4868
- agent-sdk cost [sessionId] [--url <baseUrl> | --prod]
4869
- [--slug <slug>] [--team <id>] [--json]
4909
+ agent-sdk skill <name> [--dir <path> | --url <baseUrl> | --prod]
4910
+ [--slug <slug>] [--team <id>] [--text]
4870
4911
  ```
4871
4912
 
4872
- With a session ID, `cost` prints per-turn token usage and estimated
4873
- cost for that session. Without one, it prints one row per session on
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.
4913
+ The default output is the server's JSON response. `--text` prints the rendered
4914
+ `SKILL.md` content.
4880
4915
 
4881
- ## playground
4882
-
4883
- `playground` opens an agent's web playground.
4916
+ ### List sessions {#sessions}
4884
4917
 
4885
4918
  ```bash
4886
- agent-sdk playground [--url <baseUrl> | --prod] [--session <id>]
4887
- [--slug <slug>] [--team <id>]
4888
- [--bearer-token <token>] [--print]
4919
+ agent-sdk sessions [--url <baseUrl> | --prod]
4920
+ [--slug <slug>] [--team <id>] [--bearer-token <token>] [--json]
4889
4921
  ```
4890
4922
 
4891
- `--session` opens a deep link to one session. `--print` prints the URL
4892
- without opening a browser.
4923
+ Text output shows the session ID, channel, mode, turn count, running status,
4924
+ and update time. `--json` prints `{ sessions }`, including continuation
4925
+ tokens.
4893
4926
 
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
4900
-
4901
- `docs` serves the documentation shipped inside `@cursor/july` and opens
4902
- it in a browser. You don't need an agent project.
4927
+ ### Inspect a session {#session}
4903
4928
 
4904
4929
  ```bash
4905
- npx @cursor/july docs
4906
- agent-sdk docs [--port <n>] [--host 127.0.0.1] [--print]
4930
+ agent-sdk session <sessionId> [--url <baseUrl> | --prod]
4931
+ [--slug <slug>] [--team <id>]
4932
+ [--json | --text | --events] [--out <file.ndjson>]
4933
+
4934
+ agent-sdk session --prod [<sessionId>] --slug <slug> --message <text>
4935
+ [--dry-run] [--as-of <instant>] [--component <key>]
4907
4936
  ```
4908
4937
 
4909
- The site is the same documentation mounted at `/docs` on a running
4910
- `serve` host. `docs` starts a loopback-only static server (default port
4911
- is an ephemeral port) and keeps it open until Ctrl-C. `--print` prints
4912
- the URL without opening a browser.
4938
+ | Option | Contract |
4939
+ | --- | --- |
4940
+ | No output option | Print a compact trajectory. |
4941
+ | `--text` | Select the compact trajectory explicitly. |
4942
+ | `--json` | Print the trajectory object. |
4943
+ | `--events` | Print `{ sessionId, events }` with the raw event list. |
4944
+ | `--out <file.ndjson>` | Write the raw NDJSON trace instead of printing it. |
4945
+ | `--prod --message <text>` | Start a managed session or continue the supplied managed session ID. |
4913
4946
 
4914
- ## run
4947
+ `--events` and `--json` are mutually exclusive. Managed sessions without an
4948
+ event trajectory return hosted execution status and logs in text or JSON;
4949
+ `--events` and `--out` require an event trajectory. Use [`resume`](#resume) to
4950
+ continue a conversational session.
4915
4951
 
4916
- `run` sends one or more turns and prints a JSON result.
4952
+ ### Follow logs {#logs}
4917
4953
 
4918
4954
  ```bash
4919
- agent-sdk run --dir . --message "Is https://github.com/acme/checkout/pull/42 ready?"
4920
- agent-sdk run --dir . --message "Inspect PR 42" --message "Summarize the risks"
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
4955
+ agent-sdk logs [--url <baseUrl> | --prod]
4956
+ [--slug <slug>] [--team <id>] [--once] [--json]
4924
4957
  ```
4925
4958
 
4926
- Without `--url` or `--prod`, the command starts an ephemeral server on
4927
- an available port. Its state root is a temporary directory outside the
4928
- project unless you pass `--state-root`. The command closes the server
4929
- after the turns finish.
4959
+ The command follows logs until Ctrl-C. `--once` prints the current buffer and
4960
+ exits; `--json` emits newline-delimited JSON events. A hosted deployment
4961
+ reports deployment progress before runtime logs become available.
4930
4962
 
4931
- | Flag | Meaning |
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. |
4963
+ ### Report costs {#cost}
4943
4964
 
4944
- The default trace path is
4945
- `<state-root>/traces/<sessionId>.ndjson`. JSON output contains
4946
- `ok`, `sessionId`, `continuationToken`, `trace`, `playgroundUrl`,
4947
- `playgroundHint`, `visualize`, and `trajectory`. The command exits
4948
- non-zero when the trajectory fails.
4965
+ ```bash
4966
+ agent-sdk cost [sessionId] [--url <baseUrl> | --prod]
4967
+ [--slug <slug>] [--team <id>] [--json]
4968
+ ```
4949
4969
 
4950
- ## call
4970
+ With a session ID, `cost` prints per-turn token usage and estimated cost.
4971
+ Without one, it prints one row per session and a total. Turns saved before
4972
+ cost tracking appear as unpriced. `--json` prints the underlying report or
4973
+ `{ sessions }` for an aggregate.
4951
4974
 
4952
- `call` invokes a server tool directly, with no model turn.
4975
+ ### Open the playground {#playground}
4953
4976
 
4954
4977
  ```bash
4955
- agent-sdk call inspect_pr --dir . \
4956
- --input '{"prUrl":"https://github.com/acme/checkout/pull/42"}'
4957
- agent-sdk call inspect_pr --url http://127.0.0.1:3000/pr-approver \
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.
4978
+ agent-sdk playground [--url <baseUrl> | --prod] [--session <id>]
4979
+ [--slug <slug>] [--team <id>] [--bearer-token <token>] [--print]
4980
+ ```
5026
4981
 
5027
- ## trajectory
4982
+ The command prints the playground URL and opens it unless `--print` is set.
4983
+ `--session` opens a deep link. A running target with credentials that a
4984
+ browser can't send starts a loopback proxy and stays open until Ctrl-C.
5028
4985
 
5029
- `trajectory` summarizes a saved event stream.
4986
+ ### Inspect a trajectory {#trajectory}
5030
4987
 
5031
4988
  ```bash
5032
- agent-sdk trajectory --events /tmp/run.ndjson [--text]
4989
+ agent-sdk trajectory --events <file.ndjson> [--text]
5033
4990
  ```
5034
4991
 
5035
- `trajectory` converts a saved NDJSON stream into the trajectory JSON
5036
- returned by `run`. `--text` prints the compact view. The command exits
5037
- non-zero when the reconstructed trajectory failed.
4992
+ The command converts an NDJSON stream into the trajectory JSON returned by
4993
+ `run`. `--text` prints the compact view.
4994
+
4995
+ ## Evals
5038
4996
 
5039
- ## init
4997
+ ### Run evals {#eval}
5040
4998
 
5041
- `init` scaffolds a new project.
4999
+ `eval` discovers `evals/**/*.eval.{ts,js}` and runs selected cases:
5042
5000
 
5043
5001
  ```bash
5044
- agent-sdk init ./my-agent # scaffold package.json, tsconfig.json, agent/ + a demo tool
5045
- agent-sdk init ./my-demo --template demo # record a PR walkthrough
5046
- agent-sdk init ./grokbot --template grokbot-agents # talk to Grok Bot agents
5047
- agent-sdk init ./code-wiki --template code-wiki # keep wiki pages current after merge
5048
- agent-sdk init ./agents-md --template agents-md # keep AGENTS.md current from last week's PRs and Slack
5049
- agent-sdk init ./my-reviewer --template security-reviewer # review PRs for security bugs
5050
- agent-sdk init ./thermo-review --template thermo-review # review PRs for bugs and breakage
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
5002
+ agent-sdk eval [--dir <path>] [evalId...]
5003
+ [--list] [--tag <tag>]... [--json] [--verbose]
5004
+ [--timeout-ms <n>] [--strict] [--max-concurrency <n>]
5005
+ [--junit <path>] [--artifacts <dir> | --no-artifacts]
5006
+ [--skip-report] [--out <file.json>] [--no-stream]
5007
+ [--url <baseUrl> | --prod] [--no-wait]
5008
+ [--slug <slug>] [--team <id>]
5061
5009
  ```
5062
5010
 
5063
- `init` leaves existing files unchanged and labels each one `create` or
5064
- `exist`. It prints the project path, then runs `npm install` so
5065
- `@cursor/july` resolves for `dev` and `run`.
5066
-
5067
- Templates may ship `init.json`. On a TTY, `init` asks those questions
5068
- before writing files. `code-wiki`, `pr-autofixer`, `security-help`, and
5069
- `agents-md` ask for GitHub repos. `agents-md` also asks for Slack
5070
- channels. `grokbot-agents` asks for Grok Bot names. Repeat
5071
- `--var id=value` to answer without a prompt.
5072
- `--json` and non-TTY hosts skip the interview unless `--var` is set.
5011
+ Select an exact case such as `weather/nyc`, a file prefix such as `weather`,
5012
+ several IDs, or no IDs for every case. Repeat `--tag` for OR matching.
5013
+ Projects must provide `evals/evals.config.{ts,js}` with `maxConcurrency`
5014
+ between 1 and 200.
5073
5015
 
5074
- On a TTY, `init` also asks whether to refresh the coding-agent skills in
5075
- `~/.cursor/skills/agentsdk/`. Installing `@cursor/july` already copies
5076
- them via postinstall (with `alwaysApply: true` so Cursor injects the
5077
- bodies), so this prompt is a chance to overwrite with the package
5078
- version. The prompt is skipped for `--json` and non-interactive hosts.
5016
+ | Option | Contract |
5017
+ | --- | --- |
5018
+ | `--list` | List matching cases without running them. `--list --json` prints an array. |
5019
+ | `--tag <tag>` | Select a tag. Repeat the option for OR matching. |
5020
+ | `--json` | Print `{ ok, passed, failed, scored, skipped, strict, results }`. |
5021
+ | `--verbose` | Stream `t.log` lines and reply snippets. |
5022
+ | `--no-stream` | Hide live progress on stderr. |
5023
+ | `--strict` | Treat a scored case below its soft threshold as a failure. |
5024
+ | `--max-concurrency <n>` | Override `maxConcurrency` from the eval config for an ephemeral local run. |
5025
+ | `--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. |
5026
+ | `--junit <path>` | Write JUnit XML for an ephemeral local run. |
5027
+ | `--artifacts <dir>` | Select the artifact directory for an ephemeral local run. The default is a timestamped directory under the project's state directory. |
5028
+ | `--no-artifacts` | Skip artifacts for an ephemeral local run. |
5029
+ | `--skip-report` | Ignore reporters from eval files and the eval config during an ephemeral local run. |
5030
+ | `--out <file.json>` | Also write the full result JSON. |
5031
+ | `--no-wait` | Return after a running server or hosted deployment accepts the batch. |
5032
+
5033
+ A running server or hosted deployment prints its Eval ID when it accepts the
5034
+ batch.
5035
+ Use these commands to inspect or cancel it:
5079
5036
 
5080
- If the host isn't signed in, `init` runs `agent-sdk login` and waits for
5081
- the browser flow. It then prints the `cd`, `agent-sdk login`, and
5082
- `agent-sdk dev` steps still needed.
5037
+ ```bash
5038
+ agent-sdk eval status [evalId] --prod [--slug <slug>] [--team <id>]
5039
+ agent-sdk eval status [evalId] --url <baseUrl>
5040
+ agent-sdk eval cancel <evalId> --prod [--slug <slug>] [--team <id>]
5041
+ agent-sdk eval cancel <evalId> --url <baseUrl>
5042
+ ```
5083
5043
 
5084
- With `--json`, `init` still installs dependencies but never blocks on
5085
- login or skill installation. It prints `{ ok, directory, template, created,
5086
- skipped, installed, installError, cliOnPath, cliLinkError, next }`. The
5087
- `next` list includes `login` when the host is unsigned.
5044
+ `eval status` without an ID lists recent remote runs. `eval status --out`
5045
+ requires an ID. The `status` and `cancel` subcommands require `--url` or
5046
+ `--prod`.
5088
5047
 
5089
- ## convert-automation
5048
+ ## Projects
5090
5049
 
5091
- `convert-automation` exports a Cursor Automation into an agent project.
5050
+ ### Scaffold a project {#init}
5092
5051
 
5093
5052
  ```bash
5094
- agent-sdk convert-automation <url> [--dir <path>] [--json]
5053
+ agent-sdk init [directory] [--template <name>] [--var id=value]... [--json]
5095
5054
  ```
5096
5055
 
5097
- `<url>` is the dashboard URL (`…/automations/<uuid>` or
5098
- `…/custom-agents/<uuid>`) or a bare UUID. The command fetches the
5099
- Automation with your Cursor credentials. It writes converted files to
5100
- `--dir`, which defaults to `./<automation-name>`, adds missing `init`
5101
- scaffold files, and runs `npm install`. File generation does not
5102
- overwrite existing paths. The install may still update lockfiles or run
5103
- lifecycle scripts from an existing `package.json`.
5056
+ Without a directory, `init` prints the setup guide and changes no files. With
5057
+ a directory, it preserves existing scaffold files, adds missing files,
5058
+ installs dependencies, and tries to put `agent-sdk` on `PATH`.
5059
+
5060
+ | Option | Contract |
5061
+ | --- | --- |
5062
+ | `--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`. |
5063
+ | `--var id=value` | Answer a template question without a prompt. Repeat for multiple answers. |
5064
+ | `--json` | Skip interactive login and skill prompts, then print `{ ok, directory, template, created, skipped, installed, installError, cliOnPath, cliLinkError, next }`. `ok` reflects dependency installation. |
5065
+
5066
+ On a TTY, templates with questions run their interview before writing files.
5067
+ `init` also offers to refresh the bundled coding-agent skills and starts login
5068
+ when the host has no Cursor credential.
5104
5069
 
5105
- MCP servers convert to Cursor-account connections resolved at runtime.
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`.
5070
+ ### Convert an Automation {#convert-automation}
5111
5071
 
5112
- Warnings do not change the exit status. Bad arguments, authentication
5113
- failures, fetch failures, and file write failures return a nonzero exit
5114
- code.
5072
+ ```bash
5073
+ agent-sdk convert-automation <url-or-uuid> [--dir <path>] [--json]
5074
+ ```
5075
+
5076
+ The input can be a Cursor Automation dashboard URL or its UUID. The output
5077
+ directory defaults to `./<automation-name>`. Generated files don't overwrite
5078
+ existing paths, and missing scaffold files are added. The following
5079
+ `npm install` can update lockfiles and run lifecycle scripts from an existing
5080
+ `package.json`.
5115
5081
 
5116
5082
  `--json` prints
5117
5083
  `{ ok, directory, files, warnings, setupSteps, installed, installError, mcpConnections }`.
5118
- On failure it prints `{ ok: false, error }` and still writes the prose
5119
- error to stderr.
5084
+ Conversion warnings and dependency-install failures remain visible in this
5085
+ output without failing a completed file conversion. Invalid input,
5086
+ authentication, export, and file-write failures exit nonzero.
5120
5087
 
5121
- The [Convert a Cursor Automation](/docs/guides/convert-automation.md) guide
5122
- covers generated files and behavior the converter cannot reproduce.
5088
+ See [Convert a Cursor Automation](/docs/guides/convert-automation.md) for the
5089
+ generated project and features that need manual review.
5123
5090
 
5124
- ## install-skills
5125
-
5126
- `install-skills` copies the package's coding-agent skills into
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).
5091
+ ### Install coding-agent skills {#install-skills}
5132
5092
 
5133
5093
  ```bash
5134
5094
  agent-sdk install-skills [--print] [--json]
5135
5095
  ```
5136
5096
 
5137
- Running the command is the confirmation: it never prompts, and it
5138
- overwrites the installed skills with the version bundled in the
5139
- package. `init` offers the same refresh once, interactively. `--print`
5140
- previews the skills, the removals, and the install path without writing
5141
- anything. `--json` prints
5097
+ The command replaces the installed Agent SDK skills under
5098
+ `~/.cursor/skills/agentsdk/` with the package copy and removes stale bundled
5099
+ skills. `--print` previews the change. `--json` prints
5142
5100
  `{ ok, dryRun, directory, firstInstall, skills, removed }`.
5143
5101
 
5144
- Set `CURSOR_JULY_SKIP_SKILL_INSTALL=1` to skip the postinstall copy.
5145
- `CURSOR_JULY_SKILLS_HOME` overrides the `~/.cursor/skills` directory.
5146
-
5147
- ## info
5102
+ Package installation already performs this copy. Set
5103
+ `CURSOR_JULY_SKIP_SKILL_INSTALL=1` to skip that install hook, or set
5104
+ `CURSOR_JULY_SKILLS_HOME` to choose another skills directory.
5148
5105
 
5149
- `info` prints the discovered agent surface.
5106
+ ### Inspect a project {#info}
5150
5107
 
5151
5108
  ```bash
5152
- agent-sdk info --dir . [--json]
5109
+ agent-sdk info [--dir <path>] [--json]
5153
5110
  ```
5154
5111
 
5155
- `info` reports the model, instruction size, tools, skills, MCP
5156
- connections, subagents, channel routes, schedules, hooks, and
5157
- diagnostics. Text output summarizes each mounted agent. `--json` prints
5158
- `{ agents: [{ slug, ...projectInfo }] }`, with one entry per mounted
5159
- slug. Use `validate`, not `info --json`, when a script needs an error
5160
- exit status.
5112
+ Text output lists the model, instructions, tools, skills, extensions,
5113
+ connections, subagents, channels, schedules, hooks, hosting settings, and
5114
+ diagnostics. For one unslugged project, `--json` prints its project info
5115
+ object. For slugged or multi-agent discovery, it prints `{ agents }`.
5161
5116
 
5162
- ## validate
5117
+ ### Validate a project {#validate}
5163
5118
 
5164
- `validate` checks the project and sets the exit code.
5119
+ ```bash
5120
+ agent-sdk validate [--dir <path>]
5121
+ ```
5122
+
5123
+ `validate` prints every discovered project's diagnostics and exits nonzero
5124
+ when any diagnostic has error severity. Use it instead of `info --json` when a
5125
+ script needs validation status.
5126
+
5127
+ ### Print a deployment manifest {#manifest}
5165
5128
 
5166
5129
  ```bash
5167
- agent-sdk validate --dir .
5130
+ agent-sdk manifest [--dir <path>] [--json]
5168
5131
  ```
5169
5132
 
5170
- `validate` prints diagnostics for each agent and exits non-zero when any
5171
- diagnostic has error severity. `serve` also refuses to start when errors
5172
- are present. Warnings don't change the exit status.
5133
+ `manifest` validates one project and prints its deployment metadata without a
5134
+ network request. Default output is indented JSON; `--json` prints one compact
5135
+ line.
5173
5136
 
5174
- ## login / logout / whoami
5137
+ ## Credentials and versions
5175
5138
 
5176
- Three commands manage the host's Cursor credential.
5139
+ ### Manage credentials {#login-logout-whoami}
5177
5140
 
5178
5141
  ```bash
5179
5142
  agent-sdk login [--api-key <key>] [--key-name <name>]
@@ -5181,421 +5144,397 @@ agent-sdk whoami [--json]
5181
5144
  agent-sdk logout
5182
5145
  ```
5183
5146
 
5184
- `login` signs the host in to Cursor: browser sign-in mints a named,
5185
- dashboard-revocable API key, and only the key is stored (the default
5186
- name is `<invoked command> (<hostname>)`). It powers inference, the cloud
5187
- runtime, and Cursor account MCP connections. `--key-name` changes the
5188
- name of a browser-minted key. `login --api-key` validates and stores a
5189
- key you already created.
5147
+ | Command | Contract |
5148
+ | --- | --- |
5149
+ | `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. |
5150
+ | `whoami` | Show the active credential and its source. `--json` returns the same identity as JSON. |
5151
+ | `logout` | Remove the stored credential file. It doesn't revoke the API key; revoke the key in the Cursor dashboard. |
5190
5152
 
5191
- `whoami` shows which credential is active and why. An explicit key
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.
5153
+ ### Print the version {#version}
5199
5154
 
5200
- Login and account RPCs honor `CURSOR_API_BASE_URL`. The SDK harness
5201
- honors `CURSOR_BACKEND_URL`. Set both to the same URL, or keys minted
5202
- on one host are rejected by the other.
5155
+ ```bash
5156
+ agent-sdk version [--json]
5157
+ agent-sdk --version
5158
+ agent-sdk -V
5159
+ ```
5203
5160
 
5204
- ## update
5161
+ Text output is the version number. `--json` prints
5162
+ `{ name, version }`.
5205
5163
 
5206
- `update` upgrades an installed copy to the latest published version.
5164
+ ### Update the CLI {#update}
5207
5165
 
5208
5166
  ```bash
5209
5167
  agent-sdk update
5210
5168
  ```
5211
5169
 
5212
- The command checks npm's `latest` tag, detects how the Agent SDK was installed,
5213
- and runs the matching npm, pnpm, Yarn, or Bun upgrade command. It handles
5214
- global installs and project dependencies. It doesn't prompt before
5215
- running the package-manager command.
5216
-
5217
- Source checkouts, `npx` or `pnpm dlx` caches, and unknown install layouts
5218
- aren't changed. The command prints a manual upgrade hint instead.
5170
+ `update` checks npm's `latest` tag and upgrades a recognized global or project
5171
+ install with its package manager. If it can't identify an installed copy, it
5172
+ prints a manual upgrade command instead.
5219
5173
 
5220
- Published installs also check for a newer version at most once every 24
5221
- hours and print an update warning on stderr. Source checkouts, CI, and
5222
- commands with an explicit `--json` flag skip this automatic check.
5174
+ Published installs check for updates at most once every 24 hours. Set
5175
+ `AGENT_SERVE_NO_UPDATE_CHECK`, `NO_UPDATE_NOTIFIER`, or `CI` to disable the
5176
+ automatic warning.
5223
5177
 
5224
- ## deploy
5178
+ ## Managed hosting
5225
5179
 
5226
- `deploy` sends one or more agents to Cursor managed hosting.
5180
+ ### Deploy agents {#deploy}
5227
5181
 
5228
5182
  ```bash
5229
5183
  agent-sdk deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
5230
- [--repo <https-url>] [--ref <git-ref>] [--path <agent-path>]
5231
- [--cursor-events-repo owner/name]...
5232
- [--allow-domain <domain>]...
5233
- [--no-wait] [--json]
5234
- ```
5235
-
5236
- Managed hosting requires team membership and the team's cloud-agent
5237
- entitlement. A team service-account API key with agent access can
5238
- deploy. `--team` defaults to the signed-in account's team.
5239
-
5240
- For a single project, the slug defaults to a normalized version of the
5241
- directory name. Deployment slugs contain lowercase letters, digits, `_`,
5242
- or `-`, with a maximum of 64 characters. For a directory with several
5243
- agents, select one with `--slug`, deploy all with `--all`, or choose from
5244
- the TTY prompt. Non-interactive callers must pass `--slug` or `--all`.
5245
- If `--dir` contains no agent project or child agents, `deploy` requires
5246
- `--slug` (or a slug derived from the directory name) and an https git
5247
- repository URL (`--repo`, or inferred from `origin` when `--dir` is an
5248
- agent project). `--all` fails when there is no agent project.
5249
-
5250
- The command infers `--repo`, `--ref`, and `--path` from the current Git
5251
- checkout when possible. Explicit flags take precedence. `--repo` must
5252
- use HTTPS. Repeat `--cursor-events-repo` to select SCM event sources.
5253
- Repeat `--allow-domain` to add engine egress domains; these values are
5254
- combined with `hosting.egressDomains` from the agent config. Egress
5255
- domains apply only to repository-backed deployments. Each domain must
5256
- be a lowercase hostname with at least two labels and an alphabetic
5257
- top-level domain. One leading `*.` wildcard is allowed. A deployment
5258
- can declare at most 20 domains.
5259
-
5260
- By default, the command polls every three seconds for up to ten minutes
5261
- and succeeds only when the deployment reaches `running`. `--no-wait`
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.
5184
+ [--repo <https-url>] [--ref <git-ref>] [--path <agent-path>]
5185
+ [--cursor-events-repo <owner/name>]...
5186
+ [--allow-domain <domain>]... [--no-wait] [--json]
5187
+ ```
5188
+
5189
+ Managed hosting requires a team with agent hosting enabled. A team
5190
+ service-account API key with agent access can deploy.
5191
+
5192
+ | Option | Contract |
5193
+ | --- | --- |
5194
+ | `--slug <slug>` | Select one project and set its deployment slug. |
5195
+ | `--all` | Deploy every child project under a multi-agent `--dir`. Mutually exclusive with `--slug`. |
5196
+ | `--team <id>` | Select the Cursor team. |
5197
+ | `--repo <https-url>` | Set the source repository. The CLI infers it from the current checkout when possible. HTTPS is required. |
5198
+ | `--ref <git-ref>` | Set the source Git ref. The CLI infers the current branch when possible. |
5199
+ | `--path <agent-path>` | Set the project path relative to the repository root. |
5200
+ | `--cursor-events-repo <owner/name>` | Add a repository whose SCM events reach the deployment. Repeat for multiple repositories. |
5201
+ | `--allow-domain <domain>` | Add an egress hostname. Repeat for multiple domains; values are combined with `hosting.egressDomains`. |
5202
+ | `--no-wait` | Return after the deployment request is accepted. |
5203
+ | `--json` | Print one object for one target or an array for multiple targets. |
5204
+
5205
+ Deployment slugs contain lowercase letters, digits, `_`, or `-`, start with a
5206
+ letter or digit, and have at most 64 characters. Egress entries are lowercase
5207
+ hostnames with an alphabetic top-level domain; one leading `*.` wildcard is
5208
+ allowed, with at most 20 entries.
5209
+
5210
+ By default, `deploy` waits until the deployment is running and exits nonzero
5211
+ if it reaches a failed state. A first deployment can return an alias token
5212
+ once. Store it as a secret and send it as `X-Agent-Alias-Token` when calling
5213
+ the stable alias URL.
5214
+
5215
+ ### List deployments {#deployments}
5278
5216
 
5279
5217
  ```bash
5280
5218
  agent-sdk deployments [--team <id>] [--json]
5281
5219
  ```
5282
5220
 
5283
- Text output shows each slug, status, deployment kind, and
5284
- update time. `--json` prints `{ deployments }`.
5221
+ Text output shows slug, status, generation, kind, and update time. `--json`
5222
+ prints `{ deployments }` and may also include `applications`. An empty list
5223
+ succeeds.
5285
5224
 
5286
- ## deployment
5287
-
5288
- `deployment` prints the full status of one deployment.
5225
+ ### Inspect a deployment {#deployment}
5289
5226
 
5290
5227
  ```bash
5291
5228
  agent-sdk deployment <slug> [--team <id>] [--json]
5292
5229
  ```
5293
5230
 
5294
- Text output includes status, kind, alias, source, egress
5295
- domains, secret names, engine state, and the last error when present.
5296
- `--json` returns the full API response. It can include short-lived
5297
- `engineAccess.headers`, so handle JSON output as a credential.
5231
+ Text output includes status, source, routes, secret names, egress domains, and
5232
+ the latest error. `--json` can include short-lived access headers, so handle
5233
+ its output as a credential.
5234
+
5235
+ ### Stop a deployment {#stop}
5298
5236
 
5299
- ## stop
5237
+ ```bash
5238
+ agent-sdk stop <slug> [--team <id>] [--no-wait] [--cancel-runs] [--json]
5239
+ ```
5240
+
5241
+ The command waits for `stopped` by default. `--no-wait` returns after the
5242
+ request is accepted. `--cancel-runs` also requests cancellation of active
5243
+ runs and reminder wakes for a managed application. Other deployment types
5244
+ reject this option.
5300
5245
 
5301
- `stop` shuts down a deployment.
5246
+ ### Cancel active runs {#cancel-runs}
5302
5247
 
5303
5248
  ```bash
5304
- agent-sdk stop <slug> [--team <id>] [--no-wait] [--json]
5249
+ agent-sdk cancel-runs <slug> [--team <id>] [--json]
5305
5250
  ```
5306
5251
 
5307
- The command polls for up to ten minutes until the status reaches
5308
- `stopped`. `--no-wait` returns after the stop request is accepted.
5252
+ The command requests cancellation for a managed application's active runs and
5253
+ reminder wakes. Other deployment types reject it. For a multi-tenant
5254
+ application, this cancels every install; use `stop --cancel-runs` for
5255
+ install-local cancellation. It exits nonzero if any cancellation request fails
5256
+ to start.
5309
5257
 
5310
- ## delete
5258
+ ### Replace event repositories {#event-repos}
5311
5259
 
5312
- `delete` removes a hosted deployment. You can delete a deployment that
5313
- still runs. The command frees the slug. A later deploy can use the same
5314
- name. Spend stays on the archived service account.
5260
+ ```bash
5261
+ agent-sdk event-repos <slug> [--repo <owner/name>]...
5262
+ [--team <id>] [--json]
5263
+ ```
5264
+
5265
+ The supplied repositories replace the managed application's complete event
5266
+ repository list; they aren't merged with the previous list. Omit `--repo` to
5267
+ clear the list.
5268
+
5269
+ ### Upgrade a managed application {#upgrade}
5315
5270
 
5316
5271
  ```bash
5317
- agent-sdk delete <slug> [--team <id>] [--no-wait] [--json]
5272
+ agent-sdk upgrade <slug> [--release <id-or-version>]
5273
+ [--team <id>] [--json]
5318
5274
  ```
5319
5275
 
5320
- The command waits until the deployment is gone. `--no-wait` returns after
5321
- the delete request is accepted. Architecture v2 slugs use the Agent SDK
5322
- control plane. Architecture v1 slugs use the Agent Serve control plane.
5276
+ `--release` accepts a release ID or version. Omit it to select the newest
5277
+ ready release. `--json` prints `{ releaseId }`.
5278
+
5279
+ ### Delete a deployment {#delete}
5280
+
5281
+ ```bash
5282
+ agent-sdk delete <slug> [--team <id>] [--no-wait] [--json]
5283
+ ```
5323
5284
 
5324
- ## rotate-token
5285
+ `delete` removes the deployment and frees its slug. It waits until the
5286
+ deployment is gone unless `--no-wait` is set.
5325
5287
 
5326
- `rotate-token` replaces the alias token used by callers and the hosted
5327
- playground.
5288
+ ### Rotate an alias token {#rotate-token}
5328
5289
 
5329
5290
  ```bash
5330
5291
  agent-sdk rotate-token <slug> [--team <id>] [--json]
5331
5292
  ```
5332
5293
 
5333
- The old token stops working immediately. The replacement is shown once.
5294
+ The old token stops working immediately. The replacement appears once;
5334
5295
  `--json` prints `{ aliasToken }`.
5335
5296
 
5336
- ## mcp
5337
-
5338
- `mcp` proxies an agent's MCP endpoint over stdio for MCP clients that
5339
- spawn local servers, such as Cursor.
5297
+ ### Manage deployment secrets {#secrets}
5340
5298
 
5341
5299
  ```bash
5342
- agent-sdk mcp --prod [--slug <slug>] [--team <id>]
5343
- agent-sdk mcp --url <baseUrl> [--bearer-token <token>]
5344
- agent-sdk mcp install [--prod | --url <baseUrl>] [--name <serverName>]
5345
- [--print] [--json] [--remote]
5300
+ agent-sdk secrets set <slug> NAME [NAME2 ...]
5301
+ [--team <id>] [--from-argv] [--json]
5302
+ agent-sdk secrets list <slug> [--team <id>] [--json]
5303
+ agent-sdk secrets unset <slug> NAME [--team <id>] [--json]
5346
5304
  ```
5347
5305
 
5348
- The bare command reads newline-delimited JSON-RPC on stdin and forwards
5349
- one POST per message to `<target>/v1/mcp`. It requires `--prod` or
5350
- `--url`. With `--prod`, it resolves the hosted deployment through the
5351
- signed-in Cursor account and re-mints short-lived engine credentials as
5352
- they expire, so no durable secret lands in a config file. stdout is
5353
- reserved for the MCP wire; logging goes to stderr.
5306
+ Pass secret names to `set`. On a TTY, the CLI prompts for hidden values; with
5307
+ piped input, provide one line per name. It rejects `NAME=VALUE` arguments
5308
+ unless `--from-argv` is set because command-line values can enter shell
5309
+ history and captured terminals.
5310
+
5311
+ Names use `UPPER_SNAKE_CASE`, start with a letter, and contain at most 64
5312
+ characters. Names beginning with `CURSOR_` are reserved. Values contain at
5313
+ most 4096 bytes, and each deployment holds at most 32 secrets.
5314
+
5315
+ `list` returns names and creation times, never values. JSON output is
5316
+ `{ secretNames }` for `set`, `{ secrets }` for `list`, and `{ removed }` for
5317
+ `unset`. Changes are available to subsequent hosted work.
5354
5318
 
5355
- `mcp install` writes the matching entry into `~/.cursor/mcp.json` so
5356
- the agent shows up as an MCP server in Cursor. `--name` overrides the
5357
- server name (the default is the slug, or a name derived from `--url`).
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.
5319
+ ## MCP connections
5364
5320
 
5365
- ## mcp oauth
5321
+ ### Connect an MCP client {#mcp}
5366
5322
 
5367
- `mcp oauth` authorizes a `defineConnection({ url, oauth: true })` or
5368
- `defineConnection({ cursorAccount: true })` connection.
5323
+ ```bash
5324
+ agent-sdk mcp --prod [--slug <slug>] [--team <id>]
5325
+ agent-sdk mcp --url <baseUrl> [--bearer-token <token>]
5369
5326
 
5370
- URL connections run a browser PKCE flow. Tokens are written to
5371
- `mcp-auth.json` under the CLI config directory (override with
5372
- `AGENT_SERVE_CONFIG_DIR`). Pass `--store` to upsert matching
5373
- `MCP_OAUTH_<CONNECTION>_*` secrets on the hosted deployment.
5374
- `--store` is the path for the next deploy. Hosted Connect lets the
5375
- current process retry.
5327
+ agent-sdk mcp install --prod [--slug <slug>] [--team <id>]
5328
+ [--name <server-name>] [--print] [--json] [--remote]
5329
+ agent-sdk mcp install --url <baseUrl> [--bearer-token <token>]
5330
+ [--name <server-name>] [--print] [--json]
5331
+ ```
5376
5332
 
5377
- Cursor-account connections authorize the hosted deployment's service
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.
5333
+ | Command | Contract |
5334
+ | --- | --- |
5335
+ | `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. |
5336
+ | `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. |
5337
+ | `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. |
5338
+
5339
+ ### Authorize MCP OAuth {#mcp-oauth}
5381
5340
 
5382
5341
  ```bash
5383
- agent-sdk mcp oauth <connection> [--dir .] [--store] [--slug <slug>] [--team <id>]
5342
+ agent-sdk mcp oauth <connection> [--dir <path>] [--store]
5343
+ [--slug <slug>] [--team <id>]
5384
5344
  ```
5385
5345
 
5386
5346
  `<connection>` is the basename under `agent/mcp-connections/` or
5387
5347
  `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
5348
 
5392
- Secret names are `MCP_OAUTH_<NAME>_ACCESS_TOKEN`,
5393
- `_REFRESH_TOKEN`, and `_CLIENT_ID` (`<NAME>` is the connection id in
5394
- upper snake case). Declare them in `hosting.secretNames` so deploy
5395
- validation expects them. Secrets apply on the next deploy.
5349
+ | Connection | Result |
5350
+ | --- | --- |
5351
+ | `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. |
5352
+ | `defineConnection({ cursorAccount: true })` | Authorize the managed deployment's service account through Cursor. `--store` isn't needed. |
5396
5353
 
5397
- Tokens are bound to the connection's resource URL. Changing the URL
5398
- invalidates the local entry; run `mcp oauth` again.
5354
+ Stored secret names are `MCP_OAUTH_<NAME>_ACCESS_TOKEN`,
5355
+ `MCP_OAUTH_<NAME>_REFRESH_TOKEN`, and `MCP_OAUTH_<NAME>_CLIENT_ID`. Declare
5356
+ them in `hosting.secretNames`. URL-connection tokens are bound to the resource
5357
+ URL; authorize again after changing it.
5399
5358
 
5400
- See the [Host MCP OAuth guide](/docs/guides/mcp-oauth.md).
5359
+ See [Host MCP OAuth](/docs/guides/mcp-oauth.md) for the full setup flow.
5401
5360
 
5402
- ## secrets
5361
+ ## Channel helpers
5403
5362
 
5404
- `secrets` manages environment secrets for a deployment.
5363
+ ### Configure Slack {#slack}
5405
5364
 
5406
5365
  ```bash
5407
- agent-sdk secrets set <slug> NAME [NAME2 ...] [--team <id>] [--json]
5408
- agent-sdk secrets list <slug> [--team <id>] [--json]
5409
- agent-sdk secrets unset <slug> NAME [--team <id>] [--json]
5366
+ agent-sdk slack setup
5367
+ agent-sdk slack create [--dir <path>] [--name <name>] [--prod]
5368
+ [--slack-team <id>] [--team <id>] [--icon <url-or-file>]
5369
+ [--prefix <prefix> | --no-prefix] [--channel-posts] [--json]
5370
+ agent-sdk slack destroy [--dir <path>] [--prod]
5371
+ [--slack-team <id>] [--team <id>] [--json]
5372
+ agent-sdk slack icon <url-or-file> [--dir <path>] [--prod]
5373
+ [--slack-team <id>] [--team <id>] [--json]
5374
+ agent-sdk slack init --manual [--dir <path>] [--name <name>]
5375
+ [--prefix <prefix> | --no-prefix] [--channel-posts]
5376
+ [--install | --no-install] [--slack-team <id>] [--prod]
5377
+ agent-sdk slack manifest [--dir <path>] [--name <name>]
5378
+ [--env dev|prod|both] [--channel-posts] [--print]
5379
+ agent-sdk slack doctor [--dir <path>]
5380
+ [--prefix <prefix> | --no-prefix] [--channel <id>]... [--json]
5410
5381
  ```
5411
5382
 
5412
- Pass names only. On a TTY, `secrets set` prompts for each value with
5413
- hidden input (nothing echoes). When stdin is piped, provide one line per
5414
- name. Values never print on stdout.
5383
+ | Subcommand | Contract |
5384
+ | --- | --- |
5385
+ | `setup` | Print the setup choices without changing files. |
5386
+ | `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. |
5387
+ | `destroy` | Delete the provisioned app. Existing local token entries remain but stop working. |
5388
+ | `icon` | Set an HTTPS or local PNG, JPG, or GIF icon of at most 512 KB. |
5389
+ | `init --manual` | Write the channel, manifests, Slack CLI project, and setup files for a manually managed app. |
5390
+ | `manifest` | Generate Slack manifests. `--env` defaults to `both`; with `--print`, select one environment when you need one JSON document. |
5391
+ | `doctor` | Check both tokens, Socket Mode connectivity, Slack authentication, and any repeatable `--channel` values. |
5392
+
5393
+ The default token prefix is the project directory name normalized to upper
5394
+ snake case. `--no-prefix` uses `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`.
5395
+ Channel-post subscriptions are off by default; `--channel-posts` adds message
5396
+ events for public and private channels as required by
5397
+ `engagement.channelPosts`.
5398
+ Multi-agent servers need one token pair per agent.
5415
5399
 
5416
- Do not put values on the command line. `NAME=VALUE` in argv shows up in
5417
- shell history and in agent-captured terminals. The CLI refuses that form
5418
- unless you pass `--from-argv` (still warns). Prefer a file redirect when
5419
- a human is not at the prompt:
5400
+ See [Slack](/docs/guides/slack.md) for app consent and manual setup.
5401
+
5402
+ ### Test GitHub webhooks {#github}
5420
5403
 
5421
5404
  ```bash
5422
- agent-sdk secrets set weather-agent WEATHER_API_KEY < ./weather-api-key.txt
5405
+ agent-sdk github forward [--dir <path>] [--slug <slug>] [--channel <id>]
5406
+ [--repo owner/repo | --org <org>] [--events a,b,c]
5407
+ [--url <url>] [--host <host>] [--port <n>]
5408
+ [--secret <secret>] [--install]
5409
+ agent-sdk github replay <pr-url-or-owner/repo#N>
5410
+ [--events a,b,c | '*'] [--action <action>] [--conclusion <result>]
5411
+ [--comment <body>] [--context <name>] [--dir <path>]
5412
+ [--slug <slug>] [--channel <id>] [--url <url>]
5413
+ [--secret <secret>] [--dry-run] [--out <dir>] [--json]
5414
+ agent-sdk github events [--dir <path>] [--host <host>] [--port <n>] [--json]
5415
+ agent-sdk github doctor [--install] [--json]
5423
5416
  ```
5424
5417
 
5425
- Secret names use `UPPER_SNAKE_CASE`, start with a letter, and contain at
5426
- most 64 characters. Names beginning with `CURSOR_` are reserved. Values
5427
- can contain at most 4096 bytes, and one deployment can hold 32 secrets.
5418
+ | Subcommand | Contract |
5419
+ | --- | --- |
5420
+ | `forward` | Forward live deliveries with `gh webhook forward`. The CLI derives URLs and events from discovered channels and can fan out to several matches. |
5421
+ | `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. |
5422
+ | `events` | List discovered channel URLs and event sets. No channels is a successful empty result. |
5423
+ | `doctor` | Check the GitHub CLI, its login, and the pinned webhook extension. `--install` installs or repairs the extension. |
5428
5424
 
5429
- `secrets list` returns names and creation times, never values. Secret
5430
- changes reach the engine on its next deploy. `secrets set` upserts the
5431
- named secrets without deleting others.
5425
+ Replay supports `pull_request`, `issue_comment`,
5426
+ `pull_request_review_comment`, `check_run`, `check_suite`, `workflow_run`, and
5427
+ `status`. `--dry-run` prints without posting. `--out` writes fixtures and
5428
+ still posts unless combined with `--dry-run`.
5432
5429
 
5433
- JSON output is `{ secretNames }` for `set`, `{ secrets }` for `list`,
5434
- and `{ removed }` for `unset`.
5430
+ Forwarding requires repository admin access, or organization owner access for
5431
+ `--org`. It uses the GitHub CLI's stored login; unset `GITHUB_TOKEN` and
5432
+ `GH_TOKEN` before forwarding. Replay needs only pull-request read access.
5435
5433
 
5436
- ## slack
5434
+ See [GitHub](/docs/guides/github.md) for channel setup and live delivery.
5437
5435
 
5438
- The `slack` pack provisions, generates, and checks Socket Mode channel
5439
- setup.
5436
+ ### Test GitLab webhooks {#gitlab}
5440
5437
 
5441
5438
  ```bash
5442
- agent-sdk slack setup
5443
- agent-sdk slack create [--dir <path>] [--name <name>] [--prod]
5444
- [--slack-team <T…>] [--team <id>]
5445
- [--icon <https-url-or-file>]
5446
- [--prefix <prefix> | --no-prefix]
5447
- [--channel-posts] [--json]
5448
- agent-sdk slack destroy [--dir <path>] [--prod] [--slack-team <T…>]
5449
- [--team <id>] [--json]
5450
- agent-sdk slack icon <https-url-or-file> [--dir <path>] [--prod]
5451
- [--slack-team <T…>] [--team <id>] [--json]
5452
- agent-sdk slack init --manual [--dir <path>] [--name <name>]
5453
- [--prefix <prefix> | --no-prefix] [--channel-posts]
5454
- [--install | --no-install] [--slack-team <T…>] [--prod]
5455
- agent-sdk slack manifest [--dir <path>] [--name <name>]
5456
- [--env dev|prod|both] [--channel-posts] [--print]
5457
- agent-sdk slack doctor [--dir <path>] [--prefix <prefix> | --no-prefix] [--json]
5458
- ```
5459
-
5460
- `slack setup` prints the two-product chooser plus the `--manual` setup
5461
- checklist. It doesn't change files.
5462
-
5463
- `slack create` opens the signed-in Cursor dashboard wizard. Finish Slack
5464
- consent and the bot name there. The CLI writes the token pair into
5465
- `<dir>/.env.local` and runs `doctor`. It requires a signed-in host
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.
5439
+ agent-sdk gitlab replay <mr-url-or-group/project!N>
5440
+ [--events a,b,c | '*'] [--action <action>]
5441
+ [--conclusion <status>] [--comment <body>]
5442
+ [--dir <path>] [--slug <slug>] [--channel <id>]
5443
+ [--url <url>] [--host <host>] [--port <n>]
5444
+ [--secret <secret>] [--dry-run] [--out <dir>] [--json]
5445
+ agent-sdk gitlab events [--dir <path>] [--host <host>] [--port <n>] [--json]
5446
+ agent-sdk gitlab forward [--dir <path>] [--host <host>] [--port <n>]
5447
+ ```
5448
+
5449
+ | Subcommand | Contract |
5450
+ | --- | --- |
5451
+ | `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. |
5452
+ | `events` | List discovered GitLab channel URLs and object kinds. |
5453
+ | `forward` | Print the public-hook and tunnel recipe for live deliveries. |
5454
+
5455
+ Replay supports `merge_request`, `note`, `pipeline`, and `push`. It requires
5456
+ `GITLAB_TOKEN` with project read access. `--secret` defaults to
5457
+ `GITLAB_WEBHOOK_SECRET`; `--dry-run` and `--out` follow the GitHub replay
5458
+ contract.
5459
+
5460
+ See [GitLab](/docs/guides/gitlab.md) for channel setup and self-managed hosts.
5461
+
5462
+ ### Test Bitbucket webhooks {#bitbucket}
5520
5463
 
5521
5464
  ```bash
5522
- agent-sdk github doctor [--install] [--json]
5523
- agent-sdk github events [--dir <path>] [--host <host>] [--port <n>] [--json]
5524
- agent-sdk github forward [--dir <path>] [--slug <slug>] [--channel <id>]
5525
- [--repo owner/repo | --org <org>] [--events a,b,c] [--url <url>]
5526
- [--host <host>] [--port <n>] [--secret <secret>] [--install]
5527
- agent-sdk github replay <pr-url|owner/repo#N> --dir .
5528
- [--events a,b,c|'*'] [--action <action>] [--conclusion <result>]
5529
- [--comment <body>] [--context <name>] [--slug <slug>] [--channel <id>]
5530
- [--host <host>] [--port <n>] [--url <url>] [--secret <secret>]
5531
- [--dry-run] [--out <dir>] [--json]
5532
- ```
5533
-
5534
- `github events` prints each discovered channel's delivery URL and event
5535
- set. When it finds no channels, it returns an empty result and exits
5536
- successfully.
5537
-
5538
- `github forward` wraps `gh webhook forward`. It infers the repository
5539
- from the Git remote when you omit `--repo` and `--org`. URLs and events
5540
- come from the discovered channels; `--events` overrides the event set.
5541
- Use `--slug` or `--channel` to narrow discovery when several channels
5542
- match. Otherwise, one local proxy fans deliveries out to every match.
5543
- `--url` targets one channel. For `forward`, pass `--events` when no
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).
5465
+ agent-sdk bitbucket replay <pr-url-or-workspace/repo#N>
5466
+ [--events a,b,c | '*'] [--comment <body>]
5467
+ [--dir <path>] [--slug <slug>] [--channel <id>]
5468
+ [--url <url>] [--host <host>] [--port <n>]
5469
+ [--secret <secret>] [--dry-run] [--out <dir>] [--json]
5470
+ agent-sdk bitbucket events [--dir <path>] [--host <host>] [--port <n>] [--json]
5471
+ agent-sdk bitbucket forward [--dir <path>] [--host <host>] [--port <n>]
5472
+ ```
5473
+
5474
+ | Subcommand | Contract |
5475
+ | --- | --- |
5476
+ | `replay` | Read a pull request, synthesize webhook payloads in the host's Cloud or Data Center format, and post them to matching channels. |
5477
+ | `events` | List discovered Bitbucket channel URLs and event keys. |
5478
+ | `forward` | Print the repository-hook and tunnel recipe for live deliveries. |
5479
+
5480
+ Replay supports `pullrequest:created`, `pullrequest:updated`,
5481
+ `pullrequest:comment_created`, and `repo:push`, along with their supported Data
5482
+ Center forms. It requires `BITBUCKET_TOKEN` with pull-request read access.
5483
+ `--secret` defaults to `BITBUCKET_WEBHOOK_SECRET`; `--dry-run` and `--out`
5484
+ follow the GitHub replay contract.
5485
+
5486
+ See [Bitbucket](/docs/guides/bitbucket.md) for Cloud and Data Center setup.
5574
5487
 
5575
5488
  ## Environment variables
5576
5489
 
5577
- These environment variables affect the CLI and its channel packs.
5490
+ Credential resolution follows this order: `--api-key`, `CURSOR_API_KEY`,
5491
+ `CURSOR_API_KEY_FILE`, `CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login.
5578
5492
 
5579
- | Variable | Meaning |
5493
+ | Variable | Contract |
5494
+ | --- | --- |
5495
+ | `CURSOR_API_KEY` | Cursor credential. |
5496
+ | `CURSOR_API_KEY_FILE` | Path to a Cursor credential file. |
5497
+ | `CURSOR_SERVICE_ACCOUNT_KEY` | Team service-account credential used after the API key and key-file sources. |
5498
+ | `CURSOR_API_BASE_URL` | Backend for login, account, deployment, and event commands. |
5499
+ | `CURSOR_BACKEND_URL` | Backend for Agent SDK turns. Set it with `CURSOR_API_BASE_URL` when using a non-default backend. |
5500
+ | `AGENT_SERVE_CONFIG_DIR` | Override the CLI config directory for stored credentials and update state. |
5501
+ | `AGENT_SERVE_NO_UPDATE_CHECK`, `NO_UPDATE_NOTIFIER`, `CI` | Disable published-version checks when set to a non-empty value other than `0`. |
5502
+ | `CURSOR_JULY_SKIP_SKILL_INSTALL` | Skip the package install hook that refreshes coding-agent skills. |
5503
+ | `CURSOR_JULY_SKILLS_HOME` | Override the coding-agent skills directory. |
5504
+ | `GITHUB_WEBHOOK_SECRET` | Default signature secret for GitHub forwarding and replay. |
5505
+ | `GITHUB_APP_ID`, `GITHUB_APP_PRIVATE_KEY`, `GITHUB_APP_INSTALLATION_ID` | GitHub App credentials for outbound API calls. |
5506
+ | `GITHUB_TOKEN`, `GH_TOKEN` | Token credentials for outbound GitHub calls. Unset both for `github forward`. |
5507
+ | `GITLAB_TOKEN` | Token for GitLab API reads and direct channel calls. |
5508
+ | `GITLAB_API_BASE_URL` | Override the GitLab REST base URL for self-managed hosts. |
5509
+ | `GITLAB_WEBHOOK_SECRET` | Default GitLab webhook token for replay and channel verification. |
5510
+ | `BITBUCKET_TOKEN` | Token for Bitbucket API reads and direct channel calls. |
5511
+ | `BITBUCKET_API_BASE_URL` | Override the Bitbucket Data Center REST base URL. |
5512
+ | `BITBUCKET_WEBHOOK_SECRET` | Default Bitbucket signing secret for replay and channel verification. |
5513
+ | `SLACK_BOT_TOKEN`, `SLACK_APP_TOKEN` | Slack tokens for one agent. Multi-agent servers use `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN`. |
5514
+
5515
+ ## Exit status
5516
+
5517
+ | Command | Nonzero contract |
5580
5518
  | --- | --- |
5581
- | `CURSOR_API_KEY` | Cursor credential. It takes precedence over `CURSOR_API_KEY_FILE`, `CURSOR_SERVICE_ACCOUNT_KEY`, and the stored login. |
5582
- | `CURSOR_API_KEY_FILE` | Path to a Cursor credential file. Used when `CURSOR_API_KEY` is unset. When this variable is unset, the hosted default `/run/cursor/secrets/CURSOR_API_KEY` is tried. A present file takes precedence over `CURSOR_SERVICE_ACCOUNT_KEY` and the stored login. |
5583
- | `CURSOR_SERVICE_ACCOUNT_KEY` | Team service-account credential. Used when `CURSOR_API_KEY` and `CURSOR_API_KEY_FILE` (including the hosted default path) are unset. It takes precedence over the stored login. |
5584
- | `CURSOR_API_BASE_URL` | Backend used by login, account, deployment, and event-relay RPCs. |
5585
- | `CURSOR_BACKEND_URL` | Backend used by the Cursor SDK harness. |
5586
- | `AGENT_SERVE_CONFIG_DIR` | Directory for stored credentials and update-check state. Defaults to the CLI config directory under `~/.config`. |
5587
- | `AGENT_SERVE_NO_UPDATE_CHECK` / `NO_UPDATE_NOTIFIER` | Disable the automatic published-version check when set to a non-empty value other than `0`. |
5588
- | `CI` | Disable the automatic published-version check when set. |
5589
- | `GITHUB_WEBHOOK_SECRET` | Default signing secret for GitHub forwarding and replay. |
5590
- | `GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY` / `GITHUB_APP_INSTALLATION_ID` | GitHub App authentication for outbound API calls. |
5591
- | `GITHUB_TOKEN` / `GH_TOKEN` | Token authentication for outbound API calls. Unset both for `github forward`. |
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. |
5519
+ | No command | Print help and exit `1`. Explicit `help`, `--help`, and `-h` exit `0`. |
5520
+ | `run` | For local and running-server trajectories, exit `1` when the trajectory fails. |
5521
+ | `call` | Exit `1` unless the response succeeds with `ok: true`. |
5522
+ | `skill` | Exit `2` when the name is missing and `1` when the request fails. |
5523
+ | `trajectory` | Exit `1` when the reconstructed trajectory failed. |
5524
+ | `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. |
5525
+ | `eval status` | Exit `3` while the batch runs, `1` when it failed or was cancelled, and `2` for invalid usage. |
5526
+ | `chat`, `session` | Exit `2` for documented option conflicts or missing required input. |
5527
+ | `validate` | Exit `1` when any project diagnostic has error severity. |
5528
+ | `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. |
5529
+ | Other commands | Exit nonzero when validation, authentication, a request, or the requested operation fails. |
5593
5530
 
5594
- ## What's next
5531
+ ## Related
5595
5532
 
5596
- - [Project layout](/docs/reference/project-layout.md): files the CLI discovers
5597
- - [HTTP API](/docs/reference/http-api.md): routes used by `chat`, `call`, and other clients
5598
- - [Deployment](/docs/deployment.md): production auth, state, and operations
5533
+ - [Project layout](/docs/reference/project-layout.md)
5534
+ - [Sessions, events, and streaming](/docs/reference/sessions.md)
5535
+ - [Evals](/docs/reference/evals.md)
5536
+ - [HTTP API](/docs/reference/http-api.md)
5537
+ - [Deployment](/docs/deployment.md)
5599
5538
 
5600
5539
  ---
5601
5540