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