@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.
- package/dist/channels/slack/inbound.d.ts +7 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +23 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +83 -4
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.BqkJwOZ-.js → app.9eAtsjAM.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.DjNBgxTF.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BJAi2KiV.js → VPLocalSearchBox.C9s69nxj.js} +1 -1
- package/dist/docs/assets/chunks/{arc.BZpXTgvV.js → arc.DmWDRaF-.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.WYI-7F-Y.js → architectureDiagram-Q4EWVU46.BE1Wj4f3.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.CZaUPpg0.js → baseUniq.pmEZGnWu.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.D6UES2pD.js → blockDiagram-DXYQGD6D.D6mM-5XN.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.cwebIe4i.js → c4Diagram-AHTNJAMY.ZQYTPC1b.js} +1 -1
- package/dist/docs/assets/chunks/channel.BNF8VK-B.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.fVyFnjxg.js → chunk-4BX2VUAB.CKJ7gaK8.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BanufG1c.js → chunk-4TB4RGXK.CL61HnvB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.VaSMz5-2.js → chunk-55IACEB6.DsA4XA1m.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.CN2diZOM.js → chunk-EDXVE4YY.BODHCHFW.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.g4ivypu3.js → chunk-FMBD7UC4.D6NBaZTa.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.GZXKn9JJ.js → chunk-OYMX7WX6.BLPuqFXg.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.itXxJZCd.js → chunk-QZHKN3VN.BFs_ML8Z.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.-rw2GfvX.js → chunk-YZCP3GAM.BDjuFyZv.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.iViHzfrK.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.iViHzfrK.js +1 -0
- package/dist/docs/assets/chunks/clone.CJoR2BBM.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.CmaI5br0.js → cose-bilkent-S5V4N54A.D85HNEsi.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.4wY9S4Kt.js → dagre-KV5264BT.V463KlSF.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.Pc3c0u9W.js → diagram-5BDNPKRD.DhBDu1ab.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CYrWz-nj.js → diagram-G4DWMVQ6.v6sC68zl.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.Bgj5hukb.js → diagram-MMDJMWI5.DhHsdXYv.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.DGMEXalS.js → diagram-TYMM5635.BPWNSFZc.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.GepTV9Im.js → erDiagram-SMLLAGMA.Cq0wTMPL.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.DVKywg3j.js → flowDiagram-DWJPFMVM.MveMtucC.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.C7qt9Mlo.js → ganttDiagram-T4ZO3ILL.BzKfGUSf.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.U30_r82P.js → gitGraphDiagram-UUTBAWPF.OToXTSW_.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CyyMyAWv.js → graph.D82tam-l.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.Dn9ACW3y.js → infoDiagram-42DDH7IO.DzFlRmcE.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DlIdIGOA.js → ishikawaDiagram-UXIWVN3A.CVPRJiKe.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.DZj4vy4E.js → journeyDiagram-VCZTEJTY.CQvNTfQC.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.Dl63eMUV.js → kanban-definition-6JOO6SKY.BwywywUl.js} +1 -1
- package/dist/docs/assets/chunks/{layout.BLHZLWPH.js → layout.C4BkPPba.js} +1 -1
- package/dist/docs/assets/chunks/{linear.aXKGKaNw.js → linear.FoSfGKD4.js} +1 -1
- package/dist/docs/assets/chunks/{min.zWnFcpcc.js → min.yLh8jqfl.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.Qs4MQBea.js → mindmap-definition-QFDTVHPH.C9Dq2_CN.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.BmPHgsk7.js → pieDiagram-DEJITSTG.CiGyBcES.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.D5MQ3gwA.js → quadrantDiagram-34T5L4WZ.1FWea9nj.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CkdUFrO7.js → requirementDiagram-MS252O5E.B1q7ntiV.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.KZrljrAV.js → sankeyDiagram-XADWPNL6.Cpr4oU_k.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.XMoEW-Lx.js → sequenceDiagram-FGHM5R23.CUK68STn.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BmTzePLj.js → stateDiagram-FHFEXIEX.zU0yL2m4.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.nV8Nl-td.js +1 -0
- package/dist/docs/assets/chunks/{theme.BfQzpxsg.js → theme.DhnKd0CD.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Dug0oamp.js → timeline-definition-GMOUNBTQ.CNYoXo3F.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BOTHrEFu.js → vennDiagram-DHZGUBPP.DFWH3G9s.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.DXy2i1LS.js → wardley-RL74JXVD.Do4PwzeN.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CoXKdfi6.js → wardleyDiagram-NUSXRM2D.7WLkqM7s.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.DXoSCjAW.js → xychartDiagram-5P7HB3ND.-SyUNgWw.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.Bo96y42E.js → guides_slack.md.DVjNyqq5.js} +3 -3
- package/dist/docs/assets/{guides_slack.md.Bo96y42E.lean.js → guides_slack.md.DVjNyqq5.lean.js} +1 -1
- package/dist/docs/assets/reference_cli.md.BvnQM8wd.js +97 -0
- package/dist/docs/assets/reference_cli.md.BvnQM8wd.lean.js +1 -0
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +35 -35
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +37 -37
- package/dist/docs/guides/slack.md +7 -0
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +690 -751
- package/dist/docs/llms.txt +1 -1
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +127 -125
- package/dist/docs/reference/cli.md +685 -753
- package/dist/docs/reference/connections.html +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +35 -35
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/pr-autofixer.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +9 -1
- package/dist/internal/deploy-client.d.ts +6 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -0
- package/dist/internal/discovery/agent-config.d.ts +3 -1
- package/dist/internal/discovery/agent-config.d.ts.map +1 -1
- package/dist/internal/discovery/agent-config.js +7 -4
- package/dist/internal/framework-storage-selection.d.ts +1 -1
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +20 -2
- package/dist/internal/reminder-runner.d.ts +79 -1
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +276 -44
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +7 -0
- package/dist/memory.d.ts +4 -0
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +28 -4
- package/dist/playground/assets/index-DLwnR9ys.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +16 -9
- package/dist/types.d.ts.map +1 -1
- package/docs/guides/slack.md +7 -0
- package/docs/reference/cli.md +686 -754
- package/package.json +1 -1
- package/src/channels/slack/inbound.ts +24 -0
- package/src/channels/slack/slack-channel.ts +123 -1
- package/src/internal/cli-deploy.ts +12 -1
- package/src/internal/deploy-client.ts +9 -0
- package/src/internal/discovery/agent-config.ts +8 -6
- package/src/internal/framework-storage-selection.ts +1 -1
- package/src/internal/platform-timers.ts +24 -2
- package/src/internal/reminder-runner.ts +426 -63
- package/src/internal/server.ts +8 -0
- package/src/memory.ts +37 -3
- package/src/types.ts +16 -9
- package/dist/docs/assets/chunks/@localSearchIndexroot.BnSgidYE.js +0 -1
- package/dist/docs/assets/chunks/channel.DdM5EfNW.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CjfGHeg2.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CjfGHeg2.js +0 -1
- package/dist/docs/assets/chunks/clone.wSOICb_f.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Cu5X28zZ.js +0 -1
- package/dist/docs/assets/reference_cli.md.DLWDz9ij.js +0 -95
- package/dist/docs/assets/reference_cli.md.DLWDz9ij.lean.js +0 -1
- package/dist/playground/assets/index-C61EWMBK.css +0 -1
- /package/dist/playground/assets/{index-CrMWlgUU.js → index-CX6oTKwz.js} +0 -0
|
@@ -1,546 +1,502 @@
|
|
|
1
|
-
# CLI
|
|
2
|
-
|
|
3
|
-
`@cursor/july`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
| [`
|
|
20
|
-
| [`
|
|
21
|
-
| [`docs`](#docs)
|
|
22
|
-
| [`
|
|
23
|
-
| [`
|
|
24
|
-
| [`
|
|
25
|
-
| [`
|
|
26
|
-
| [`
|
|
27
|
-
| [`
|
|
28
|
-
| [`
|
|
29
|
-
| [`
|
|
30
|
-
| [`
|
|
31
|
-
| [`
|
|
32
|
-
| `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
| [`
|
|
39
|
-
| [`
|
|
40
|
-
| [`
|
|
41
|
-
| [`
|
|
42
|
-
| [`
|
|
43
|
-
| [`
|
|
44
|
-
| [`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
# CLI
|
|
2
|
+
|
|
3
|
+
`@cursor/july` provides the `agent-sdk` command for developing, inspecting,
|
|
4
|
+
testing, and deploying Agent SDK projects. Run it with Node 22.13 or newer;
|
|
5
|
+
Bun isn't supported. Commands exit nonzero when validation or a synchronous
|
|
6
|
+
request fails; asynchronous commands can exit `0` once work is accepted.
|
|
7
|
+
|
|
8
|
+
Use `npx @cursor/july <command>` to run the CLI without a global install.
|
|
9
|
+
`agent-sdk help` prints top-level help; the Slack, GitHub, GitLab, and
|
|
10
|
+
Bitbucket command packs provide their own `help` subcommands.
|
|
11
|
+
|
|
12
|
+
## Command catalog
|
|
13
|
+
|
|
14
|
+
### Development commands
|
|
15
|
+
|
|
16
|
+
| Command | Contract |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `help`, `--help`, `-h` | Print top-level help |
|
|
19
|
+
| [`serve`](#serve) | Serve one or more agents over HTTP |
|
|
20
|
+
| [`dev`](#dev) | Serve agents with local-development behavior |
|
|
21
|
+
| [`docs`](#docs) | Serve the documentation bundled with `@cursor/july` |
|
|
22
|
+
| [`init`](#init) | Scaffold an Agent SDK project |
|
|
23
|
+
| [`convert-automation`](#convert-automation) | Export a Cursor Automation into a project |
|
|
24
|
+
| [`install-skills`](#install-skills) | Refresh the bundled coding-agent skills |
|
|
25
|
+
| [`info`](#info) | Print the discovered project surface |
|
|
26
|
+
| [`validate`](#validate) | Check project diagnostics and set the exit status |
|
|
27
|
+
| [`manifest`](#manifest) | Print deployment metadata as JSON |
|
|
28
|
+
| [`version`](#version) | Print the installed package version |
|
|
29
|
+
| [`update`](#update) | Upgrade the installed CLI |
|
|
30
|
+
| [`login`](#login-logout-whoami) | Sign the host in to Cursor |
|
|
31
|
+
| [`logout`](#login-logout-whoami) | Remove the stored Cursor credential |
|
|
32
|
+
| [`whoami`](#login-logout-whoami) | Show the active Cursor credential |
|
|
33
|
+
|
|
34
|
+
### Session and eval commands
|
|
35
|
+
|
|
36
|
+
| Command | Contract |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| [`chat`](#chat) | Talk to a running agent |
|
|
39
|
+
| [`resume`](#resume) | Reattach chat to a previous session |
|
|
40
|
+
| [`run`](#run) | Start or continue work on a local, running, or managed agent |
|
|
41
|
+
| [`call`](#call) | Call a server tool without a model turn |
|
|
42
|
+
| [`skill`](#skill) | Read an authored skill without a model turn |
|
|
43
|
+
| [`logs`](#logs) | Follow or dump agent logs |
|
|
44
|
+
| [`sessions`](#sessions) | List sessions |
|
|
45
|
+
| [`session`](#session) | Inspect a session or start a managed session turn |
|
|
46
|
+
| [`cost`](#cost) | Report token usage and estimated cost |
|
|
47
|
+
| [`playground`](#playground) | Open an agent's playground |
|
|
48
|
+
| [`trajectory`](#trajectory) | Summarize a saved event stream |
|
|
49
|
+
| [`eval`](#eval) | List, run, inspect, or cancel evals |
|
|
50
|
+
|
|
51
|
+
### Managed hosting commands
|
|
52
|
+
|
|
53
|
+
| Command | Contract |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| [`deploy`](#deploy) | Deploy one or more agents |
|
|
56
|
+
| [`deployments`](#deployments) | List deployments |
|
|
57
|
+
| [`deployment`](#deployment) | Inspect one deployment |
|
|
58
|
+
| [`stop`](#stop) | Stop a deployment |
|
|
59
|
+
| [`cancel-runs`](#cancel-runs) | Cancel active runs and reminder wakes |
|
|
60
|
+
| [`event-repos`](#event-repos) | Replace a managed application's event repositories |
|
|
61
|
+
| [`upgrade`](#upgrade) | Move a managed application to a release |
|
|
62
|
+
| [`delete`](#delete) | Delete a deployment |
|
|
63
|
+
| [`rotate-token`](#rotate-token) | Replace a deployment's alias token |
|
|
64
|
+
| [`secrets`](#secrets) | Set, list, or remove deployment secrets |
|
|
65
|
+
|
|
66
|
+
### Connection and channel commands
|
|
67
|
+
|
|
68
|
+
| Command | Contract |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| [`mcp`](#mcp) | Proxy an agent's MCP endpoint over stdio |
|
|
71
|
+
| [`mcp install`](#mcp) | Add the agent to an MCP client config |
|
|
72
|
+
| [`mcp oauth`](#mcp-oauth) | Authorize an MCP connection |
|
|
73
|
+
| [`slack`](#slack) | Provision and check Slack channel apps |
|
|
74
|
+
| [`github`](#github) | Forward, replay, and inspect GitHub webhooks |
|
|
75
|
+
| [`gitlab`](#gitlab) | Replay and inspect GitLab webhooks |
|
|
76
|
+
| [`bitbucket`](#bitbucket) | Replay and inspect Bitbucket webhooks |
|
|
77
|
+
|
|
78
|
+
## Targets {#choose-a-target}
|
|
79
|
+
|
|
80
|
+
Commands that send requests support these targets:
|
|
81
|
+
|
|
82
|
+
| Target | Selection | Commands |
|
|
51
83
|
| --- | --- | --- |
|
|
52
|
-
| Ephemeral local server | Omit `--url` and `--prod` | `run`, `call`, `eval` |
|
|
53
|
-
| Running server | Pass `--url <baseUrl
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
multi-agent server, such as
|
|
59
|
-
`--slug`
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
`--state-root
|
|
72
|
-
`
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
If `--dir` is an agent project, it mounts under its directory name. If
|
|
94
|
-
it contains agent projects, each child mounts separately. The index
|
|
95
|
-
lives at `/`. Each agent is available at `/<slug>/v1/*` and
|
|
96
|
-
`/<slug>/playground`. On a TTY, press Enter to restart.
|
|
97
|
-
Unless `--state-root` is set, each mount uses a state directory under
|
|
98
|
-
the agent project. Slugged mounts get a subdirectory named for the slug.
|
|
99
|
-
|
|
100
|
-
| Flag | Meaning |
|
|
84
|
+
| Ephemeral local server | Omit `--url` and `--prod` | `run`, `call`, `skill`, `eval` |
|
|
85
|
+
| Running server | Pass `--url <baseUrl>` | `chat`, `resume`, `run`, `call`, `skill`, `eval`, `logs`, `sessions`, `session`, `cost`, `playground`, `mcp` |
|
|
86
|
+
| Default local server | Omit `--url` and `--prod`; uses `http://127.0.0.1:3000` | `chat`, `resume`, `logs`, `sessions`, `session`, `cost`, `playground` |
|
|
87
|
+
| Hosted deployment | Pass `--prod` | `chat`, `resume`, `run`, `call`, `skill`, `eval`, `logs`, `sessions`, `session`, `cost`, `playground`, `mcp` |
|
|
88
|
+
| Managed application | Pass `--prod` | `run`, `session` |
|
|
89
|
+
|
|
90
|
+
An explicit `--url` must include the slug for a multi-agent server, such as
|
|
91
|
+
`http://127.0.0.1:3000/pr-approver`. `--slug` never changes an explicit URL.
|
|
92
|
+
`--url` and `--prod` are mutually exclusive.
|
|
93
|
+
|
|
94
|
+
| Option | Contract |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `--dir <path>` | Select the project root. The default is the current directory. |
|
|
97
|
+
| `--url <baseUrl>` | Use a running agent instead of local project discovery. |
|
|
98
|
+
| `--prod` | Use a hosted deployment or managed application. Command support depends on the target type as listed above. |
|
|
99
|
+
| `--slug <slug>` | Select an agent from a multi-agent project or a hosted resource. Under `--prod`, the default is the `--dir` basename. |
|
|
100
|
+
| `--team <id>` | Select a Cursor team. The signed-in account's team is the default. |
|
|
101
|
+
| `--api-key <key>` | Override the Cursor credential for commands that authenticate with Cursor. |
|
|
102
|
+
| `--bearer-token <token>` | Authenticate to a running server with a bearer token. |
|
|
103
|
+
| `--state-root <path>` | Select local state for `serve` and ephemeral `run`, `call`, `skill`, and `eval` targets. Running and `--prod` targets ignore it. |
|
|
104
|
+
| `--json` | Request machine-readable output when the command supports it. `run` already defaults to JSON. |
|
|
105
|
+
|
|
106
|
+
## Local servers
|
|
107
|
+
|
|
108
|
+
### Serve agents {#serve}
|
|
109
|
+
|
|
110
|
+
`serve` mounts every project discovered under `--dir`:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
agent-sdk serve [--dir <path>] [--port <n>] [--host <host>]
|
|
114
|
+
[--mode multi|single] [--dev] [--api-key <key>]
|
|
115
|
+
[--state-root <path>]
|
|
116
|
+
[--bearer-token <secret> | --allow-anonymous]
|
|
117
|
+
[--allow-anonymous-cursor-github]
|
|
118
|
+
[--allow-anonymous-cursor-account-mcp]
|
|
119
|
+
[--public-url <url>] [--cloud-tools-url <url>]
|
|
120
|
+
[--no-schedules] [--no-playground] [--no-docs]
|
|
121
|
+
[--cursor-events --repo <owner/name>]...
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
| Option | Contract |
|
|
101
125
|
| --- | --- |
|
|
102
|
-
| `--port
|
|
103
|
-
| `--host
|
|
104
|
-
| `--
|
|
105
|
-
| `--mode` |
|
|
106
|
-
| `--
|
|
107
|
-
| `--state-root
|
|
108
|
-
| `--bearer-token
|
|
109
|
-
| `--allow-anonymous` | Admit
|
|
110
|
-
| `--allow-anonymous-cursor-github` |
|
|
111
|
-
| `--allow-anonymous-cursor-account-mcp` |
|
|
112
|
-
| `--public-url
|
|
113
|
-
| `--cloud-tools-url
|
|
114
|
-
| `--no-schedules` | Disable
|
|
115
|
-
| `--no-playground` | Skip the
|
|
126
|
+
| `--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. |
|
|
127
|
+
| `--host <host>` | Bind this host. The default is loopback-only `127.0.0.1`. |
|
|
128
|
+
| `--mode multi` | Mount projects at `/<slug>/v1/*` and `/<slug>/playground`, with an index at `/`. This is the default. |
|
|
129
|
+
| `--mode single` | Mount one project at `/v1/*` and `/playground`. |
|
|
130
|
+
| `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and enable local playground access. |
|
|
131
|
+
| `--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. |
|
|
132
|
+
| `--bearer-token <secret>` | Require this token on routes without authored authentication. Mutually exclusive with `--allow-anonymous`. |
|
|
133
|
+
| `--allow-anonymous` | Admit callers as one anonymous principal. Use it only behind a trusted network boundary. |
|
|
134
|
+
| `--allow-anonymous-cursor-github` | Let anonymous callers use sessions with a Cursor account's repository-scoped GitHub credential. Requires an authenticating proxy. |
|
|
135
|
+
| `--allow-anonymous-cursor-account-mcp` | Let anonymous callers use Cursor account MCP connections. Requires an authenticating proxy. |
|
|
136
|
+
| `--public-url <url>` | Publish the externally reachable host URL for peer-agent callbacks. |
|
|
137
|
+
| `--cloud-tools-url <url>` | Publish the authenticated server-tool MCP URL used by cloud turns. Managed hosting sets it automatically. |
|
|
138
|
+
| `--no-schedules` | Disable schedule firing outside dev mode. |
|
|
139
|
+
| `--no-playground` | Skip the playground. |
|
|
116
140
|
| `--no-docs` | Skip the documentation site at `/docs`. |
|
|
117
|
-
| `--cursor-events` |
|
|
141
|
+
| `--cursor-events` | Receive SCM events through Cursor. Requires sign-in and one or more repeatable `--repo owner/name` values. |
|
|
118
142
|
|
|
119
|
-
Multi-agent slugs
|
|
120
|
-
|
|
121
|
-
and `docs`.
|
|
143
|
+
Multi-agent slugs start with a letter or digit and contain only letters,
|
|
144
|
+
digits, `_`, or `-`. The reserved slugs are `v1`, `playground`, and `docs`.
|
|
122
145
|
|
|
123
|
-
|
|
146
|
+
### Develop locally {#dev}
|
|
124
147
|
|
|
125
|
-
`dev` is
|
|
126
|
-
agent folder as a positional path, or run it from inside the project:
|
|
148
|
+
`dev` is `serve --dev` with an optional positional project path:
|
|
127
149
|
|
|
128
150
|
```bash
|
|
129
151
|
agent-sdk dev
|
|
130
|
-
agent-sdk dev ./sdk-pr-reviewer
|
|
131
152
|
agent-sdk dev ./sdk-pr-reviewer --port 3000
|
|
132
153
|
```
|
|
133
154
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
Dev mode is always on: schedules and reminders wait for manual dispatch,
|
|
137
|
-
and GitHub accepts unsigned loopback deliveries. Prefer this over
|
|
138
|
-
`serve --dev` while iterating. Pass at most one positional path. Don't
|
|
139
|
-
combine a positional path with a different `--dir`.
|
|
140
|
-
|
|
141
|
-
## chat
|
|
155
|
+
It accepts every `serve` option. Pass at most one positional path, and don't
|
|
156
|
+
combine it with a different `--dir`.
|
|
142
157
|
|
|
143
|
-
|
|
144
|
-
server.
|
|
158
|
+
### Serve the docs {#docs}
|
|
145
159
|
|
|
146
160
|
```bash
|
|
147
|
-
|
|
148
|
-
agent-sdk
|
|
149
|
-
agent-sdk chat --message "Inspect PR 42" --json
|
|
150
|
-
agent-sdk chat --prod --slug pr-approver --team 123
|
|
161
|
+
npx @cursor/july docs
|
|
162
|
+
agent-sdk docs [--port <n>] [--host 127.0.0.1] [--print]
|
|
151
163
|
```
|
|
152
164
|
|
|
153
|
-
`
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
newline-delimited messages until EOF. `--json` requires `--message`,
|
|
157
|
-
runs one turn, and prints
|
|
158
|
-
`{ ok, sessionId, continuationToken, trajectory }`. `--text` prints a
|
|
159
|
-
compact trajectory when combined with `--json`. `--no-color` forces
|
|
160
|
-
plain interactive output.
|
|
165
|
+
`docs` serves the bundled documentation without an agent project. It uses an
|
|
166
|
+
available loopback port by default and stays open until Ctrl-C. `--print`
|
|
167
|
+
prints the URL without opening a browser.
|
|
161
168
|
|
|
162
|
-
|
|
163
|
-
its continuation token when you omit `--continuation-token`. Use
|
|
164
|
-
`--resume` to select the most recently updated session with a
|
|
165
|
-
continuation token.
|
|
169
|
+
## Sessions and turns
|
|
166
170
|
|
|
167
|
-
|
|
171
|
+
### Chat with an agent {#chat}
|
|
168
172
|
|
|
169
|
-
`
|
|
173
|
+
`chat` connects to a running server and never starts an ephemeral one:
|
|
170
174
|
|
|
171
175
|
```bash
|
|
172
|
-
agent-sdk
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
agent-sdk resume ses_123 --message "Continue the review" --json
|
|
176
|
+
agent-sdk chat [--url <baseUrl> | --prod] [--message <text>]
|
|
177
|
+
[--session <id> | --resume] [--continuation-token <token>]
|
|
178
|
+
[--slug <slug>] [--team <id>] [--json] [--text] [--no-color]
|
|
176
179
|
```
|
|
177
180
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
| Input mode | Behavior |
|
|
182
|
+
| --- | --- |
|
|
183
|
+
| TTY without `--message` | Open an interactive REPL. |
|
|
184
|
+
| TTY with `--message` | Send the message, then keep the REPL open. |
|
|
185
|
+
| Non-TTY with `--message` | Send one turn and exit. |
|
|
186
|
+
| Non-TTY without `--message` | Read newline-delimited messages until EOF. |
|
|
187
|
+
| `--json --message <text>` | Send one turn and print `{ ok, sessionId, continuationToken, trajectory }`. |
|
|
188
|
+
| `--json --text --message <text>` | Print a compact trajectory instead of JSON. |
|
|
189
|
+
|
|
190
|
+
Use `--session <id>` to reattach a stored session. If you omit
|
|
191
|
+
`--continuation-token`, the CLI looks it up from the target's session list.
|
|
192
|
+
`--resume` selects the most recently updated session with a continuation
|
|
193
|
+
token. An explicit session ID takes precedence.
|
|
183
194
|
|
|
184
|
-
|
|
195
|
+
### Resume a session {#resume}
|
|
185
196
|
|
|
186
|
-
`
|
|
197
|
+
`resume` provides the same reattachment contract as `chat --session`:
|
|
187
198
|
|
|
188
199
|
```bash
|
|
189
|
-
agent-sdk
|
|
190
|
-
|
|
200
|
+
agent-sdk resume [sessionId] [--url <baseUrl> | --prod]
|
|
201
|
+
[--message <text>] [--json] [--text]
|
|
202
|
+
[--continuation-token <token>] [--slug <slug>] [--team <id>]
|
|
191
203
|
```
|
|
192
204
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
The command follows until Ctrl-C by default. `--once` prints the current
|
|
197
|
-
buffer and exits. `--json` emits newline-delimited JSON events.
|
|
205
|
+
Omit the session ID to select the most recently updated followable session.
|
|
206
|
+
The command replays the transcript before accepting follow-ups.
|
|
207
|
+
`resume --json` requires `--message`.
|
|
198
208
|
|
|
199
|
-
|
|
209
|
+
### Run turns {#run}
|
|
200
210
|
|
|
201
|
-
`
|
|
211
|
+
`run` sends messages to an ephemeral, running, or `--prod` target:
|
|
202
212
|
|
|
203
213
|
```bash
|
|
204
|
-
agent-sdk
|
|
205
|
-
|
|
214
|
+
agent-sdk run [--dir <path>] [--message <text>]...
|
|
215
|
+
[--messages-file <path>] [--url <baseUrl> | --prod]
|
|
216
|
+
[--session <id>] [--continuation-token <token>]
|
|
217
|
+
[--events <file> | --no-events] [--text]
|
|
218
|
+
[--timeout-ms <n>] [--no-stream] [--slug <slug>] [--team <id>]
|
|
219
|
+
[--dry-run] [--as-of <instant>] [--component <key>]
|
|
206
220
|
```
|
|
207
221
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
`
|
|
222
|
+
| Option | Contract |
|
|
223
|
+
| --- | --- |
|
|
224
|
+
| `--message <text>` | Send a user message. Repeat it for a multi-turn local or `--url` run. Managed starts accept one message. |
|
|
225
|
+
| `--messages-file <path>` | Read a JSON array of strings. File messages run before repeated `--message` values. |
|
|
226
|
+
| `--session <id>` | Continue a session. Managed session starts accept a hosted `ses_...` ID. |
|
|
227
|
+
| `--continuation-token <token>` | Continue the session selected by `--session` on a running server. Managed session starts use `--session` instead. |
|
|
228
|
+
| `--events <file>` | Write the raw NDJSON stream to this path. |
|
|
229
|
+
| `--no-events` | Skip the NDJSON trace. |
|
|
230
|
+
| `--text` | Print a compact trajectory instead of JSON. |
|
|
231
|
+
| `--timeout-ms <n>` | Stop waiting after a positive number of milliseconds. There is no default timeout. |
|
|
232
|
+
| `--no-stream` | Hide live tool and reply progress on stderr. |
|
|
233
|
+
| `--dry-run` | Mark a managed session turn as non-mutating. |
|
|
234
|
+
| `--as-of <instant>` | Freeze a managed session's clock at a timezone-bearing ISO-8601 instant. |
|
|
235
|
+
| `--component <key>` | Select a managed application's component instead of its default. |
|
|
236
|
+
|
|
237
|
+
For local and running-server targets, JSON output contains `ok`, `sessionId`,
|
|
238
|
+
`continuationToken`, `trace`, `playgroundUrl`, `playgroundHint`, `visualize`,
|
|
239
|
+
and `trajectory`. The `trace` value gives the saved path when event output is
|
|
240
|
+
enabled. A managed session start confirms acceptance; a continuation also
|
|
241
|
+
returns `sessionId`. Managed starts return before the turn finishes and ignore
|
|
242
|
+
`--events`, `--no-events`, `--text`, `--timeout-ms`, and `--no-stream`.
|
|
243
|
+
A successful managed start exits `0` on acceptance, before its turn outcome is
|
|
244
|
+
known. A fresh start doesn't return `sessionId` synchronously.
|
|
211
245
|
|
|
212
|
-
|
|
246
|
+
### Call a tool {#call}
|
|
213
247
|
|
|
214
|
-
`
|
|
248
|
+
`call` invokes a server tool without a model turn:
|
|
215
249
|
|
|
216
250
|
```bash
|
|
217
|
-
agent-sdk
|
|
218
|
-
|
|
219
|
-
|
|
251
|
+
agent-sdk call <tool> [--input <json>]
|
|
252
|
+
[--dir <path> | --url <baseUrl> | --prod]
|
|
253
|
+
[--session <id>] [--slug <slug>] [--team <id>]
|
|
220
254
|
```
|
|
221
255
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
256
|
+
`--input` accepts JSON and defaults to `{}`. `--session` uses the session
|
|
257
|
+
workspace and records the call on its event stream. The command prints the
|
|
258
|
+
server's JSON response and succeeds only when the HTTP response succeeds with
|
|
259
|
+
`ok: true`.
|
|
260
|
+
|
|
261
|
+
See [Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn) for validation,
|
|
262
|
+
busy-session behavior, and error codes.
|
|
229
263
|
|
|
230
|
-
|
|
264
|
+
### Read a skill {#skill}
|
|
231
265
|
|
|
232
|
-
`
|
|
266
|
+
`skill` reads an authored skill without a model turn:
|
|
233
267
|
|
|
234
268
|
```bash
|
|
235
|
-
agent-sdk
|
|
236
|
-
|
|
269
|
+
agent-sdk skill <name> [--dir <path> | --url <baseUrl> | --prod]
|
|
270
|
+
[--slug <slug>] [--team <id>] [--text]
|
|
237
271
|
```
|
|
238
272
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
the target plus a total. Costs are the engine's recorded estimates from
|
|
242
|
-
`turn.completed` events; turns persisted before cost tracking count as
|
|
243
|
-
unpriced. `--json` prints the underlying report, or `{ sessions }` when
|
|
244
|
-
aggregating. Like `session`, the command supports `--dir`,
|
|
245
|
-
`--bearer-token`, and the `--url`/`--prod` targets, and defaults to the
|
|
246
|
-
local server.
|
|
247
|
-
|
|
248
|
-
## playground
|
|
273
|
+
The default output is the server's JSON response. `--text` prints the rendered
|
|
274
|
+
`SKILL.md` content.
|
|
249
275
|
|
|
250
|
-
|
|
276
|
+
### List sessions {#sessions}
|
|
251
277
|
|
|
252
278
|
```bash
|
|
253
|
-
agent-sdk
|
|
254
|
-
|
|
255
|
-
[--bearer-token <token>] [--print]
|
|
279
|
+
agent-sdk sessions [--url <baseUrl> | --prod]
|
|
280
|
+
[--slug <slug>] [--team <id>] [--bearer-token <token>] [--json]
|
|
256
281
|
```
|
|
257
282
|
|
|
258
|
-
|
|
259
|
-
|
|
283
|
+
Text output shows the session ID, channel, mode, turn count, running status,
|
|
284
|
+
and update time. `--json` prints `{ sessions }`, including continuation
|
|
285
|
+
tokens.
|
|
260
286
|
|
|
261
|
-
|
|
262
|
-
exits. `--prod` and `--bearer-token` start a loopback proxy to inject
|
|
263
|
-
browser-inaccessible credentials. The proxy stays open until Ctrl-C,
|
|
264
|
-
including when you pass `--print`.
|
|
287
|
+
### Inspect a session {#session}
|
|
265
288
|
|
|
266
|
-
|
|
289
|
+
```bash
|
|
290
|
+
agent-sdk session <sessionId> [--url <baseUrl> | --prod]
|
|
291
|
+
[--slug <slug>] [--team <id>]
|
|
292
|
+
[--json | --text | --events] [--out <file.ndjson>]
|
|
293
|
+
|
|
294
|
+
agent-sdk session --prod [<sessionId>] --slug <slug> --message <text>
|
|
295
|
+
[--dry-run] [--as-of <instant>] [--component <key>]
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
| Option | Contract |
|
|
299
|
+
| --- | --- |
|
|
300
|
+
| No output option | Print a compact trajectory. |
|
|
301
|
+
| `--text` | Select the compact trajectory explicitly. |
|
|
302
|
+
| `--json` | Print the trajectory object. |
|
|
303
|
+
| `--events` | Print `{ sessionId, events }` with the raw event list. |
|
|
304
|
+
| `--out <file.ndjson>` | Write the raw NDJSON trace instead of printing it. |
|
|
305
|
+
| `--prod --message <text>` | Start a managed session or continue the supplied managed session ID. |
|
|
267
306
|
|
|
268
|
-
`
|
|
269
|
-
|
|
307
|
+
`--events` and `--json` are mutually exclusive. Managed sessions without an
|
|
308
|
+
event trajectory return hosted execution status and logs in text or JSON;
|
|
309
|
+
`--events` and `--out` require an event trajectory. Use [`resume`](#resume) to
|
|
310
|
+
continue a conversational session.
|
|
311
|
+
|
|
312
|
+
### Follow logs {#logs}
|
|
270
313
|
|
|
271
314
|
```bash
|
|
272
|
-
|
|
273
|
-
|
|
315
|
+
agent-sdk logs [--url <baseUrl> | --prod]
|
|
316
|
+
[--slug <slug>] [--team <id>] [--once] [--json]
|
|
274
317
|
```
|
|
275
318
|
|
|
276
|
-
The
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
the URL without opening a browser.
|
|
280
|
-
|
|
281
|
-
## run
|
|
319
|
+
The command follows logs until Ctrl-C. `--once` prints the current buffer and
|
|
320
|
+
exits; `--json` emits newline-delimited JSON events. A hosted deployment
|
|
321
|
+
reports deployment progress before runtime logs become available.
|
|
282
322
|
|
|
283
|
-
|
|
323
|
+
### Report costs {#cost}
|
|
284
324
|
|
|
285
325
|
```bash
|
|
286
|
-
agent-sdk
|
|
287
|
-
|
|
288
|
-
agent-sdk run --url http://127.0.0.1:3000/pr-approver --message "Inspect PR 42"
|
|
289
|
-
agent-sdk run --prod --slug pr-approver --team 123 --message "Inspect PR 42"
|
|
290
|
-
agent-sdk run --dir . --messages-file ./prompts.json
|
|
326
|
+
agent-sdk cost [sessionId] [--url <baseUrl> | --prod]
|
|
327
|
+
[--slug <slug>] [--team <id>] [--json]
|
|
291
328
|
```
|
|
292
329
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
330
|
+
With a session ID, `cost` prints per-turn token usage and estimated cost.
|
|
331
|
+
Without one, it prints one row per session and a total. Turns saved before
|
|
332
|
+
cost tracking appear as unpriced. `--json` prints the underlying report or
|
|
333
|
+
`{ sessions }` for an aggregate.
|
|
297
334
|
|
|
298
|
-
|
|
299
|
-
| --- | --- |
|
|
300
|
-
| `--message <text>` | Send a user message. Repeat the flag for a multi-turn run. |
|
|
301
|
-
| `--messages-file <path>` | Read a JSON array of strings. File messages run before repeated `--message` values. |
|
|
302
|
-
| `--session <id>` | Follow up an existing session. Unlike `chat`, `run` doesn't look up a missing continuation token. |
|
|
303
|
-
| `--continuation-token <token>` | Continue the existing session selected by `--session`. |
|
|
304
|
-
| `--events <file>` | Write the raw NDJSON event stream to this path. |
|
|
305
|
-
| `--no-events` | Don't write an event stream. |
|
|
306
|
-
| `--text` | Print a compact trajectory instead of the JSON result. |
|
|
307
|
-
| `--timeout-ms <n>` | Abort the turn after a positive number of milliseconds. There is no default timeout. |
|
|
308
|
-
| `--no-stream` | Hide live tool and reply progress on stderr. Progress is on by default when stderr is a TTY. |
|
|
309
|
-
| `--slug <slug>` | Pick one agent when local discovery mounts several agents. With `--prod`, select the hosted deployment. |
|
|
310
|
-
|
|
311
|
-
The default trace path is
|
|
312
|
-
`<state-root>/traces/<sessionId>.ndjson`. JSON output contains
|
|
313
|
-
`ok`, `sessionId`, `continuationToken`, `trace`, `playgroundUrl`,
|
|
314
|
-
`playgroundHint`, `visualize`, and `trajectory`. The command exits
|
|
315
|
-
non-zero when the trajectory fails.
|
|
316
|
-
|
|
317
|
-
## call
|
|
318
|
-
|
|
319
|
-
`call` invokes a server tool directly, with no model turn.
|
|
320
|
-
|
|
321
|
-
```bash
|
|
322
|
-
agent-sdk call inspect_pr --dir . \
|
|
323
|
-
--input '{"prUrl":"https://github.com/acme/checkout/pull/42"}'
|
|
324
|
-
agent-sdk call inspect_pr --url http://127.0.0.1:3000/pr-approver \
|
|
325
|
-
--input '{"prUrl":"https://github.com/acme/checkout/pull/42"}'
|
|
326
|
-
agent-sdk call refresh_cache --url http://127.0.0.1:3000/pr-approver \
|
|
327
|
-
--session ses_123
|
|
328
|
-
agent-sdk call inspect_pr --prod --slug pr-approver --team 123 --input '{}'
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
`call` sends `POST /v1/tools/:toolName` and runs the tool in the serving
|
|
332
|
-
process without a model turn. `--input` accepts any valid JSON and
|
|
333
|
-
defaults to `{}`. Tools with a Zod input schema validate and transform
|
|
334
|
-
the value before execution. A local call needs no inference credential.
|
|
335
|
-
A hosted call still needs Cursor credentials to reach the deployment.
|
|
336
|
-
|
|
337
|
-
`--session` runs the tool inside an existing session and records it on
|
|
338
|
-
the event stream. If a model turn is active or pending, a read-effect
|
|
339
|
-
tool runs alongside it and a write-effect tool gets `session_busy`;
|
|
340
|
-
retry after the turn finishes. The command
|
|
341
|
-
prints the server's JSON response and exits non-zero unless the HTTP
|
|
342
|
-
response succeeds with `ok: true`. See
|
|
343
|
-
[Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn).
|
|
344
|
-
|
|
345
|
-
## eval
|
|
346
|
-
|
|
347
|
-
`eval` runs the project's filesystem evals.
|
|
348
|
-
|
|
349
|
-
```bash
|
|
350
|
-
agent-sdk eval --dir . --list # discovered datapoints
|
|
351
|
-
agent-sdk eval --dir . # run all
|
|
352
|
-
agent-sdk eval --dir . builds/checkout # one datapoint
|
|
353
|
-
agent-sdk eval --dir . builds # every datapoint in the file
|
|
354
|
-
agent-sdk eval --dir . --tag smoke # by tag (repeatable)
|
|
355
|
-
agent-sdk eval --dir . --json # machine-readable results
|
|
356
|
-
agent-sdk eval --dir . --verbose # stream t.log lines + reply snippets
|
|
357
|
-
agent-sdk eval --prod --slug pr-approver --team 123
|
|
358
|
-
# prints Eval ID immediately on --prod/--url; then:
|
|
359
|
-
agent-sdk eval status <evalId> --prod --slug pr-approver
|
|
360
|
-
agent-sdk eval cancel <evalId> --prod --slug pr-approver
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
`eval` runs `evals/**/*.eval.{ts,js}` on an ephemeral server. With
|
|
364
|
-
`--prod` or `--url`, the target server runs its own evals as a
|
|
365
|
-
server-side batch. Select one or more exact case IDs, file ID prefixes,
|
|
366
|
-
or tags.
|
|
367
|
-
Omit selectors to run all cases. Repeated `--tag` flags use OR matching.
|
|
368
|
-
|
|
369
|
-
An eval run requires `evals/evals.config.{ts,js}` with `maxConcurrency`
|
|
370
|
-
between 1 and 200. Timeout priority is the case's `timeoutMs`, the CLI's
|
|
371
|
-
`--timeout-ms`, the config's `timeoutMs`, then 180 seconds.
|
|
372
|
-
|
|
373
|
-
| Flag | Meaning |
|
|
374
|
-
| --- | --- |
|
|
375
|
-
| `--list` | Print discovered cases without running. `--list --json` prints them as an array. |
|
|
376
|
-
| `--tag <tag>` | Run cases with this tag. Repeated flags use OR matching. |
|
|
377
|
-
| `--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. |
|
|
378
|
-
| `--verbose` | Stream `t.log` lines and reply snippets. |
|
|
379
|
-
| `--no-stream` | Hide live progress on stderr. |
|
|
380
|
-
| `--strict` | Exit `1` when a scored case misses a soft threshold. |
|
|
381
|
-
| `--max-concurrency <n>` | Override `maxConcurrency` from `evals.config.ts`. |
|
|
382
|
-
| `--junit <path>` | Write JUnit XML for CI annotations. |
|
|
383
|
-
| `--artifacts <dir>` | Write run artifacts here. The default is a timestamped directory under `evals/` in the project state directory (not affected by `--state-root`). |
|
|
384
|
-
| `--no-artifacts` | Skip run artifacts. |
|
|
385
|
-
| `--skip-report` | Ignore reporters from `evals.config.ts` and eval files. |
|
|
386
|
-
| `--out <path>` | Also write the full results JSON to this path (also for `eval status <evalId>`). |
|
|
387
|
-
| `--no-wait` | Return with the Eval ID as soon as a `--prod` or `--url` batch is accepted. |
|
|
388
|
-
| `--timeout-ms <n>` | Per-case timeout override. |
|
|
335
|
+
### Open the playground {#playground}
|
|
389
336
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
337
|
+
```bash
|
|
338
|
+
agent-sdk playground [--url <baseUrl> | --prod] [--session <id>]
|
|
339
|
+
[--slug <slug>] [--team <id>] [--bearer-token <token>] [--print]
|
|
340
|
+
```
|
|
393
341
|
|
|
394
|
-
|
|
342
|
+
The command prints the playground URL and opens it unless `--print` is set.
|
|
343
|
+
`--session` opens a deep link. A running target with credentials that a
|
|
344
|
+
browser can't send starts a loopback proxy and stays open until Ctrl-C.
|
|
395
345
|
|
|
396
|
-
|
|
346
|
+
### Inspect a trajectory {#trajectory}
|
|
397
347
|
|
|
398
348
|
```bash
|
|
399
|
-
agent-sdk trajectory --events
|
|
349
|
+
agent-sdk trajectory --events <file.ndjson> [--text]
|
|
400
350
|
```
|
|
401
351
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
non-zero when the reconstructed trajectory failed.
|
|
352
|
+
The command converts an NDJSON stream into the trajectory JSON returned by
|
|
353
|
+
`run`. `--text` prints the compact view.
|
|
405
354
|
|
|
406
|
-
##
|
|
355
|
+
## Evals
|
|
407
356
|
|
|
408
|
-
|
|
357
|
+
### Run evals {#eval}
|
|
358
|
+
|
|
359
|
+
`eval` discovers `evals/**/*.eval.{ts,js}` and runs selected cases:
|
|
409
360
|
|
|
410
361
|
```bash
|
|
411
|
-
agent-sdk
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
agent-sdk init ./thermo-quality --template thermo-quality-review # review PRs for code quality
|
|
419
|
-
agent-sdk init ./security-help --template security-help # answer security questions in Slack
|
|
420
|
-
agent-sdk init ./my-triage --template triage-linear # comment on Linear issues
|
|
421
|
-
agent-sdk init ./my-triage --template triage-jira # comment on Jira issues
|
|
422
|
-
agent-sdk init ./my-owners --template agentic-owners # review PRs via owners policies
|
|
423
|
-
agent-sdk init ./pr-autofixer --template pr-autofixer # fix PRs on a cloud VM
|
|
424
|
-
agent-sdk init ./pr-autofixer --template pr-autofixer \
|
|
425
|
-
--var repos=acme/widgets,acme/api --json
|
|
426
|
-
agent-sdk init ./my-agent --json # machine-readable summary for tooling
|
|
427
|
-
agent-sdk init # no directory: print the setup guide
|
|
362
|
+
agent-sdk eval [--dir <path>] [evalId...]
|
|
363
|
+
[--list] [--tag <tag>]... [--json] [--verbose]
|
|
364
|
+
[--timeout-ms <n>] [--strict] [--max-concurrency <n>]
|
|
365
|
+
[--junit <path>] [--artifacts <dir> | --no-artifacts]
|
|
366
|
+
[--skip-report] [--out <file.json>] [--no-stream]
|
|
367
|
+
[--url <baseUrl> | --prod] [--no-wait]
|
|
368
|
+
[--slug <slug>] [--team <id>]
|
|
428
369
|
```
|
|
429
370
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
371
|
+
Select an exact case such as `weather/nyc`, a file prefix such as `weather`,
|
|
372
|
+
several IDs, or no IDs for every case. Repeat `--tag` for OR matching.
|
|
373
|
+
Projects must provide `evals/evals.config.{ts,js}` with `maxConcurrency`
|
|
374
|
+
between 1 and 200.
|
|
433
375
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
`
|
|
437
|
-
|
|
438
|
-
`--
|
|
439
|
-
`--
|
|
376
|
+
| Option | Contract |
|
|
377
|
+
| --- | --- |
|
|
378
|
+
| `--list` | List matching cases without running them. `--list --json` prints an array. |
|
|
379
|
+
| `--tag <tag>` | Select a tag. Repeat the option for OR matching. |
|
|
380
|
+
| `--json` | Print `{ ok, passed, failed, scored, skipped, strict, results }`. |
|
|
381
|
+
| `--verbose` | Stream `t.log` lines and reply snippets. |
|
|
382
|
+
| `--no-stream` | Hide live progress on stderr. |
|
|
383
|
+
| `--strict` | Treat a scored case below its soft threshold as a failure. |
|
|
384
|
+
| `--max-concurrency <n>` | Override `maxConcurrency` from the eval config for an ephemeral local run. |
|
|
385
|
+
| `--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. |
|
|
386
|
+
| `--junit <path>` | Write JUnit XML for an ephemeral local run. |
|
|
387
|
+
| `--artifacts <dir>` | Select the artifact directory for an ephemeral local run. The default is a timestamped directory under the project's state directory. |
|
|
388
|
+
| `--no-artifacts` | Skip artifacts for an ephemeral local run. |
|
|
389
|
+
| `--skip-report` | Ignore reporters from eval files and the eval config during an ephemeral local run. |
|
|
390
|
+
| `--out <file.json>` | Also write the full result JSON. |
|
|
391
|
+
| `--no-wait` | Return after a running server or hosted deployment accepts the batch. |
|
|
440
392
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
bodies), so this prompt is a chance to overwrite with the package
|
|
445
|
-
version. The prompt is skipped for `--json` and non-interactive hosts.
|
|
393
|
+
A running server or hosted deployment prints its Eval ID when it accepts the
|
|
394
|
+
batch.
|
|
395
|
+
Use these commands to inspect or cancel it:
|
|
446
396
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
397
|
+
```bash
|
|
398
|
+
agent-sdk eval status [evalId] --prod [--slug <slug>] [--team <id>]
|
|
399
|
+
agent-sdk eval status [evalId] --url <baseUrl>
|
|
400
|
+
agent-sdk eval cancel <evalId> --prod [--slug <slug>] [--team <id>]
|
|
401
|
+
agent-sdk eval cancel <evalId> --url <baseUrl>
|
|
402
|
+
```
|
|
450
403
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
`next` list includes `login` when the host is unsigned.
|
|
404
|
+
`eval status` without an ID lists recent remote runs. `eval status --out`
|
|
405
|
+
requires an ID. The `status` and `cancel` subcommands require `--url` or
|
|
406
|
+
`--prod`.
|
|
455
407
|
|
|
456
|
-
##
|
|
408
|
+
## Projects
|
|
457
409
|
|
|
458
|
-
|
|
410
|
+
### Scaffold a project {#init}
|
|
459
411
|
|
|
460
412
|
```bash
|
|
461
|
-
agent-sdk
|
|
413
|
+
agent-sdk init [directory] [--template <name>] [--var id=value]... [--json]
|
|
462
414
|
```
|
|
463
415
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
416
|
+
Without a directory, `init` prints the setup guide and changes no files. With
|
|
417
|
+
a directory, it preserves existing scaffold files, adds missing files,
|
|
418
|
+
installs dependencies, and tries to put `agent-sdk` on `PATH`.
|
|
419
|
+
|
|
420
|
+
| Option | Contract |
|
|
421
|
+
| --- | --- |
|
|
422
|
+
| `--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`. |
|
|
423
|
+
| `--var id=value` | Answer a template question without a prompt. Repeat for multiple answers. |
|
|
424
|
+
| `--json` | Skip interactive login and skill prompts, then print `{ ok, directory, template, created, skipped, installed, installError, cliOnPath, cliLinkError, next }`. `ok` reflects dependency installation. |
|
|
471
425
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
service account; authorize each generated connection with
|
|
476
|
-
[`mcp oauth`](#mcp-oauth) after the first deploy. Review the generated
|
|
477
|
-
project, then run `validate` and `dev`.
|
|
426
|
+
On a TTY, templates with questions run their interview before writing files.
|
|
427
|
+
`init` also offers to refresh the bundled coding-agent skills and starts login
|
|
428
|
+
when the host has no Cursor credential.
|
|
478
429
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
430
|
+
### Convert an Automation {#convert-automation}
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
agent-sdk convert-automation <url-or-uuid> [--dir <path>] [--json]
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
The input can be a Cursor Automation dashboard URL or its UUID. The output
|
|
437
|
+
directory defaults to `./<automation-name>`. Generated files don't overwrite
|
|
438
|
+
existing paths, and missing scaffold files are added. The following
|
|
439
|
+
`npm install` can update lockfiles and run lifecycle scripts from an existing
|
|
440
|
+
`package.json`.
|
|
482
441
|
|
|
483
442
|
`--json` prints
|
|
484
443
|
`{ ok, directory, files, warnings, setupSteps, installed, installError, mcpConnections }`.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
The [Convert a Cursor Automation](/docs/guides/convert-automation.md) guide
|
|
489
|
-
covers generated files and behavior the converter cannot reproduce.
|
|
444
|
+
Conversion warnings and dependency-install failures remain visible in this
|
|
445
|
+
output without failing a completed file conversion. Invalid input,
|
|
446
|
+
authentication, export, and file-write failures exit nonzero.
|
|
490
447
|
|
|
491
|
-
|
|
448
|
+
See [Convert a Cursor Automation](/docs/guides/convert-automation.md) for the
|
|
449
|
+
generated project and features that need manual review.
|
|
492
450
|
|
|
493
|
-
|
|
494
|
-
`~/.cursor/skills/agentsdk/` with `alwaysApply: true` so Cursor loads
|
|
495
|
-
them as global rules. Installing `@cursor/july` already does this in
|
|
496
|
-
postinstall (`npm install`, `npx`, a version bump). Use this command
|
|
497
|
-
to refresh without reinstalling the package, or from a monorepo
|
|
498
|
-
source checkout (postinstall skips that tree).
|
|
451
|
+
### Install coding-agent skills {#install-skills}
|
|
499
452
|
|
|
500
453
|
```bash
|
|
501
454
|
agent-sdk install-skills [--print] [--json]
|
|
502
455
|
```
|
|
503
456
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
previews the skills, the removals, and the install path without writing
|
|
508
|
-
anything. `--json` prints
|
|
457
|
+
The command replaces the installed Agent SDK skills under
|
|
458
|
+
`~/.cursor/skills/agentsdk/` with the package copy and removes stale bundled
|
|
459
|
+
skills. `--print` previews the change. `--json` prints
|
|
509
460
|
`{ ok, dryRun, directory, firstInstall, skills, removed }`.
|
|
510
461
|
|
|
511
|
-
|
|
512
|
-
`
|
|
462
|
+
Package installation already performs this copy. Set
|
|
463
|
+
`CURSOR_JULY_SKIP_SKILL_INSTALL=1` to skip that install hook, or set
|
|
464
|
+
`CURSOR_JULY_SKILLS_HOME` to choose another skills directory.
|
|
513
465
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
`info` prints the discovered agent surface.
|
|
466
|
+
### Inspect a project {#info}
|
|
517
467
|
|
|
518
468
|
```bash
|
|
519
|
-
agent-sdk info --dir
|
|
469
|
+
agent-sdk info [--dir <path>] [--json]
|
|
520
470
|
```
|
|
521
471
|
|
|
522
|
-
|
|
523
|
-
connections, subagents,
|
|
524
|
-
diagnostics.
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
472
|
+
Text output lists the model, instructions, tools, skills, extensions,
|
|
473
|
+
connections, subagents, channels, schedules, hooks, hosting settings, and
|
|
474
|
+
diagnostics. For one unslugged project, `--json` prints its project info
|
|
475
|
+
object. For slugged or multi-agent discovery, it prints `{ agents }`.
|
|
476
|
+
|
|
477
|
+
### Validate a project {#validate}
|
|
528
478
|
|
|
529
|
-
|
|
479
|
+
```bash
|
|
480
|
+
agent-sdk validate [--dir <path>]
|
|
481
|
+
```
|
|
530
482
|
|
|
531
|
-
`validate`
|
|
483
|
+
`validate` prints every discovered project's diagnostics and exits nonzero
|
|
484
|
+
when any diagnostic has error severity. Use it instead of `info --json` when a
|
|
485
|
+
script needs validation status.
|
|
486
|
+
|
|
487
|
+
### Print a deployment manifest {#manifest}
|
|
532
488
|
|
|
533
489
|
```bash
|
|
534
|
-
agent-sdk
|
|
490
|
+
agent-sdk manifest [--dir <path>] [--json]
|
|
535
491
|
```
|
|
536
492
|
|
|
537
|
-
`
|
|
538
|
-
|
|
539
|
-
|
|
493
|
+
`manifest` validates one project and prints its deployment metadata without a
|
|
494
|
+
network request. Default output is indented JSON; `--json` prints one compact
|
|
495
|
+
line.
|
|
540
496
|
|
|
541
|
-
##
|
|
497
|
+
## Credentials and versions
|
|
542
498
|
|
|
543
|
-
|
|
499
|
+
### Manage credentials {#login-logout-whoami}
|
|
544
500
|
|
|
545
501
|
```bash
|
|
546
502
|
agent-sdk login [--api-key <key>] [--key-name <name>]
|
|
@@ -548,418 +504,394 @@ agent-sdk whoami [--json]
|
|
|
548
504
|
agent-sdk logout
|
|
549
505
|
```
|
|
550
506
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
key you already created.
|
|
507
|
+
| Command | Contract |
|
|
508
|
+
| --- | --- |
|
|
509
|
+
| `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. |
|
|
510
|
+
| `whoami` | Show the active credential and its source. `--json` returns the same identity as JSON. |
|
|
511
|
+
| `logout` | Remove the stored credential file. It doesn't revoke the API key; revoke the key in the Cursor dashboard. |
|
|
557
512
|
|
|
558
|
-
|
|
559
|
-
wins, then `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default
|
|
560
|
-
`/run/cursor/secrets/CURSOR_API_KEY` when unset), then
|
|
561
|
-
`CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login. A host that has
|
|
562
|
-
both the service-account key and a bind file authenticates as the file
|
|
563
|
-
principal. `logout` removes the local credential file but doesn't
|
|
564
|
-
revoke the API key. Revoke it in the Cursor dashboard when it should
|
|
565
|
-
stop working.
|
|
513
|
+
### Print the version {#version}
|
|
566
514
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
515
|
+
```bash
|
|
516
|
+
agent-sdk version [--json]
|
|
517
|
+
agent-sdk --version
|
|
518
|
+
agent-sdk -V
|
|
519
|
+
```
|
|
570
520
|
|
|
571
|
-
|
|
521
|
+
Text output is the version number. `--json` prints
|
|
522
|
+
`{ name, version }`.
|
|
572
523
|
|
|
573
|
-
|
|
524
|
+
### Update the CLI {#update}
|
|
574
525
|
|
|
575
526
|
```bash
|
|
576
527
|
agent-sdk update
|
|
577
528
|
```
|
|
578
529
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
running the package-manager command.
|
|
583
|
-
|
|
584
|
-
Source checkouts, `npx` or `pnpm dlx` caches, and unknown install layouts
|
|
585
|
-
aren't changed. The command prints a manual upgrade hint instead.
|
|
530
|
+
`update` checks npm's `latest` tag and upgrades a recognized global or project
|
|
531
|
+
install with its package manager. If it can't identify an installed copy, it
|
|
532
|
+
prints a manual upgrade command instead.
|
|
586
533
|
|
|
587
|
-
Published installs
|
|
588
|
-
|
|
589
|
-
|
|
534
|
+
Published installs check for updates at most once every 24 hours. Set
|
|
535
|
+
`AGENT_SERVE_NO_UPDATE_CHECK`, `NO_UPDATE_NOTIFIER`, or `CI` to disable the
|
|
536
|
+
automatic warning.
|
|
590
537
|
|
|
591
|
-
##
|
|
538
|
+
## Managed hosting
|
|
592
539
|
|
|
593
|
-
|
|
540
|
+
### Deploy agents {#deploy}
|
|
594
541
|
|
|
595
542
|
```bash
|
|
596
543
|
agent-sdk deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
the
|
|
612
|
-
|
|
613
|
-
`--
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
returns after the deployment request is accepted. Multi-agent deploys
|
|
630
|
-
run sequentially. When several agents are selected, `--path` is ignored
|
|
631
|
-
and each project infers its own path. A single-target `--json` run
|
|
632
|
-
prints one object; a multi-target run prints an array.
|
|
633
|
-
|
|
634
|
-
The first deployment can return an alias token. It appears once in text
|
|
635
|
-
or JSON output and can't be retrieved later. Store it as a secret. Send
|
|
636
|
-
it as `X-Agent-Alias-Token` when calling the stable alias URL, or use it
|
|
637
|
-
to sign in to the hosted playground.
|
|
638
|
-
|
|
639
|
-
See [Deployment](/docs/deployment.md) for the hosting security model and
|
|
640
|
-
state layout.
|
|
641
|
-
|
|
642
|
-
## deployments
|
|
643
|
-
|
|
644
|
-
`deployments` lists the selected team's deployments.
|
|
544
|
+
[--repo <https-url>] [--ref <git-ref>] [--path <agent-path>]
|
|
545
|
+
[--cursor-events-repo <owner/name>]...
|
|
546
|
+
[--allow-domain <domain>]... [--no-wait] [--json]
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
Managed hosting requires a team with agent hosting enabled. A team
|
|
550
|
+
service-account API key with agent access can deploy.
|
|
551
|
+
|
|
552
|
+
| Option | Contract |
|
|
553
|
+
| --- | --- |
|
|
554
|
+
| `--slug <slug>` | Select one project and set its deployment slug. |
|
|
555
|
+
| `--all` | Deploy every child project under a multi-agent `--dir`. Mutually exclusive with `--slug`. |
|
|
556
|
+
| `--team <id>` | Select the Cursor team. |
|
|
557
|
+
| `--repo <https-url>` | Set the source repository. The CLI infers it from the current checkout when possible. HTTPS is required. |
|
|
558
|
+
| `--ref <git-ref>` | Set the source Git ref. The CLI infers the current branch when possible. |
|
|
559
|
+
| `--path <agent-path>` | Set the project path relative to the repository root. |
|
|
560
|
+
| `--cursor-events-repo <owner/name>` | Add a repository whose SCM events reach the deployment. Repeat for multiple repositories. |
|
|
561
|
+
| `--allow-domain <domain>` | Add an egress hostname. Repeat for multiple domains; values are combined with `hosting.egressDomains`. |
|
|
562
|
+
| `--no-wait` | Return after the deployment request is accepted. |
|
|
563
|
+
| `--json` | Print one object for one target or an array for multiple targets. |
|
|
564
|
+
|
|
565
|
+
Deployment slugs contain lowercase letters, digits, `_`, or `-`, start with a
|
|
566
|
+
letter or digit, and have at most 64 characters. Egress entries are lowercase
|
|
567
|
+
hostnames with an alphabetic top-level domain; one leading `*.` wildcard is
|
|
568
|
+
allowed, with at most 20 entries.
|
|
569
|
+
|
|
570
|
+
By default, `deploy` waits until the deployment is running and exits nonzero
|
|
571
|
+
if it reaches a failed state. A first deployment can return an alias token
|
|
572
|
+
once. Store it as a secret and send it as `X-Agent-Alias-Token` when calling
|
|
573
|
+
the stable alias URL.
|
|
574
|
+
|
|
575
|
+
### List deployments {#deployments}
|
|
645
576
|
|
|
646
577
|
```bash
|
|
647
578
|
agent-sdk deployments [--team <id>] [--json]
|
|
648
579
|
```
|
|
649
580
|
|
|
650
|
-
Text output shows
|
|
651
|
-
|
|
581
|
+
Text output shows slug, status, generation, kind, and update time. `--json`
|
|
582
|
+
prints `{ deployments }` and may also include `applications`. An empty list
|
|
583
|
+
succeeds.
|
|
652
584
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
`deployment` prints the full status of one deployment.
|
|
585
|
+
### Inspect a deployment {#deployment}
|
|
656
586
|
|
|
657
587
|
```bash
|
|
658
588
|
agent-sdk deployment <slug> [--team <id>] [--json]
|
|
659
589
|
```
|
|
660
590
|
|
|
661
|
-
Text output includes status,
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
591
|
+
Text output includes status, source, routes, secret names, egress domains, and
|
|
592
|
+
the latest error. `--json` can include short-lived access headers, so handle
|
|
593
|
+
its output as a credential.
|
|
594
|
+
|
|
595
|
+
### Stop a deployment {#stop}
|
|
596
|
+
|
|
597
|
+
```bash
|
|
598
|
+
agent-sdk stop <slug> [--team <id>] [--no-wait] [--cancel-runs] [--json]
|
|
599
|
+
```
|
|
665
600
|
|
|
666
|
-
|
|
601
|
+
The command waits for `stopped` by default. `--no-wait` returns after the
|
|
602
|
+
request is accepted. `--cancel-runs` also requests cancellation of active
|
|
603
|
+
runs and reminder wakes for a managed application. Other deployment types
|
|
604
|
+
reject this option.
|
|
667
605
|
|
|
668
|
-
|
|
606
|
+
### Cancel active runs {#cancel-runs}
|
|
669
607
|
|
|
670
608
|
```bash
|
|
671
|
-
agent-sdk
|
|
609
|
+
agent-sdk cancel-runs <slug> [--team <id>] [--json]
|
|
672
610
|
```
|
|
673
611
|
|
|
674
|
-
The command
|
|
675
|
-
|
|
612
|
+
The command requests cancellation for a managed application's active runs and
|
|
613
|
+
reminder wakes. Other deployment types reject it. For a multi-tenant
|
|
614
|
+
application, this cancels every install; use `stop --cancel-runs` for
|
|
615
|
+
install-local cancellation. It exits nonzero if any cancellation request fails
|
|
616
|
+
to start.
|
|
617
|
+
|
|
618
|
+
### Replace event repositories {#event-repos}
|
|
619
|
+
|
|
620
|
+
```bash
|
|
621
|
+
agent-sdk event-repos <slug> [--repo <owner/name>]...
|
|
622
|
+
[--team <id>] [--json]
|
|
623
|
+
```
|
|
676
624
|
|
|
677
|
-
|
|
625
|
+
The supplied repositories replace the managed application's complete event
|
|
626
|
+
repository list; they aren't merged with the previous list. Omit `--repo` to
|
|
627
|
+
clear the list.
|
|
678
628
|
|
|
679
|
-
|
|
680
|
-
still runs. The command frees the slug. A later deploy can use the same
|
|
681
|
-
name. Spend stays on the archived service account.
|
|
629
|
+
### Upgrade a managed application {#upgrade}
|
|
682
630
|
|
|
683
631
|
```bash
|
|
684
|
-
agent-sdk
|
|
632
|
+
agent-sdk upgrade <slug> [--release <id-or-version>]
|
|
633
|
+
[--team <id>] [--json]
|
|
685
634
|
```
|
|
686
635
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
636
|
+
`--release` accepts a release ID or version. Omit it to select the newest
|
|
637
|
+
ready release. `--json` prints `{ releaseId }`.
|
|
638
|
+
|
|
639
|
+
### Delete a deployment {#delete}
|
|
690
640
|
|
|
691
|
-
|
|
641
|
+
```bash
|
|
642
|
+
agent-sdk delete <slug> [--team <id>] [--no-wait] [--json]
|
|
643
|
+
```
|
|
692
644
|
|
|
693
|
-
`
|
|
694
|
-
|
|
645
|
+
`delete` removes the deployment and frees its slug. It waits until the
|
|
646
|
+
deployment is gone unless `--no-wait` is set.
|
|
647
|
+
|
|
648
|
+
### Rotate an alias token {#rotate-token}
|
|
695
649
|
|
|
696
650
|
```bash
|
|
697
651
|
agent-sdk rotate-token <slug> [--team <id>] [--json]
|
|
698
652
|
```
|
|
699
653
|
|
|
700
|
-
The old token stops working immediately. The replacement
|
|
654
|
+
The old token stops working immediately. The replacement appears once;
|
|
701
655
|
`--json` prints `{ aliasToken }`.
|
|
702
656
|
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
`mcp` proxies an agent's MCP endpoint over stdio for MCP clients that
|
|
706
|
-
spawn local servers, such as Cursor.
|
|
657
|
+
### Manage deployment secrets {#secrets}
|
|
707
658
|
|
|
708
659
|
```bash
|
|
709
|
-
agent-sdk
|
|
710
|
-
|
|
711
|
-
agent-sdk
|
|
712
|
-
|
|
660
|
+
agent-sdk secrets set <slug> NAME [NAME2 ...]
|
|
661
|
+
[--team <id>] [--from-argv] [--json]
|
|
662
|
+
agent-sdk secrets list <slug> [--team <id>] [--json]
|
|
663
|
+
agent-sdk secrets unset <slug> NAME [--team <id>] [--json]
|
|
713
664
|
```
|
|
714
665
|
|
|
715
|
-
|
|
716
|
-
one
|
|
717
|
-
`--
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
666
|
+
Pass secret names to `set`. On a TTY, the CLI prompts for hidden values; with
|
|
667
|
+
piped input, provide one line per name. It rejects `NAME=VALUE` arguments
|
|
668
|
+
unless `--from-argv` is set because command-line values can enter shell
|
|
669
|
+
history and captured terminals.
|
|
670
|
+
|
|
671
|
+
Names use `UPPER_SNAKE_CASE`, start with a letter, and contain at most 64
|
|
672
|
+
characters. Names beginning with `CURSOR_` are reserved. Values contain at
|
|
673
|
+
most 4096 bytes, and each deployment holds at most 32 secrets.
|
|
674
|
+
|
|
675
|
+
`list` returns names and creation times, never values. JSON output is
|
|
676
|
+
`{ secretNames }` for `set`, `{ secrets }` for `list`, and `{ removed }` for
|
|
677
|
+
`unset`. Changes are available to subsequent hosted work.
|
|
721
678
|
|
|
722
|
-
|
|
723
|
-
the agent shows up as an MCP server in Cursor. `--name` overrides the
|
|
724
|
-
server name (the default is the slug, or a name derived from `--url`).
|
|
725
|
-
`--print` prints the entry instead of writing the file, and `--json`
|
|
726
|
-
prints a machine-readable result. `--remote` (with `--prod`) writes a
|
|
727
|
-
remote HTTP entry pointing at the stable Cursor MCP gateway instead of
|
|
728
|
-
the local stdio proxy, for MCP hosts that can't spawn stdio servers.
|
|
729
|
-
The remote entry carries your API key in plain text, so treat the file
|
|
730
|
-
as a credential.
|
|
679
|
+
## MCP connections
|
|
731
680
|
|
|
732
|
-
|
|
681
|
+
### Connect an MCP client {#mcp}
|
|
682
|
+
|
|
683
|
+
```bash
|
|
684
|
+
agent-sdk mcp --prod [--slug <slug>] [--team <id>]
|
|
685
|
+
agent-sdk mcp --url <baseUrl> [--bearer-token <token>]
|
|
733
686
|
|
|
734
|
-
|
|
735
|
-
|
|
687
|
+
agent-sdk mcp install --prod [--slug <slug>] [--team <id>]
|
|
688
|
+
[--name <server-name>] [--print] [--json] [--remote]
|
|
689
|
+
agent-sdk mcp install --url <baseUrl> [--bearer-token <token>]
|
|
690
|
+
[--name <server-name>] [--print] [--json]
|
|
691
|
+
```
|
|
736
692
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
`
|
|
740
|
-
`
|
|
741
|
-
|
|
742
|
-
current process retry.
|
|
693
|
+
| Command | Contract |
|
|
694
|
+
| --- | --- |
|
|
695
|
+
| `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. |
|
|
696
|
+
| `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. |
|
|
697
|
+
| `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. |
|
|
743
698
|
|
|
744
|
-
|
|
745
|
-
account through the Cursor backend's connector consent flow. Those
|
|
746
|
-
tokens live on the Cursor backend, so `--store` isn't needed; the
|
|
747
|
-
command prints a note when you pass it anyway.
|
|
699
|
+
### Authorize MCP OAuth {#mcp-oauth}
|
|
748
700
|
|
|
749
701
|
```bash
|
|
750
|
-
agent-sdk mcp oauth <connection> [--dir
|
|
702
|
+
agent-sdk mcp oauth <connection> [--dir <path>] [--store]
|
|
703
|
+
[--slug <slug>] [--team <id>]
|
|
751
704
|
```
|
|
752
705
|
|
|
753
706
|
`<connection>` is the basename under `agent/mcp-connections/` or
|
|
754
707
|
`agent/host-connections/`.
|
|
755
|
-
`--slug` defaults to the `--dir` basename. `--team` defaults to the
|
|
756
|
-
signed-in account's team. You need `agent-sdk login` (or `--api-key`)
|
|
757
|
-
before `--store`.
|
|
758
708
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
709
|
+
| Connection | Result |
|
|
710
|
+
| --- | --- |
|
|
711
|
+
| `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. |
|
|
712
|
+
| `defineConnection({ cursorAccount: true })` | Authorize the managed deployment's service account through Cursor. `--store` isn't needed. |
|
|
763
713
|
|
|
764
|
-
|
|
765
|
-
|
|
714
|
+
Stored secret names are `MCP_OAUTH_<NAME>_ACCESS_TOKEN`,
|
|
715
|
+
`MCP_OAUTH_<NAME>_REFRESH_TOKEN`, and `MCP_OAUTH_<NAME>_CLIENT_ID`. Declare
|
|
716
|
+
them in `hosting.secretNames`. URL-connection tokens are bound to the resource
|
|
717
|
+
URL; authorize again after changing it.
|
|
766
718
|
|
|
767
|
-
See
|
|
719
|
+
See [Host MCP OAuth](/docs/guides/mcp-oauth.md) for the full setup flow.
|
|
768
720
|
|
|
769
|
-
##
|
|
721
|
+
## Channel helpers
|
|
770
722
|
|
|
771
|
-
|
|
723
|
+
### Configure Slack {#slack}
|
|
772
724
|
|
|
773
725
|
```bash
|
|
774
|
-
agent-sdk
|
|
775
|
-
agent-sdk
|
|
776
|
-
|
|
726
|
+
agent-sdk slack setup
|
|
727
|
+
agent-sdk slack create [--dir <path>] [--name <name>] [--prod]
|
|
728
|
+
[--slack-team <id>] [--team <id>] [--icon <url-or-file>]
|
|
729
|
+
[--prefix <prefix> | --no-prefix] [--channel-posts] [--json]
|
|
730
|
+
agent-sdk slack destroy [--dir <path>] [--prod]
|
|
731
|
+
[--slack-team <id>] [--team <id>] [--json]
|
|
732
|
+
agent-sdk slack icon <url-or-file> [--dir <path>] [--prod]
|
|
733
|
+
[--slack-team <id>] [--team <id>] [--json]
|
|
734
|
+
agent-sdk slack init --manual [--dir <path>] [--name <name>]
|
|
735
|
+
[--prefix <prefix> | --no-prefix] [--channel-posts]
|
|
736
|
+
[--install | --no-install] [--slack-team <id>] [--prod]
|
|
737
|
+
agent-sdk slack manifest [--dir <path>] [--name <name>]
|
|
738
|
+
[--env dev|prod|both] [--channel-posts] [--print]
|
|
739
|
+
agent-sdk slack doctor [--dir <path>]
|
|
740
|
+
[--prefix <prefix> | --no-prefix] [--channel <id>]... [--json]
|
|
777
741
|
```
|
|
778
742
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
743
|
+
| Subcommand | Contract |
|
|
744
|
+
| --- | --- |
|
|
745
|
+
| `setup` | Print the setup choices without changing files. |
|
|
746
|
+
| `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. |
|
|
747
|
+
| `destroy` | Delete the provisioned app. Existing local token entries remain but stop working. |
|
|
748
|
+
| `icon` | Set an HTTPS or local PNG, JPG, or GIF icon of at most 512 KB. |
|
|
749
|
+
| `init --manual` | Write the channel, manifests, Slack CLI project, and setup files for a manually managed app. |
|
|
750
|
+
| `manifest` | Generate Slack manifests. `--env` defaults to `both`; with `--print`, select one environment when you need one JSON document. |
|
|
751
|
+
| `doctor` | Check both tokens, Socket Mode connectivity, Slack authentication, and any repeatable `--channel` values. |
|
|
752
|
+
|
|
753
|
+
The default token prefix is the project directory name normalized to upper
|
|
754
|
+
snake case. `--no-prefix` uses `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`.
|
|
755
|
+
Channel-post subscriptions are off by default; `--channel-posts` adds message
|
|
756
|
+
events for public and private channels as required by
|
|
757
|
+
`engagement.channelPosts`.
|
|
758
|
+
Multi-agent servers need one token pair per agent.
|
|
759
|
+
|
|
760
|
+
See [Slack](/docs/guides/slack.md) for app consent and manual setup.
|
|
782
761
|
|
|
783
|
-
|
|
784
|
-
shell history and in agent-captured terminals. The CLI refuses that form
|
|
785
|
-
unless you pass `--from-argv` (still warns). Prefer a file redirect when
|
|
786
|
-
a human is not at the prompt:
|
|
762
|
+
### Test GitHub webhooks {#github}
|
|
787
763
|
|
|
788
764
|
```bash
|
|
789
|
-
agent-sdk
|
|
765
|
+
agent-sdk github forward [--dir <path>] [--slug <slug>] [--channel <id>]
|
|
766
|
+
[--repo owner/repo | --org <org>] [--events a,b,c]
|
|
767
|
+
[--url <url>] [--host <host>] [--port <n>]
|
|
768
|
+
[--secret <secret>] [--install]
|
|
769
|
+
agent-sdk github replay <pr-url-or-owner/repo#N>
|
|
770
|
+
[--events a,b,c | '*'] [--action <action>] [--conclusion <result>]
|
|
771
|
+
[--comment <body>] [--context <name>] [--dir <path>]
|
|
772
|
+
[--slug <slug>] [--channel <id>] [--url <url>]
|
|
773
|
+
[--secret <secret>] [--dry-run] [--out <dir>] [--json]
|
|
774
|
+
agent-sdk github events [--dir <path>] [--host <host>] [--port <n>] [--json]
|
|
775
|
+
agent-sdk github doctor [--install] [--json]
|
|
790
776
|
```
|
|
791
777
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
778
|
+
| Subcommand | Contract |
|
|
779
|
+
| --- | --- |
|
|
780
|
+
| `forward` | Forward live deliveries with `gh webhook forward`. The CLI derives URLs and events from discovered channels and can fan out to several matches. |
|
|
781
|
+
| `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. |
|
|
782
|
+
| `events` | List discovered channel URLs and event sets. No channels is a successful empty result. |
|
|
783
|
+
| `doctor` | Check the GitHub CLI, its login, and the pinned webhook extension. `--install` installs or repairs the extension. |
|
|
795
784
|
|
|
796
|
-
`
|
|
797
|
-
|
|
798
|
-
|
|
785
|
+
Replay supports `pull_request`, `issue_comment`,
|
|
786
|
+
`pull_request_review_comment`, `check_run`, `check_suite`, `workflow_run`, and
|
|
787
|
+
`status`. `--dry-run` prints without posting. `--out` writes fixtures and
|
|
788
|
+
still posts unless combined with `--dry-run`.
|
|
799
789
|
|
|
800
|
-
|
|
801
|
-
|
|
790
|
+
Forwarding requires repository admin access, or organization owner access for
|
|
791
|
+
`--org`. It uses the GitHub CLI's stored login; unset `GITHUB_TOKEN` and
|
|
792
|
+
`GH_TOKEN` before forwarding. Replay needs only pull-request read access.
|
|
802
793
|
|
|
803
|
-
|
|
794
|
+
See [GitHub](/docs/guides/github.md) for channel setup and live delivery.
|
|
804
795
|
|
|
805
|
-
|
|
806
|
-
setup.
|
|
796
|
+
### Test GitLab webhooks {#gitlab}
|
|
807
797
|
|
|
808
798
|
```bash
|
|
809
|
-
agent-sdk
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
agent-sdk
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
`
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
(`agent-sdk login` or `CURSOR_API_KEY`). A team service-account key
|
|
834
|
-
cannot create Slack apps. `--prod` provisions the production app; the
|
|
835
|
-
default is the development app. `--name` / `--icon`
|
|
836
|
-
/ `--channel-posts` prefill the wizard. A second create for the same
|
|
837
|
-
slug and env overwrites the live Slack app. If Slack needs a workspace
|
|
838
|
-
admin's approval, the wizard waits; keep the CLI running, open Slack's
|
|
839
|
-
**Request approval** page (the CLI prints the link), and click **Retry**
|
|
840
|
-
after the admin approves. Token values never print.
|
|
841
|
-
|
|
842
|
-
`slack destroy` deletes the provisioned app for the selected
|
|
843
|
-
environment. Tokens already written to `.env.local` stay in place and
|
|
844
|
-
stop working.
|
|
845
|
-
|
|
846
|
-
`slack icon` sets the provisioned app's icon from an https image URL or
|
|
847
|
-
a local png, jpg, or gif file of at most 512KB.
|
|
848
|
-
|
|
849
|
-
`slack init` without `--manual` exits non-zero and writes no files. Use
|
|
850
|
-
`slack create` for the dashboard wizard. `slack init --manual` writes
|
|
851
|
-
the channel file, development and production manifests, a Slack CLI
|
|
852
|
-
`.slack/` project (hook + manifests, committed with the repo). When
|
|
853
|
-
Slack CLI is logged in, it installs the app. Otherwise `next` asks
|
|
854
|
-
you to install it. `--install` requires that install. `--no-install`
|
|
855
|
-
skips it. `--prod` selects the deployed app.
|
|
856
|
-
`--slack-team` picks the workspace. Slack CLI keeps install tokens in
|
|
857
|
-
that process; copy `xoxb` and mint `xapp` (`connections:write`) into
|
|
858
|
-
`.env.local`. Tokens that appear in `.env` during that install are
|
|
859
|
-
copied onto the prefixed names. Paste `.slack/manifest.dev.json` at
|
|
860
|
-
api.slack.com when the Slack CLI is missing. Do not run
|
|
861
|
-
`slack deploy`. The command refuses to overwrite the channel file.
|
|
862
|
-
It updates the Slack CLI hook and manifests when `.slack/` already
|
|
863
|
-
exists. If a collision occurs, it exits non-zero; files created
|
|
864
|
-
earlier in the run remain. The token prefix defaults to the directory
|
|
865
|
-
basename normalized to uppercase snake case.
|
|
866
|
-
Explicit `--prefix` values use the same normalization. For example,
|
|
867
|
-
`pr-approver` becomes `PR_APPROVER_SLACK_BOT_TOKEN`. `--no-prefix`
|
|
868
|
-
uses shared `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`.
|
|
869
|
-
`--channel-posts` subscribes the manifests to channel-post events.
|
|
870
|
-
The command always prints a JSON summary.
|
|
871
|
-
|
|
872
|
-
`slack manifest` regenerates selected manifest files. `--env` defaults
|
|
873
|
-
to `both`, and `--name` defaults to the directory name. `--print` writes
|
|
874
|
-
the manifest JSON to stdout instead of changing files. With the default
|
|
875
|
-
`--env both`, it prints development JSON, a `--- prod ---` separator,
|
|
876
|
-
then production JSON.
|
|
877
|
-
|
|
878
|
-
`slack doctor` checks both tokens, Socket Mode connectivity, and
|
|
879
|
-
Slack's `auth.test`. It exits non-zero when any check fails.
|
|
880
|
-
|
|
881
|
-
See the [Slack guide](/docs/guides/slack.md).
|
|
882
|
-
|
|
883
|
-
## github
|
|
884
|
-
|
|
885
|
-
The `github` pack discovers `githubChannel()` definitions and sends live
|
|
886
|
-
or synthesized deliveries to them.
|
|
799
|
+
agent-sdk gitlab replay <mr-url-or-group/project!N>
|
|
800
|
+
[--events a,b,c | '*'] [--action <action>]
|
|
801
|
+
[--conclusion <status>] [--comment <body>]
|
|
802
|
+
[--dir <path>] [--slug <slug>] [--channel <id>]
|
|
803
|
+
[--url <url>] [--host <host>] [--port <n>]
|
|
804
|
+
[--secret <secret>] [--dry-run] [--out <dir>] [--json]
|
|
805
|
+
agent-sdk gitlab events [--dir <path>] [--host <host>] [--port <n>] [--json]
|
|
806
|
+
agent-sdk gitlab forward [--dir <path>] [--host <host>] [--port <n>]
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
| Subcommand | Contract |
|
|
810
|
+
| --- | --- |
|
|
811
|
+
| `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. |
|
|
812
|
+
| `events` | List discovered GitLab channel URLs and object kinds. |
|
|
813
|
+
| `forward` | Print the public-hook and tunnel recipe for live deliveries. |
|
|
814
|
+
|
|
815
|
+
Replay supports `merge_request`, `note`, `pipeline`, and `push`. It requires
|
|
816
|
+
`GITLAB_TOKEN` with project read access. `--secret` defaults to
|
|
817
|
+
`GITLAB_WEBHOOK_SECRET`; `--dry-run` and `--out` follow the GitHub replay
|
|
818
|
+
contract.
|
|
819
|
+
|
|
820
|
+
See [GitLab](/docs/guides/gitlab.md) for channel setup and self-managed hosts.
|
|
821
|
+
|
|
822
|
+
### Test Bitbucket webhooks {#bitbucket}
|
|
887
823
|
|
|
888
824
|
```bash
|
|
889
|
-
agent-sdk
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
agent-sdk
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
`
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
`
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
matched channel can supply the event set.
|
|
912
|
-
|
|
913
|
-
Repository forwarding needs repo-admin access. Organization forwarding
|
|
914
|
-
needs org-owner access. The relay authenticates with the GitHub CLI's
|
|
915
|
-
stored login. A `GITHUB_TOKEN` or `GH_TOKEN` environment override can
|
|
916
|
-
make delivery requests return `401`, even when hook creation succeeds.
|
|
917
|
-
Unset those variables before forwarding.
|
|
918
|
-
|
|
919
|
-
Pass `--secret` or set `GITHUB_WEBHOOK_SECRET` to sign deliveries.
|
|
920
|
-
`serve --dev` accepts unsigned loopback deliveries. A non-dev target
|
|
921
|
-
requires the same secret on both sides.
|
|
922
|
-
|
|
923
|
-
`github replay` needs read access, not admin access. It reads the pull
|
|
924
|
-
request through `gh api`, builds GitHub webhook payloads, and posts them
|
|
925
|
-
to the selected channels. Supported events are `pull_request`,
|
|
926
|
-
`issue_comment`, `pull_request_review_comment`, `check_run`,
|
|
927
|
-
`check_suite`, `workflow_run`, and `status`. The default is
|
|
928
|
-
`pull_request` with action `synchronize`. Comment events need
|
|
929
|
-
`--comment`.
|
|
930
|
-
|
|
931
|
-
Use `--events '*'` to replay every supported event declared by the
|
|
932
|
-
channel. `--dry-run` prints payloads without posting them. `--out`
|
|
933
|
-
writes fixture files but still posts unless you also pass `--dry-run`.
|
|
934
|
-
|
|
935
|
-
`github doctor` checks `gh`, its login, and the pinned
|
|
936
|
-
`cli/gh-webhook` extension. `--install` installs or repairs the
|
|
937
|
-
extension. An environment-token override is a warning and doesn't make
|
|
938
|
-
`github doctor` fail.
|
|
939
|
-
|
|
940
|
-
See the [GitHub guide](/docs/guides/github.md).
|
|
825
|
+
agent-sdk bitbucket replay <pr-url-or-workspace/repo#N>
|
|
826
|
+
[--events a,b,c | '*'] [--comment <body>]
|
|
827
|
+
[--dir <path>] [--slug <slug>] [--channel <id>]
|
|
828
|
+
[--url <url>] [--host <host>] [--port <n>]
|
|
829
|
+
[--secret <secret>] [--dry-run] [--out <dir>] [--json]
|
|
830
|
+
agent-sdk bitbucket events [--dir <path>] [--host <host>] [--port <n>] [--json]
|
|
831
|
+
agent-sdk bitbucket forward [--dir <path>] [--host <host>] [--port <n>]
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
| Subcommand | Contract |
|
|
835
|
+
| --- | --- |
|
|
836
|
+
| `replay` | Read a pull request, synthesize webhook payloads in the host's Cloud or Data Center format, and post them to matching channels. |
|
|
837
|
+
| `events` | List discovered Bitbucket channel URLs and event keys. |
|
|
838
|
+
| `forward` | Print the repository-hook and tunnel recipe for live deliveries. |
|
|
839
|
+
|
|
840
|
+
Replay supports `pullrequest:created`, `pullrequest:updated`,
|
|
841
|
+
`pullrequest:comment_created`, and `repo:push`, along with their supported Data
|
|
842
|
+
Center forms. It requires `BITBUCKET_TOKEN` with pull-request read access.
|
|
843
|
+
`--secret` defaults to `BITBUCKET_WEBHOOK_SECRET`; `--dry-run` and `--out`
|
|
844
|
+
follow the GitHub replay contract.
|
|
845
|
+
|
|
846
|
+
See [Bitbucket](/docs/guides/bitbucket.md) for Cloud and Data Center setup.
|
|
941
847
|
|
|
942
848
|
## Environment variables
|
|
943
849
|
|
|
944
|
-
|
|
850
|
+
Credential resolution follows this order: `--api-key`, `CURSOR_API_KEY`,
|
|
851
|
+
`CURSOR_API_KEY_FILE`, `CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login.
|
|
945
852
|
|
|
946
|
-
| Variable |
|
|
853
|
+
| Variable | Contract |
|
|
854
|
+
| --- | --- |
|
|
855
|
+
| `CURSOR_API_KEY` | Cursor credential. |
|
|
856
|
+
| `CURSOR_API_KEY_FILE` | Path to a Cursor credential file. |
|
|
857
|
+
| `CURSOR_SERVICE_ACCOUNT_KEY` | Team service-account credential used after the API key and key-file sources. |
|
|
858
|
+
| `CURSOR_API_BASE_URL` | Backend for login, account, deployment, and event commands. |
|
|
859
|
+
| `CURSOR_BACKEND_URL` | Backend for Agent SDK turns. Set it with `CURSOR_API_BASE_URL` when using a non-default backend. |
|
|
860
|
+
| `AGENT_SERVE_CONFIG_DIR` | Override the CLI config directory for stored credentials and update state. |
|
|
861
|
+
| `AGENT_SERVE_NO_UPDATE_CHECK`, `NO_UPDATE_NOTIFIER`, `CI` | Disable published-version checks when set to a non-empty value other than `0`. |
|
|
862
|
+
| `CURSOR_JULY_SKIP_SKILL_INSTALL` | Skip the package install hook that refreshes coding-agent skills. |
|
|
863
|
+
| `CURSOR_JULY_SKILLS_HOME` | Override the coding-agent skills directory. |
|
|
864
|
+
| `GITHUB_WEBHOOK_SECRET` | Default signature secret for GitHub forwarding and replay. |
|
|
865
|
+
| `GITHUB_APP_ID`, `GITHUB_APP_PRIVATE_KEY`, `GITHUB_APP_INSTALLATION_ID` | GitHub App credentials for outbound API calls. |
|
|
866
|
+
| `GITHUB_TOKEN`, `GH_TOKEN` | Token credentials for outbound GitHub calls. Unset both for `github forward`. |
|
|
867
|
+
| `GITLAB_TOKEN` | Token for GitLab API reads and direct channel calls. |
|
|
868
|
+
| `GITLAB_API_BASE_URL` | Override the GitLab REST base URL for self-managed hosts. |
|
|
869
|
+
| `GITLAB_WEBHOOK_SECRET` | Default GitLab webhook token for replay and channel verification. |
|
|
870
|
+
| `BITBUCKET_TOKEN` | Token for Bitbucket API reads and direct channel calls. |
|
|
871
|
+
| `BITBUCKET_API_BASE_URL` | Override the Bitbucket Data Center REST base URL. |
|
|
872
|
+
| `BITBUCKET_WEBHOOK_SECRET` | Default Bitbucket signing secret for replay and channel verification. |
|
|
873
|
+
| `SLACK_BOT_TOKEN`, `SLACK_APP_TOKEN` | Slack tokens for one agent. Multi-agent servers use `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN`. |
|
|
874
|
+
|
|
875
|
+
## Exit status
|
|
876
|
+
|
|
877
|
+
| Command | Nonzero contract |
|
|
947
878
|
| --- | --- |
|
|
948
|
-
|
|
|
949
|
-
| `
|
|
950
|
-
| `
|
|
951
|
-
| `
|
|
952
|
-
| `
|
|
953
|
-
| `
|
|
954
|
-
| `
|
|
955
|
-
| `
|
|
956
|
-
| `
|
|
957
|
-
| `
|
|
958
|
-
|
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
- [
|
|
964
|
-
- [
|
|
965
|
-
- [
|
|
879
|
+
| No command | Print help and exit `1`. Explicit `help`, `--help`, and `-h` exit `0`. |
|
|
880
|
+
| `run` | For local and running-server trajectories, exit `1` when the trajectory fails. |
|
|
881
|
+
| `call` | Exit `1` unless the response succeeds with `ok: true`. |
|
|
882
|
+
| `skill` | Exit `2` when the name is missing and `1` when the request fails. |
|
|
883
|
+
| `trajectory` | Exit `1` when the reconstructed trajectory failed. |
|
|
884
|
+
| `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. |
|
|
885
|
+
| `eval status` | Exit `3` while the batch runs, `1` when it failed or was cancelled, and `2` for invalid usage. |
|
|
886
|
+
| `chat`, `session` | Exit `2` for documented option conflicts or missing required input. |
|
|
887
|
+
| `validate` | Exit `1` when any project diagnostic has error severity. |
|
|
888
|
+
| `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. |
|
|
889
|
+
| Other commands | Exit nonzero when validation, authentication, a request, or the requested operation fails. |
|
|
890
|
+
|
|
891
|
+
## Related
|
|
892
|
+
|
|
893
|
+
- [Project layout](/docs/reference/project-layout.md)
|
|
894
|
+
- [Sessions, events, and streaming](/docs/reference/sessions.md)
|
|
895
|
+
- [Evals](/docs/reference/evals.md)
|
|
896
|
+
- [HTTP API](/docs/reference/http-api.md)
|
|
897
|
+
- [Deployment](/docs/deployment.md)
|