@cursor/july 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/ab.d.ts +8 -95
  2. package/dist/ab.d.ts.map +1 -1
  3. package/dist/ab.js +9 -150
  4. package/dist/bin/agent-serve.js +41 -8
  5. package/dist/channels/slack/post-update-delivery.d.ts +85 -0
  6. package/dist/channels/slack/post-update-delivery.d.ts.map +1 -0
  7. package/dist/docs/404.html +2 -2
  8. package/dist/docs/ab.html +4 -4
  9. package/dist/docs/assets/{app.DabPG-io.js → app.COTN7wgo.js} +1 -1
  10. package/dist/docs/assets/chunks/@localSearchIndexroot.B7UcKvIn.js +1 -0
  11. package/dist/docs/assets/chunks/{VPLocalSearchBox.jmyr0bU0.js → VPLocalSearchBox.BW3TBdT0.js} +1 -1
  12. package/dist/docs/assets/chunks/{theme.DysN9-VN.js → theme.BEJW0vE7.js} +2 -2
  13. package/dist/docs/assets/deployment.md.BtfEsc9S.js +55 -0
  14. package/dist/docs/assets/deployment.md.BtfEsc9S.lean.js +1 -0
  15. package/dist/docs/assets/example-agents_approval-buddy.md.8R5phXb5.js +10 -0
  16. package/dist/docs/assets/example-agents_approval-buddy.md.8R5phXb5.lean.js +1 -0
  17. package/dist/docs/assets/example-agents_benny.md.B0gjhI-p.js +7 -0
  18. package/dist/docs/assets/example-agents_benny.md.B0gjhI-p.lean.js +1 -0
  19. package/dist/docs/assets/example-agents_bugbot.md.DelIdhxB.js +11 -0
  20. package/dist/docs/assets/example-agents_bugbot.md.DelIdhxB.lean.js +1 -0
  21. package/dist/docs/assets/example-agents_codebase-wiki.md.DC6sgwn0.js +8 -0
  22. package/dist/docs/assets/example-agents_codebase-wiki.md.DC6sgwn0.lean.js +1 -0
  23. package/dist/docs/assets/example-agents_codeowners-review.md.Ku_tG2RY.js +8 -0
  24. package/dist/docs/assets/example-agents_codeowners-review.md.Ku_tG2RY.lean.js +1 -0
  25. package/dist/docs/assets/example-agents_concierge.md.4rQTSMXt.js +23 -0
  26. package/dist/docs/assets/example-agents_concierge.md.4rQTSMXt.lean.js +1 -0
  27. package/dist/docs/assets/example-agents_fsd.md.CzgUrDfi.js +15 -0
  28. package/dist/docs/assets/example-agents_fsd.md.CzgUrDfi.lean.js +1 -0
  29. package/dist/docs/assets/example-agents_index.md.CRqJlnIf.js +2 -0
  30. package/dist/docs/assets/example-agents_index.md.CRqJlnIf.lean.js +1 -0
  31. package/dist/docs/assets/example-agents_knowledge-base.md.BPJiVueF.js +11 -0
  32. package/dist/docs/assets/example-agents_knowledge-base.md.BPJiVueF.lean.js +1 -0
  33. package/dist/docs/assets/example-agents_security-reviewer.md.D2rtwDTO.js +19 -0
  34. package/dist/docs/assets/example-agents_security-reviewer.md.D2rtwDTO.lean.js +1 -0
  35. package/dist/docs/assets/example-agents_slack-agent.md.buLbgvBf.js +5 -0
  36. package/dist/docs/assets/example-agents_slack-agent.md.buLbgvBf.lean.js +1 -0
  37. package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.js +24 -0
  38. package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.lean.js +1 -0
  39. package/dist/docs/assets/index.md.COiu-1jL.js +20 -0
  40. package/dist/docs/assets/{index.md.Cylk70gg.lean.js → index.md.COiu-1jL.lean.js} +1 -1
  41. package/dist/docs/assets/reference_cli.md.D189RBCH.js +60 -0
  42. package/dist/docs/assets/reference_cli.md.D189RBCH.lean.js +1 -0
  43. package/dist/docs/building-with-agents.html +4 -4
  44. package/dist/docs/concepts.html +4 -4
  45. package/dist/docs/deployment.html +58 -17
  46. package/dist/docs/evals.html +4 -4
  47. package/dist/docs/example-agents/approval-buddy.html +34 -0
  48. package/dist/docs/example-agents/benny.html +31 -0
  49. package/dist/docs/example-agents/bugbot.html +35 -0
  50. package/dist/docs/example-agents/codebase-wiki.html +32 -0
  51. package/dist/docs/example-agents/codeowners-review.html +32 -0
  52. package/dist/docs/example-agents/concierge.html +47 -0
  53. package/dist/docs/example-agents/fsd.html +39 -0
  54. package/dist/docs/example-agents/index.html +26 -0
  55. package/dist/docs/example-agents/knowledge-base.html +35 -0
  56. package/dist/docs/example-agents/security-reviewer.html +43 -0
  57. package/dist/docs/example-agents/slack-agent.html +29 -0
  58. package/dist/docs/example-agents/weather-agent.html +48 -0
  59. package/dist/docs/guides/agent-to-agent.html +4 -4
  60. package/dist/docs/guides/cloud-runtime.html +5 -5
  61. package/dist/docs/guides/github.html +4 -4
  62. package/dist/docs/guides/human-in-the-loop.html +4 -4
  63. package/dist/docs/guides/slack.html +4 -4
  64. package/dist/docs/guides/webhooks.html +4 -4
  65. package/dist/docs/hashmap.json +1 -1
  66. package/dist/docs/hillclimbing.html +4 -4
  67. package/dist/docs/index.html +7 -7
  68. package/dist/docs/quickstart.html +4 -4
  69. package/dist/docs/reference/agent-config.html +4 -4
  70. package/dist/docs/reference/channels.html +4 -4
  71. package/dist/docs/reference/cli.html +52 -30
  72. package/dist/docs/reference/connections.html +4 -4
  73. package/dist/docs/reference/hooks.html +4 -4
  74. package/dist/docs/reference/http-api.html +4 -4
  75. package/dist/docs/reference/instructions.html +4 -4
  76. package/dist/docs/reference/playground.html +4 -4
  77. package/dist/docs/reference/project-layout.html +4 -4
  78. package/dist/docs/reference/schedules.html +4 -4
  79. package/dist/docs/reference/sessions.html +4 -4
  80. package/dist/docs/reference/skills.html +4 -4
  81. package/dist/docs/reference/subagents.html +4 -4
  82. package/dist/docs/reference/tools.html +4 -4
  83. package/dist/docs/scaffolding-agents.html +4 -4
  84. package/dist/docs/storage.html +4 -4
  85. package/dist/docs/troubleshooting.html +4 -4
  86. package/dist/evals.d.ts +5 -62
  87. package/dist/evals.d.ts.map +1 -1
  88. package/dist/evals.js +3 -66
  89. package/dist/index.d.ts +1 -1
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/internal/ab-collector.d.ts +7 -5
  92. package/dist/internal/ab-collector.d.ts.map +1 -1
  93. package/dist/internal/ab-collector.js +3 -14
  94. package/dist/internal/ab-snapshot.d.ts +2 -4
  95. package/dist/internal/ab-snapshot.d.ts.map +1 -1
  96. package/dist/internal/cli-ax.d.ts +33 -5
  97. package/dist/internal/cli-ax.d.ts.map +1 -1
  98. package/dist/internal/cli-ax.js +428 -87
  99. package/dist/internal/cli-deploy.js +1 -1
  100. package/dist/internal/discovery.js +3 -3
  101. package/dist/internal/eval-run-store.d.ts +35 -30
  102. package/dist/internal/eval-run-store.d.ts.map +1 -1
  103. package/dist/internal/eval-run-store.js +88 -100
  104. package/dist/internal/evals-client.d.ts +96 -0
  105. package/dist/internal/evals-client.d.ts.map +1 -0
  106. package/dist/internal/evals-client.js +262 -0
  107. package/dist/internal/init-project.d.ts.map +1 -1
  108. package/dist/internal/init-project.js +1 -0
  109. package/dist/internal/persistence-coordinator.d.ts +127 -0
  110. package/dist/internal/persistence-coordinator.d.ts.map +1 -0
  111. package/dist/internal/playground-proxy.d.ts +5 -5
  112. package/dist/internal/playground-proxy.js +3 -3
  113. package/dist/internal/resolve-prod-target.d.ts +30 -0
  114. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  115. package/dist/internal/resolve-prod-target.js +74 -2
  116. package/dist/internal/server.d.ts.map +1 -1
  117. package/dist/internal/server.js +16 -5
  118. package/dist/internal/session-engine.d.ts +1 -2
  119. package/dist/internal/session-engine.d.ts.map +1 -1
  120. package/dist/internal/session-engine.js +14 -31
  121. package/dist/internal/storage-coordinator.d.ts +16 -15
  122. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  123. package/dist/internal/storage-coordinator.js +73 -80
  124. package/dist/persistence.d.ts +184 -0
  125. package/dist/persistence.d.ts.map +1 -0
  126. package/dist/playground/assets/cursor-icons-16-CQ50JpfO.woff2 +0 -0
  127. package/dist/playground/assets/index-72vCOBWO.js +86 -0
  128. package/dist/playground/assets/index-BjnMwYoR.css +1 -0
  129. package/dist/playground/index.html +2 -2
  130. package/dist/storage.d.ts +51 -10
  131. package/dist/storage.d.ts.map +1 -1
  132. package/dist/storage.js +27 -10
  133. package/docs/README.md +34 -5
  134. package/docs/deployment.md +352 -149
  135. package/docs/example-agents/approval-buddy.md +270 -0
  136. package/docs/example-agents/benny.md +186 -0
  137. package/docs/example-agents/bugbot.md +231 -0
  138. package/docs/example-agents/codebase-wiki.md +174 -0
  139. package/docs/example-agents/codeowners-review.md +195 -0
  140. package/docs/example-agents/concierge.md +205 -0
  141. package/docs/example-agents/fsd.md +330 -0
  142. package/docs/example-agents/index.md +102 -0
  143. package/docs/example-agents/knowledge-base.md +171 -0
  144. package/docs/example-agents/security-reviewer.md +296 -0
  145. package/docs/example-agents/slack-agent.md +146 -0
  146. package/docs/example-agents/weather-agent.md +302 -0
  147. package/docs/reference/cli.md +546 -147
  148. package/package.json +1 -1
  149. package/src/ab.ts +9 -261
  150. package/src/bin/agent-serve.ts +46 -7
  151. package/src/evals.ts +5 -119
  152. package/src/index.ts +2 -0
  153. package/src/internal/ab-collector.ts +12 -22
  154. package/src/internal/ab-snapshot.ts +2 -4
  155. package/src/internal/cli-ax.ts +551 -104
  156. package/src/internal/cli-deploy.ts +1 -1
  157. package/src/internal/discovery.ts +2 -2
  158. package/src/internal/eval-run-store.ts +91 -100
  159. package/src/internal/evals-client.ts +431 -0
  160. package/src/internal/init-project.ts +1 -0
  161. package/src/internal/playground-proxy.ts +5 -5
  162. package/src/internal/resolve-prod-target.ts +101 -3
  163. package/src/internal/server.ts +17 -3
  164. package/src/internal/session-engine.ts +9 -29
  165. package/src/internal/storage-coordinator.ts +109 -101
  166. package/src/storage.ts +79 -14
  167. package/dist/docs/assets/chunks/@localSearchIndexroot.QwK5BtEH.js +0 -1
  168. package/dist/docs/assets/deployment.md.DTKwE15Z.js +0 -14
  169. package/dist/docs/assets/deployment.md.DTKwE15Z.lean.js +0 -1
  170. package/dist/docs/assets/index.md.Cylk70gg.js +0 -20
  171. package/dist/docs/assets/reference_cli.md.Bv6pOxcF.js +0 -38
  172. package/dist/docs/assets/reference_cli.md.Bv6pOxcF.lean.js +0 -1
  173. package/dist/internal/json-dir-store.js +0 -100
  174. package/dist/playground/assets/cursor-icons-outline-BxTT_FVJ.woff2 +0 -0
  175. package/dist/playground/assets/index-BEauYlII.css +0 -1
  176. package/dist/playground/assets/index-BtM0wEGg.js +0 -319
  177. package/src/internal/json-dir-store.ts +0 -109
@@ -1,68 +1,123 @@
1
1
  ---
2
2
  title: "CLI"
3
- description: "Every agentkit command and the flags that matter, from serve and run to the slack and github packs."
3
+ description: "Commands and common flags for local development, running servers, and Cursor-managed hosting."
4
4
  ---
5
5
 
6
6
  # CLI reference
7
7
 
8
- Run the CLI with Node 22.13+. `agentkit help` prints the
9
- built-in summary, and most commands print their own usage when a
10
- required argument is missing.
11
-
12
- | Command | Description |
13
- | ------------------------------------------------------- | ----------------------------------------------------- |
14
- | [`serve`](#serve) | Serve agents over HTTP (multi-agent by default) |
15
- | [`dev`](#dev) | Local development: same as `serve --dev` |
16
- | [`chat`](#chat) | Talk to a running server from the terminal |
17
- | [`resume`](#resume) | Reattach chat to an existing session id |
18
- | [`run`](#run) | One-shot turn on an ephemeral server; JSON trajectory |
19
- | [`call`](#call) | Call a server tool directly, no model turn |
20
- | [`eval`](#eval) | Run filesystem evals |
21
- | [`trajectory`](#trajectory) | Summarize a saved events.ndjson |
22
- | [`init`](#init) | Scaffold a project (or print the setup guide) |
23
- | [`info`](#info) | Print the discovered agent surface |
24
- | [`validate`](#validate) | Check the project; non-zero exit on errors |
25
- | [`login` / `logout` / `whoami`](#login--logout--whoami) | Manage the host's Cursor credential |
26
- | [`slack …`](#slack) | Slack pack: init, manifests, doctor |
27
- | [`github …`](#github) | GitHub pack: forward, replay, events, doctor |
28
-
29
- The flags shared across commands: `--dir <path>` (project root, default
30
- `.`), `--json` (machine output where supported), `--url <baseUrl>`
31
- (target a running server instead of starting one), `--bearer-token`
32
- (require it on `serve`; send it from `chat`, `run`, `eval`, and `call`),
33
- and `--state-root <path>` (durable state directory, default
34
- `<dir>/.agentkit`).
8
+ `@cursor/july` installs `agentkit` and the legacy `agent-serve` alias.
9
+ The examples on this page use `agentkit`. Run the CLI with Node 22.13
10
+ or newer. Don't run it with Bun; Bun corrupts tool-result streams from
11
+ the Cursor SDK.
12
+
13
+ The current release still uses `.agent-serve` for on-disk state. See the
14
+ [rename table](../README.md#run-the-cli) for identifiers still moving to
15
+ agentkit names.
16
+
17
+ `agentkit help` prints the built-in summary. The Slack and GitHub packs
18
+ also provide `agentkit slack help` and `agentkit github help`.
19
+
20
+ | Command | Description |
21
+ | ------------------------------------------------------- | -------------------------------------------------------------- |
22
+ | [`serve`](#serve) | Serve agents over HTTP |
23
+ | [`dev`](#dev) | Start local development with `serve --dev` |
24
+ | [`chat`](#chat) | Talk to a running agent |
25
+ | [`resume`](#resume) | Reattach chat to a previous session |
26
+ | [`logs`](#logs) | Follow local or hosted logs |
27
+ | [`sessions`](#sessions) | List sessions on a running agent |
28
+ | [`session`](#session) | Inspect one session |
29
+ | [`playground`](#playground) | Open the local or hosted playground |
30
+ | [`run`](#run) | Run one or more turns locally, remotely, or on a hosted agent |
31
+ | [`call`](#call) | Call a server tool without a model turn |
32
+ | [`eval`](#eval) | Run filesystem evals |
33
+ | [`trajectory`](#trajectory) | Summarize a saved `events.ndjson` file |
34
+ | [`init`](#init) | Scaffold a project, or print the setup guide |
35
+ | [`info`](#info) | Print the discovered agent surface |
36
+ | [`validate`](#validate) | Check a project and fail on errors |
37
+ | [`login` / `logout` / `whoami`](#login--logout--whoami) | Manage the host's Cursor credential |
38
+ | [`update`](#update) | Upgrade the installed CLI |
39
+ | [`deploy`](#deploy) | Deploy one or more agents to Cursor managed hosting |
40
+ | [`deployments`](#deployments) | List hosted deployments |
41
+ | [`deployment`](#deployment) | Inspect one hosted deployment |
42
+ | [`stop`](#stop) | Stop a hosted deployment |
43
+ | [`rotate-token`](#rotate-token) | Replace a deployment's alias token |
44
+ | [`rotate-pod-credential`](#rotate-pod-credential) | Replace a deployment's pod credential |
45
+ | [`secrets`](#secrets) | Manage deployment secrets |
46
+ | [`slack ...`](#slack) | Set up and check Slack channels |
47
+ | [`github ...`](#github) | Forward, replay, and inspect GitHub webhook channels |
48
+
49
+ ## Choose a target
50
+
51
+ Request-sending commands support three target types.
52
+
53
+ | Target | How to select it | Commands |
54
+ | --- | --- | --- |
55
+ | Ephemeral local server | Omit `--url` and `--prod` | `run`, `call`, `eval` |
56
+ | Running server | Pass `--url <baseUrl>`, unless the command uses the localhost default described next | `chat`, `resume`, `logs`, `sessions`, `session`, `playground`, `run`, `call`, `eval` |
57
+ | Cursor managed hosting | Pass `--prod` | `chat`, `resume`, `logs`, `sessions`, `session`, `playground`, `run`, `call`, `eval` |
58
+
59
+ `chat`, `logs`, `sessions`, `session`, and `playground` default to
60
+ `http://127.0.0.1:3000`. A `--url` must include the agent slug for a
61
+ multi-agent server, such as `http://127.0.0.1:3000/pr-approver`.
62
+ `--slug` doesn't change an explicit URL.
63
+
64
+ With `--prod`, `--slug` selects the deployment and `--team` selects the
65
+ Cursor team. The slug defaults to the `--dir` basename. The team
66
+ defaults to the signed-in account's team. `--url` and `--prod` are
67
+ mutually exclusive.
68
+
69
+ Use `--bearer-token <token>` when a running server requires bearer
70
+ authentication. Hosted commands use your Cursor credential to request
71
+ short-lived engine access. `--api-key` overrides the Cursor credential
72
+ for `login`, `serve`, hosted targets, and managed-hosting commands.
73
+ `--state-root` applies to `serve` and ephemeral `run`, `call`, and
74
+ `eval` servers. Running and hosted targets ignore it.
75
+
76
+ For ephemeral `run`, `call`, and `eval` commands, omitting `--slug`
77
+ selects an unslugged root mount when one exists. Otherwise, agentkit
78
+ selects the first discovered agent.
35
79
 
36
80
  ## serve
37
81
 
38
- `serve` hosts every agent under a directory, multi-agent by default.
82
+ `serve` hosts every agent under `--dir` in multi-agent mode by default.
39
83
 
40
84
  ```bash
41
85
  agentkit serve [--dir <path>] [--port 3000] [--host 127.0.0.1] [--dev]
42
86
  [--mode multi|single] [--api-key <key>]
43
87
  [--state-root <path>] [--bearer-token <secret> | --allow-anonymous]
88
+ [--allow-anonymous-cursor-github]
44
89
  [--public-url <url>] [--no-schedules] [--no-playground]
45
- [--no-docs] [--cursor-events --repo owner/name]
90
+ [--no-docs] [--cursor-events --repo owner/name]...
46
91
  ```
47
92
 
48
- Serves every agent under `--dir`. A directory that is itself an agent
49
- project mounts under its directory name; a directory of projects mounts
50
- each child. The index lives at `/`, each agent at `/<slug>/v1/*` and
51
- `/<slug>/playground`. On a TTY, press Enter to restart; it reloads
52
- agent code.
53
-
54
- | Flag | Meaning |
55
- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
56
- | `--dev` | Dev mode. Schedules and reminders never auto-fire (dispatch through `/v1/dev/...`), the playground session list widens (loopback), GitHub channels accept unsigned loopback deliveries, and Vite HMR starts when the toolchain is present. |
57
- | `--mode` | `multi` (default: slugged routes plus an index) or `single` (one agent at the unslugged `/v1/*`). |
58
- | `--api-key` | Cursor API key. Falls back to `CURSOR_API_KEY`, then the stored `login` credential. |
59
- | `--bearer-token` | Require this bearer token on API routes; replaces the loopback-only default on channels without authored auth. Mutually exclusive with `--allow-anonymous`. |
60
- | `--allow-anonymous` | Admit every HTTP caller as one `anonymous` principal. Trusted networks only. |
61
- | `--public-url` | The base URL where this host is reachable from outside. Required for peer MCP connections on cloud-runtime turns. |
62
- | `--no-schedules` | Disable the cron runner outside dev mode. |
63
- | `--no-playground` | Skip the web playground (and its auto-build / HMR). |
64
- | `--no-docs` | Skip the documentation site at `/docs` (and its auto-build). |
65
- | `--cursor-events` | Pull SCM webhook events from Cursor's `/v0/scm-events` instead of receiving webhooks. Requires a signed-in host and `--repo` (repeatable). Offset state lives under `<state-root>/cursor-events/`. |
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 reload agent code.
97
+ Unless `--state-root` is set, each mount uses
98
+ `<agent-project>/.agent-serve`; slugged mounts use
99
+ `<agent-project>/.agent-serve/<slug>`.
100
+
101
+ | Flag | Meaning |
102
+ | --- | --- |
103
+ | `--port` | Listen on this port. `0` selects an available port. The default is `3000`. |
104
+ | `--host` | Bind this host. The default is loopback-only `127.0.0.1`. |
105
+ | `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, widen playground session access on loopback, and start Vite HMR when available. |
106
+ | `--mode` | Use `multi` for slugged routes and an index, or `single` for one agent at the unslugged `/v1/*`. The default is `multi`. |
107
+ | `--api-key` | Use this Cursor API key. The command falls back to `CURSOR_API_KEY`, then the stored login. |
108
+ | `--state-root` | Store sessions, streams, workspaces, and channel state here. Keep durable production state outside the agent repository. |
109
+ | `--bearer-token` | Require this bearer token on routes without authored auth. Mutually exclusive with `--allow-anonymous`. |
110
+ | `--allow-anonymous` | Admit every caller as one `anonymous` principal. Use only behind a trusted network boundary. |
111
+ | `--allow-anonymous-cursor-github` | Allow anonymous callers to drive sessions holding a Cursor account's repo-scoped GitHub credential. Use only behind an authenticating proxy. |
112
+ | `--public-url` | Set the externally reachable host URL. Cloud-runtime peer connections need it to call back into this server. |
113
+ | `--no-schedules` | Disable the cron runner outside dev mode. |
114
+ | `--no-playground` | Skip the web playground and its build or HMR process. |
115
+ | `--no-docs` | Skip the documentation site at `/docs` and its build. |
116
+ | `--cursor-events` | Pull SCM events from Cursor's `/v0/scm-events` in addition to authored webhook routes. Requires a signed-in host. Pass repeatable `--repo owner/name` values; repos declared by `githubChannel({ cursorAccount })` also enable the relay. State lives under `<state-root>/cursor-events/`. |
117
+
118
+ Multi-agent slugs must start with a letter or digit, then contain only
119
+ letters, digits, `_`, or `-`. The reserved slugs are `v1`, `playground`,
120
+ and `docs`.
66
121
 
67
122
  ## dev
68
123
 
@@ -75,69 +130,154 @@ agentkit dev ./pr-approver
75
130
  agentkit dev ./pr-approver --port 3000
76
131
  ```
77
132
 
78
- Same flags as [`serve`](#serve) (`--dir` still works if you prefer it).
133
+ `dev` accepts the same flags as [`serve`](#serve). You can use `--dir`
134
+ instead of the positional path.
79
135
  Dev mode is always on: schedules and reminders wait for manual dispatch,
80
136
  GitHub accepts unsigned loopback deliveries, and Vite HMR starts when
81
137
  the toolchain is present. Prefer this over `serve --dev` while
82
- iterating.
138
+ iterating. Pass at most one positional path. Don't combine a positional
139
+ path with a different `--dir`.
83
140
 
84
141
  ## chat
85
142
 
86
- `chat` talks to a running server from the terminal.
143
+ `chat` talks to a running agent from the terminal. It never starts a
144
+ server.
87
145
 
88
146
  ```bash
89
- agentkit chat --url http://127.0.0.1:3000/<slug> # interactive REPL
90
- agentkit chat --url … --message "Is the PR ready to approve?" # one-shot
91
- agentkit chat --url --message "hello" --json # JSON trajectory
92
- agentkit chat --url https://host --bearer-token "$TOKEN" # authed server
147
+ agentkit chat --url http://127.0.0.1:3000/pr-approver
148
+ agentkit chat --message "Is the PR ready to approve?"
149
+ agentkit chat --message "Inspect PR 42" --json
150
+ agentkit chat --prod --slug pr-approver --team 123
93
151
  ```
94
152
 
95
- Streams the reply live: text, tool calls, and a per-turn usage footer.
96
- `--json` requires `--message` and prints
153
+ `chat` streams text, tool calls, and a per-turn usage footer.
154
+ On a TTY, `--message` seeds the interactive REPL. With non-TTY input,
155
+ `--message` runs one turn and exits; without it, `chat` reads
156
+ newline-delimited messages until EOF. `--json` requires `--message`,
157
+ runs one turn, and prints
97
158
  `{ ok, sessionId, continuationToken, trajectory }`. `--text` prints a
98
- compact dump, and `--no-color` forces plain output.
159
+ compact trajectory when combined with `--json`. `--no-color` forces
160
+ plain interactive output.
161
+
162
+ Use `--session <id>` to reattach a stored session. The command looks up
163
+ its continuation token when you omit `--continuation-token`. Use
164
+ `--resume` to select the most recently updated session with a
165
+ continuation token.
99
166
 
100
167
  ## resume
101
168
 
102
- `resume` reattaches the chat REPL to an existing session.
169
+ `resume` is the direct way to reattach the chat REPL.
170
+
171
+ ```bash
172
+ agentkit resume ses_123 --url http://127.0.0.1:3000/pr-approver
173
+ agentkit resume --url http://127.0.0.1:3000/pr-approver
174
+ agentkit resume ses_123 --prod --team 123 --slug pr-approver
175
+ agentkit resume ses_123 --message "Continue the review" --json
176
+ ```
177
+
178
+ Pass a session ID to select it. Omit the ID to select the most recently
179
+ updated followable session from `/v1/sessions`. The command looks up a
180
+ missing continuation token, replays the transcript, and accepts
181
+ follow-ups. `resume --json` requires `--message`. The same operation is
182
+ available as `chat --session <id>` or `chat --resume`.
183
+
184
+ ## logs
185
+
186
+ `logs` follows the local or hosted log buffer.
187
+
188
+ ```bash
189
+ agentkit logs [--url http://127.0.0.1:3000] [--once] [--json]
190
+ agentkit logs --prod [--slug <slug>] [--team <id>] [--once] [--json]
191
+ ```
192
+
193
+ Local mode reads `/v1/logs` from the running server. Hosted mode reports
194
+ deploy progress until the deployment is running or degraded, then
195
+ follows reachable runtime logs.
196
+ The command follows until Ctrl-C by default. `--once` prints the current
197
+ buffer and exits. `--json` emits newline-delimited JSON events.
198
+
199
+ ## sessions
200
+
201
+ `sessions` lists sessions on a running or hosted agent.
103
202
 
104
203
  ```bash
105
- agentkit resume ses_… --url http://127.0.0.1:3000/<slug>
106
- agentkit resume ses_… --prod --team 1 --slug approval-buddy
107
- agentkit resume ses_… --prod --message "continue from here"
204
+ agentkit sessions [--url <baseUrl> | --prod] [--slug <slug>]
205
+ [--team <id>] [--bearer-token <token>] [--json]
108
206
  ```
109
207
 
110
- Same as `chat --session <id>`: looks up the continuation token via
111
- `/v1/sessions` when `--continuation-token` is omitted, replays the
112
- transcript, then accepts follow-ups. Accepts the same output flags as
113
- [`chat`](#chat) (`--json`, `--text`, `--no-color`).
208
+ Text output shows session ID, channel, mode, turn count, running status,
209
+ and update time. `--json` prints full session summaries in
210
+ `{ sessions }`, including continuation tokens.
211
+
212
+ ## session
213
+
214
+ `session` inspects the event stream for one session.
215
+
216
+ ```bash
217
+ agentkit session <sessionId> [--url <baseUrl> | --prod]
218
+ [--slug <slug>] [--team <id>]
219
+ [--json | --text | --events]
220
+ ```
221
+
222
+ By default, `session` prints a compact trajectory. `--text` selects the
223
+ same format. `--json` prints the trajectory object. `--events` prints
224
+ `{ sessionId, events }` with the raw event list. You can't combine
225
+ `--events` and `--json`. Use
226
+ [`resume`](#resume) to continue the conversation.
227
+
228
+ ## playground
229
+
230
+ `playground` opens an agent's web playground.
231
+
232
+ ```bash
233
+ agentkit playground [--url <baseUrl> | --prod] [--session <id>]
234
+ [--slug <slug>] [--team <id>]
235
+ [--bearer-token <token>] [--print]
236
+ ```
237
+
238
+ `--session` opens a deep link to one session. `--print` prints the URL
239
+ without opening a browser.
240
+
241
+ For an unauthenticated local URL, `playground` opens the browser and
242
+ exits. `--prod` and `--bearer-token` start a loopback proxy to inject
243
+ browser-inaccessible credentials. The proxy stays open until Ctrl-C,
244
+ including when you pass `--print`.
114
245
 
115
246
  ## run
116
247
 
117
- `run` executes one turn on an ephemeral server and prints a JSON trajectory.
248
+ `run` sends one or more turns and prints a JSON result.
118
249
 
119
250
  ```bash
120
251
  agentkit run --dir . --message "Is https://github.com/acme/checkout/pull/42 ready?"
121
- agentkit run --dir . --message "first" --message "then this" # multi-turn
122
- agentkit run --url http://127.0.0.1:3000/<slug> --message "…" # running server
123
- agentkit run --dir . --message "…" --events /tmp/run.ndjson # custom trace path
252
+ agentkit run --dir . --message "Inspect PR 42" --message "Summarize the risks"
253
+ agentkit run --url http://127.0.0.1:3000/pr-approver --message "Inspect PR 42"
254
+ agentkit run --prod --slug pr-approver --team 123 --message "Inspect PR 42"
255
+ agentkit run --dir . --messages-file ./prompts.json
124
256
  ```
125
257
 
126
- The create-and-test loop in one command: start an ephemeral server
127
- (port 0, temp state root outside the project), send the message(s), print a
128
- JSON trajectory, and write an NDJSON trace (default
129
- `<dir>/.agentkit/traces/<sessionId>.ndjson`). Progress streams to
130
- stderr on a TTY.
131
-
132
- | Flag | Meaning |
133
- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
134
- | `--message` | The user message; repeatable for multi-turn. `--messages-file` takes a JSON array of strings. |
135
- | `--session` / `--continuation-token` | Follow up an existing session on a running server. |
136
- | `--events <file>` / `--no-events` | Override the trace path, or skip the trace. |
137
- | `--text` | Compact text output instead of JSON. |
138
- | `--timeout-ms` | Abort a hung turn. |
139
- | `--no-stream` | Silence live progress on stderr. |
140
- | `--slug` | Pick one agent when `--dir` mounts several. |
258
+ Without `--url` or `--prod`, the command starts an ephemeral server on
259
+ an available port. Its state root is a temporary directory outside the
260
+ project unless you pass `--state-root`. The command closes the server
261
+ after the turns finish.
262
+
263
+ | Flag | Meaning |
264
+ | --- | --- |
265
+ | `--message <text>` | Send a user message. Repeat the flag for a multi-turn run. |
266
+ | `--messages-file <path>` | Read a JSON array of strings. File messages run before repeated `--message` values. |
267
+ | `--session <id>` | Follow up an existing session. Unlike `chat`, `run` doesn't look up a missing continuation token. |
268
+ | `--continuation-token <token>` | Continue the existing session selected by `--session`. |
269
+ | `--events <file>` | Write the raw NDJSON event stream to this path. |
270
+ | `--no-events` | Don't write an event stream. |
271
+ | `--text` | Print a compact trajectory instead of the JSON result. |
272
+ | `--timeout-ms <n>` | Abort the turn after a positive number of milliseconds. There is no default timeout. |
273
+ | `--no-stream` | Hide live tool and reply progress on stderr. Progress is on by default when stderr is a TTY. |
274
+ | `--slug <slug>` | Pick one agent when local discovery mounts several agents. With `--prod`, select the hosted deployment. |
275
+
276
+ The default trace path is
277
+ `<dir>/.agent-serve/traces/<sessionId>.ndjson`. JSON output contains
278
+ `ok`, `sessionId`, `continuationToken`, `trace`, `playgroundUrl`,
279
+ `playgroundHint`, `visualize`, and `trajectory`. The command exits
280
+ non-zero when the trajectory fails.
141
281
 
142
282
  ## call
143
283
 
@@ -146,14 +286,24 @@ stderr on a TTY.
146
286
  ```bash
147
287
  agentkit call inspect_pr --dir . \
148
288
  --input '{"prUrl":"https://github.com/acme/checkout/pull/42"}'
149
- agentkit call inspect_pr --url http://127.0.0.1:3000/<slug> --input '{…}'
150
- agentkit call inspect_pr --dir . --input '{}' --session ses_…
289
+ agentkit call inspect_pr --url http://127.0.0.1:3000/pr-approver \
290
+ --input '{"prUrl":"https://github.com/acme/checkout/pull/42"}'
291
+ agentkit call refresh_cache --url http://127.0.0.1:3000/pr-approver \
292
+ --session ses_123
293
+ agentkit call inspect_pr --prod --slug pr-approver --team 123 --input '{}'
151
294
  ```
152
295
 
153
- Deterministic server-tool invocation through `POST /v1/tools/:toolName`:
154
- schema-validated, in-process, no model turn, no API key. `--session`
155
- runs it inside an existing session and records it on that session's
156
- stream (serializing with model turns). See
296
+ `call` sends `POST /v1/tools/:toolName` and runs the tool in the serving
297
+ process without a model turn. `--input` accepts any valid JSON and
298
+ defaults to `{}`. Tools with a Zod input schema validate and transform
299
+ the value before execution. A local call needs no inference credential.
300
+ A hosted call still needs Cursor credentials to reach the deployment.
301
+
302
+ `--session` runs the tool inside an existing session and records it on
303
+ the event stream. If a model turn is active or pending, the server
304
+ returns `session_busy`; retry after the turn finishes. The command
305
+ prints the server's JSON response and exits non-zero unless the HTTP
306
+ response succeeds with `ok: true`. See
157
307
  [Tools](./tools.md#call-a-tool-without-a-model-turn).
158
308
 
159
309
  ## eval
@@ -168,11 +318,22 @@ agentkit eval --dir . builds # every datapoint in the file
168
318
  agentkit eval --dir . --tag smoke # by tag (repeatable)
169
319
  agentkit eval --dir . --json # machine-readable results
170
320
  agentkit eval --dir . --verbose # stream t.log lines + reply snippets
321
+ agentkit eval --prod --slug pr-approver --team 123
171
322
  ```
172
323
 
173
- Runs `evals/**/*.eval.{ts,js}` on an ephemeral server, or against `--url`.
174
- Select by exact case id, file id (a prefix), several of either, tags, or
175
- nothing for all. See [Evals](../evals.md).
324
+ `eval` runs `evals/**/*.eval.{ts,js}` on an ephemeral server or against
325
+ `--url`. Select one or more exact case IDs, file ID prefixes, or tags.
326
+ Omit selectors to run all cases. Repeated `--tag` flags use OR matching.
327
+
328
+ An eval run requires `evals/evals.config.{ts,js}` with `maxConcurrency`
329
+ between 1 and 200. Timeout priority is the case's `timeoutMs`, the CLI's
330
+ `--timeout-ms`, the config's `timeoutMs`, then 180 seconds. Use
331
+ `--no-stream` to hide live progress or `--verbose` to include `t.log`
332
+ lines and reply snippets.
333
+
334
+ `--list --json` prints an array of discovered cases. A run with `--json`
335
+ prints `{ ok, passed, failed, results }`. Failed cases exit `1`; no
336
+ matching cases exit `2`. See [Evals](../evals.md).
176
337
 
177
338
  ## trajectory
178
339
 
@@ -182,8 +343,9 @@ nothing for all. See [Evals](../evals.md).
182
343
  agentkit trajectory --events /tmp/run.ndjson [--text]
183
344
  ```
184
345
 
185
- Turns any saved NDJSON event stream into the same trajectory JSON `run`
186
- prints.
346
+ `trajectory` converts a saved NDJSON stream into the trajectory JSON
347
+ returned by `run`. `--text` prints the compact view. The command exits
348
+ non-zero when the reconstructed trajectory failed.
187
349
 
188
350
  ## init
189
351
 
@@ -195,18 +357,21 @@ agentkit init ./my-agent --json # machine-readable summary for tooling
195
357
  agentkit init # no directory: print the setup guide
196
358
  ```
197
359
 
198
- The scaffold summary lists each file as `create` or `exist` (existing
199
- files are left alone) and the project folder path, then runs
200
- `npm install` so `@cursor/july` resolves for `dev` / `run`. On a TTY,
201
- on a TTY, `init` asks before installing (or updating) the package
202
- coding-agent skills into `~/.cursor/skills/agentkit/`, always overwriting
203
- with the version from the installed package (skipped for `--json` /
204
- non-interactive hosts). When the host has no Cursor credential yet,
205
- `init` runs `agentkit login` and waits for the browser sign-in to
206
- finish, then prints next steps: `cd` into the project (when needed),
207
- `agentkit login` (when still unsigned), and `agentkit dev`. `--json`
208
- still installs dependencies but never blocks on login or skill install;
209
- it prints
360
+ `init` leaves existing files unchanged and labels each one `create` or
361
+ `exist`. It prints the project path, then runs `npm install` so
362
+ `@cursor/july` resolves for `dev` and `run`.
363
+
364
+ On a TTY, `init` asks whether to install or update the coding-agent
365
+ skills in `~/.cursor/skills/agentkit/`. If accepted, it overwrites them
366
+ with the version bundled in the installed package. The prompt is skipped
367
+ for `--json` and non-interactive hosts.
368
+
369
+ If the host isn't signed in, `init` runs `agentkit login` and waits for
370
+ the browser flow. It then prints the `cd`, `agentkit login`, and
371
+ `agentkit dev` steps still needed.
372
+
373
+ With `--json`, `init` still installs dependencies but never blocks on
374
+ login or skill installation. It prints
210
375
  `{ ok, directory, created, skipped, installed, installError, next }`
211
376
  (with `login` in `next` when unsigned).
212
377
 
@@ -218,10 +383,12 @@ it prints
218
383
  agentkit info --dir . [--json]
219
384
  ```
220
385
 
221
- The discovered surface: model, instructions size, tools, skills, MCP
222
- connections, subagents, channels and their routes, schedules, hooks, and
223
- diagnostics. `--json` matches `GET /v1/info`; with multiple agents it
224
- prints one entry per slug.
386
+ `info` reports the model, instruction size, tools, skills, MCP
387
+ connections, subagents, channel routes, schedules, hooks, and
388
+ diagnostics. Text output summarizes each mounted agent. `--json` prints
389
+ `{ agents: [{ slug, ...projectInfo }] }`, with one entry per mounted
390
+ slug. Use `validate`, not `info --json`, when a script needs an error
391
+ exit status.
225
392
 
226
393
  ## validate
227
394
 
@@ -231,10 +398,9 @@ prints one entry per slug.
231
398
  agentkit validate --dir .
232
399
  ```
233
400
 
234
- Prints diagnostics per agent and exits non-zero when any has
235
- error-severity diagnostics (`serve` refuses to start in that state).
236
- Warnings (cloud runtime combined with local-only capabilities, say) print
237
- without failing it.
401
+ `validate` prints diagnostics for each agent and exits non-zero when any
402
+ diagnostic has error severity. `serve` also refuses to start when errors
403
+ are present. Warnings don't change the exit status.
238
404
 
239
405
  ## login / logout / whoami
240
406
 
@@ -248,58 +414,291 @@ agentkit logout
248
414
 
249
415
  `login` signs the host in to Cursor: browser sign-in mints a named,
250
416
  dashboard-revocable API key, and only the key is stored (the default
251
- name is `agentkit (<hostname>)`). It powers inference, the cloud
252
- runtime, and Cursor account MCP connections. `whoami` shows which credential
253
- is active and why: explicit flag, then `CURSOR_API_KEY`, then the
254
- stored login. `logout` removes the stored key.
417
+ name is `<invoked command> (<hostname>)`). It powers inference, the cloud
418
+ runtime, and Cursor account MCP connections. `--key-name` changes the
419
+ name of a browser-minted key. `login --api-key` validates and stores a
420
+ key you already created.
421
+
422
+ `whoami` shows which credential is active and why. `CURSOR_API_KEY`
423
+ takes precedence over the stored login. `logout` removes the local
424
+ credential file but doesn't revoke the API key. Revoke it in the Cursor
425
+ dashboard when it should stop working.
255
426
 
256
427
  Non-production backends: login and account RPCs honor
257
428
  `CURSOR_API_BASE_URL` while the SDK harness honors `CURSOR_BACKEND_URL`.
258
429
  Set both to the same URL, or keys minted on one backend are rejected by
259
430
  the other.
260
431
 
432
+ ## update
433
+
434
+ `update` upgrades an installed copy to the latest published version.
435
+
436
+ ```bash
437
+ agentkit update
438
+ ```
439
+
440
+ The command checks npm's `latest` tag, detects how agentkit was installed,
441
+ and runs the matching npm, pnpm, Yarn, or Bun upgrade command. It handles
442
+ global installs and project dependencies. It doesn't prompt before
443
+ running the package-manager command.
444
+
445
+ Source checkouts, `npx` or `pnpm dlx` caches, and unknown install layouts
446
+ aren't changed. The command prints a manual upgrade hint instead.
447
+
448
+ Published installs also check for a newer version at most once every 24
449
+ hours and print an update warning on stderr. Source checkouts, CI, and
450
+ commands with an explicit `--json` flag skip this automatic check.
451
+
452
+ ## deploy
453
+
454
+ `deploy` sends one or more agents to Cursor managed hosting.
455
+
456
+ ```bash
457
+ agentkit deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
458
+ [--repo <https-url>] [--ref <git-ref>] [--path <agent-path>]
459
+ [--cursor-events-repo owner/name]...
460
+ [--allow-domain <domain>]... [--no-wait] [--json]
461
+ ```
462
+
463
+ Managed hosting requires team-admin permission and the team's
464
+ cloud-agent entitlement. `--team` defaults to the signed-in account's
465
+ team.
466
+
467
+ For a single project, the slug defaults to a normalized version of the
468
+ directory name. Deployment slugs contain lowercase letters, digits, `_`,
469
+ or `-`, with a maximum of 64 characters. For a directory with several
470
+ agents, select one with `--slug`, deploy all with `--all`, or choose from
471
+ the TTY prompt. Non-interactive callers must pass `--slug` or `--all`.
472
+ If `--dir` contains no agent project or child agents, `deploy` creates a
473
+ static placeholder using `--slug` or a slug derived from the directory
474
+ name. In this case, `--all` fails.
475
+
476
+ The command infers `--repo`, `--ref`, and `--path` from the current Git
477
+ checkout when possible. Explicit flags take precedence. `--repo` must
478
+ use HTTPS. Repeat `--cursor-events-repo` to select SCM event sources.
479
+ Repeat `--allow-domain` to add engine egress domains; these values are
480
+ combined with `hosting.egressDomains` from the agent config. Egress
481
+ domains apply only to repository-backed deployments. Each domain must
482
+ be a lowercase hostname with at least two labels and an alphabetic
483
+ top-level domain. One leading `*.` wildcard is allowed. A deployment
484
+ can declare at most 20 domains.
485
+
486
+ By default, the command polls every three seconds for up to ten minutes
487
+ and succeeds only when the deployment reaches `running`. `--no-wait`
488
+ returns after the deployment request is accepted. Multi-agent deploys
489
+ run sequentially. When several agents are selected, `--path` is ignored
490
+ and each project infers its own path. A single-target `--json` run
491
+ prints one object; a multi-target run prints an array.
492
+
493
+ The first deployment can return an alias token. It appears once in text
494
+ or JSON output and can't be retrieved later. Store it as a secret. Send
495
+ it as `X-Agent-Alias-Token` when calling the stable alias URL, or use it
496
+ to sign in to the hosted playground.
497
+
498
+ See [Deployment](../deployment.md) for the hosting security model and
499
+ state layout.
500
+
501
+ ## deployments
502
+
503
+ `deployments` lists the selected team's deployments.
504
+
505
+ ```bash
506
+ agentkit deployments [--team <id>] [--json]
507
+ ```
508
+
509
+ Text output shows each slug, status, generation, deployment kind, and
510
+ update time. `--json` prints `{ deployments }`.
511
+
512
+ ## deployment
513
+
514
+ `deployment` prints the full status of one deployment.
515
+
516
+ ```bash
517
+ agentkit deployment <slug> [--team <id>] [--json]
518
+ ```
519
+
520
+ Text output includes status, generation, kind, alias, source, egress
521
+ domains, secret names, engine state, and the last error when present.
522
+ `--json` returns the full API response. It can include short-lived
523
+ `engineAccess.headers`, so handle JSON output as a credential.
524
+
525
+ ## stop
526
+
527
+ `stop` shuts down a deployment.
528
+
529
+ ```bash
530
+ agentkit stop <slug> [--team <id>] [--no-wait] [--json]
531
+ ```
532
+
533
+ The command polls for up to ten minutes until the status reaches
534
+ `stopped`. `--no-wait` returns after the stop request is accepted.
535
+
536
+ ## rotate-token
537
+
538
+ `rotate-token` replaces the alias token used by callers and the hosted
539
+ playground.
540
+
541
+ ```bash
542
+ agentkit rotate-token <slug> [--team <id>] [--json]
543
+ ```
544
+
545
+ The old token stops working immediately. The replacement is shown once.
546
+ `--json` prints `{ aliasToken }`.
547
+
548
+ ## rotate-pod-credential
549
+
550
+ `rotate-pod-credential` replaces the credential used by the running
551
+ engine pod.
552
+
553
+ ```bash
554
+ agentkit rotate-pod-credential <slug> [--team <id>] [--json]
555
+ ```
556
+
557
+ The command returns only the masked key and revokes the old credential
558
+ immediately. Redeploy at once to inject the replacement; the current
559
+ pod can't authenticate to Cursor in between.
560
+
561
+ ## secrets
562
+
563
+ `secrets` manages environment secrets for a deployment.
564
+
565
+ ```bash
566
+ agentkit secrets set <slug> NAME[=VALUE]... [--team <id>] [--json]
567
+ agentkit secrets list <slug> [--team <id>] [--json]
568
+ agentkit secrets unset <slug> NAME [--team <id>] [--json]
569
+ ```
570
+
571
+ Omit `=VALUE` from `secrets set` to enter the value at a hidden TTY
572
+ prompt. With piped stdin, provide one line for each missing value. Avoid
573
+ values in command arguments because shells can record them in history.
574
+
575
+ Secret names use `UPPER_SNAKE_CASE`, start with a letter, and contain at
576
+ most 64 characters. Names beginning with `CURSOR_` are reserved. Values
577
+ can contain at most 4096 bytes, and one deployment can hold 32 secrets.
578
+
579
+ `secrets list` returns names and creation times, never values. Secret
580
+ changes reach the engine on its next deploy. `secrets set` upserts the
581
+ named secrets without deleting others.
582
+
583
+ JSON output is `{ secretNames }` for `set`, `{ secrets }` for `list`,
584
+ and `{ removed }` for `unset`.
585
+
261
586
  ## slack
262
587
 
263
- The `slack` subcommands generate and verify the Slack side of a channel.
588
+ The `slack` pack generates and checks Socket Mode channel setup.
264
589
 
265
590
  ```bash
266
- agentkit slack setup # guided checklist
267
- agentkit slack init --dir . --name "My Agent" # channel + manifests + env.example
268
- agentkit slack init --dir . --no-prefix # shared SLACK_* vars
269
- agentkit slack init --dir . --channel-posts # + message.channels/groups events
270
- agentkit slack manifest --env dev|prod|both # regenerate manifests
271
- agentkit slack doctor --prefix MY_AGENT # token / connectivity checks
591
+ agentkit slack setup
592
+ agentkit slack init [--dir <path>] [--name <name>]
593
+ [--prefix <prefix> | --no-prefix] [--channel-posts]
594
+ agentkit slack manifest [--dir <path>] [--name <name>]
595
+ [--env dev|prod|both] [--channel-posts] [--print]
596
+ agentkit slack doctor [--prefix <prefix>] [--json]
272
597
  ```
273
598
 
599
+ `slack setup` prints a guided checklist and doesn't change files.
600
+
601
+ `slack init` creates the channel file, development and production
602
+ manifests, `env.example`, and setup status under the project. It refuses
603
+ to overwrite a target file. If a collision occurs, it exits non-zero;
604
+ files created earlier in the run remain. The token prefix defaults to
605
+ the directory basename normalized to uppercase snake case. Explicit
606
+ `--prefix` values use the same normalization when agentkit builds token
607
+ variable names. For example, `pr-approver` becomes
608
+ `PR_APPROVER_SLACK_BOT_TOKEN`. `--no-prefix` uses shared
609
+ `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`. `--channel-posts` subscribes
610
+ the manifests to channel-post events. The command always prints a JSON
611
+ summary.
612
+
613
+ `slack manifest` regenerates selected manifest files. `--env` defaults
614
+ to `both`, and `--name` defaults to the directory name. `--print` writes
615
+ the manifest JSON to stdout instead of changing files. With the default
616
+ `--env both`, it prints development JSON, a `--- prod ---` separator,
617
+ then production JSON.
618
+
619
+ `slack doctor` checks both tokens, Socket Mode connectivity, and
620
+ Slack's `auth.test`. It exits non-zero when any check fails.
621
+
274
622
  See the [Slack guide](../guides/slack.md).
275
623
 
276
624
  ## github
277
625
 
278
- The `github` subcommands test webhook channels against real repositories.
626
+ The `github` pack discovers `githubChannel()` definitions and sends live
627
+ or synthesized deliveries to them.
279
628
 
280
629
  ```bash
281
- agentkit github doctor [--install] # gh + cli/gh-webhook extension
282
- agentkit github events --dir . [--json] # per-agent URL + event list
283
- agentkit github forward --dir . [--repo owner/repo | --org ORG]
630
+ agentkit github doctor [--install] [--json]
631
+ agentkit github events [--dir <path>] [--host <host>] [--port <n>] [--json]
632
+ agentkit github forward [--dir <path>] [--slug <slug>] [--channel <id>]
633
+ [--repo owner/repo | --org <org>] [--events a,b,c] [--url <url>]
634
+ [--host <host>] [--port <n>] [--secret <secret>] [--install]
284
635
  agentkit github replay <pr-url|owner/repo#N> --dir .
285
- [--events a,b,c|'*'] [--action ] [--conclusion ] [--comment …]
286
- [--context ] [--secret ] [--dry-run] [--out DIR]
636
+ [--events a,b,c|'*'] [--action <action>] [--conclusion <result>]
637
+ [--comment <body>] [--context <name>] [--slug <slug>] [--channel <id>]
638
+ [--host <host>] [--port <n>] [--url <url>] [--secret <secret>]
639
+ [--dry-run] [--out <dir>] [--json]
287
640
  ```
288
641
 
289
- `forward` wraps `gh webhook forward`: repo admin required, and blank
290
- any env `GITHUB_TOKEN` / `GH_TOKEN` or deliveries 401. `replay`
291
- synthesizes GitHub-shaped payloads from read access only, the
292
- deterministic tier. `--slug` and `--channel` target one agent among
293
- several. See the [GitHub guide](../guides/github.md).
642
+ `github events` prints each discovered channel's delivery URL and event
643
+ set. When it finds no channels, it returns an empty result and exits
644
+ successfully.
645
+
646
+ `github forward` wraps `gh webhook forward`. It infers the repository
647
+ from the Git remote when you omit `--repo` and `--org`. URLs and events
648
+ come from the discovered channels; `--events` overrides the event set.
649
+ Use `--slug` or `--channel` to narrow discovery when several channels
650
+ match. Otherwise, one local proxy fans deliveries out to every match.
651
+ `--url` targets one channel. For `forward`, pass `--events` when no
652
+ matched channel can supply the event set.
653
+
654
+ Repository forwarding needs repo-admin access. Organization forwarding
655
+ needs org-owner access. The relay authenticates with the GitHub CLI's
656
+ stored login. A `GITHUB_TOKEN` or `GH_TOKEN` environment override can
657
+ make delivery requests return `401`, even when hook creation succeeds.
658
+ Unset those variables before forwarding.
659
+
660
+ Pass `--secret` or set `GITHUB_WEBHOOK_SECRET` to sign deliveries.
661
+ `serve --dev` accepts unsigned loopback deliveries. A non-dev target
662
+ requires the same secret on both sides.
663
+
664
+ `github replay` needs read access, not admin access. It reads the pull
665
+ request through `gh api`, builds GitHub webhook payloads, and posts them
666
+ to the selected channels. Supported events are `pull_request`,
667
+ `issue_comment`, `pull_request_review_comment`, `check_run`,
668
+ `check_suite`, `workflow_run`, and `status`. The default is
669
+ `pull_request` with action `synchronize`. Comment events need
670
+ `--comment`.
671
+
672
+ Use `--events '*'` to replay every supported event declared by the
673
+ channel. `--dry-run` prints payloads without posting them. `--out`
674
+ writes fixture files but still posts unless you also pass `--dry-run`.
675
+
676
+ `github doctor` checks `gh`, its login, and the pinned
677
+ `cli/gh-webhook` extension. `--install` installs or repairs the
678
+ extension. An environment-token override is a warning and doesn't make
679
+ `github doctor` fail.
680
+
681
+ See the [GitHub guide](../guides/github.md).
294
682
 
295
683
  ## Environment variables
296
684
 
297
- These are the most common environment variables the CLI and the
298
- channel packs read.
299
-
300
- | Variable | Meaning |
301
- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
302
- | `CURSOR_API_KEY` | The Cursor credential, checked after `--api-key` and before the stored login |
303
- | `GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY` / `GITHUB_APP_INSTALLATION_ID` | GitHub App auth for outbound API calls |
304
- | `GITHUB_TOKEN` / `GH_TOKEN` | Token auth for outbound API calls; must be blank for `github forward` |
305
- | `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN` | Slack tokens (single-agent); `<PREFIX>_SLACK_*` per agent otherwise |
685
+ These environment variables affect the CLI and its channel packs.
686
+
687
+ | Variable | Meaning |
688
+ | --- | --- |
689
+ | `CURSOR_API_KEY` | Cursor credential. It takes precedence over the stored login. |
690
+ | `CURSOR_API_BASE_URL` | Backend used by login, account, deployment, and event-relay RPCs in non-production environments. |
691
+ | `CURSOR_BACKEND_URL` | Backend used by the Cursor SDK harness in non-production environments. |
692
+ | `AGENT_SERVE_CONFIG_DIR` | Directory for stored credentials and update-check state. The default is `~/.config/agent-serve`. |
693
+ | `AGENT_SERVE_NO_UPDATE_CHECK` / `NO_UPDATE_NOTIFIER` | Disable the automatic published-version check when set to a non-empty value other than `0`. |
694
+ | `CI` | Disable the automatic published-version check when set. |
695
+ | `GITHUB_WEBHOOK_SECRET` | Default signing secret for GitHub forwarding and replay. |
696
+ | `GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY` / `GITHUB_APP_INSTALLATION_ID` | GitHub App authentication for outbound API calls. |
697
+ | `GITHUB_TOKEN` / `GH_TOKEN` | Token authentication for outbound API calls. Unset both for `github forward`. |
698
+ | `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN` | Slack tokens for one agent. Use `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN` for each agent on a multi-agent host. |
699
+
700
+ ## What's next
701
+
702
+ - [Project layout](./project-layout.md): files the CLI discovers
703
+ - [HTTP API](./http-api.md): routes used by `chat`, `call`, and other clients
704
+ - [Deployment](../deployment.md): production auth, state, and operations