@cursor/bdk 0.2.17 → 0.2.20

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 (254) hide show
  1. package/AGENTS.md +16 -6
  2. package/dist/bin/agent-serve.js +7 -0
  3. package/dist/channels/runs/index.d.ts +4 -0
  4. package/dist/channels/runs/index.d.ts.map +1 -0
  5. package/dist/channels/runs/index.js +2 -0
  6. package/dist/channels/runs/runs-channel.d.ts +5 -0
  7. package/dist/channels/runs/runs-channel.d.ts.map +1 -0
  8. package/dist/channels/runs/runs-channel.js +34 -0
  9. package/dist/channels/runs/types.d.ts +34 -0
  10. package/dist/channels/runs/types.d.ts.map +1 -0
  11. package/dist/channels/runs/types.js +1 -0
  12. package/dist/channels/slack/slack-channel.d.ts +3 -2
  13. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  14. package/dist/channels/slack/slack-channel.js +9 -2
  15. package/dist/docs/404.html +2 -2
  16. package/dist/docs/assets/{app.CUNuFTSm.js → app.BzgJFr_T.js} +4 -4
  17. package/dist/docs/assets/chunks/@localSearchIndexroot.gGwBYU3d.js +1 -0
  18. package/dist/docs/assets/chunks/{VPLocalSearchBox.Dez74k0W.js → VPLocalSearchBox.Bn5QyUDM.js} +1 -1
  19. package/dist/docs/assets/chunks/{arc.CJ3FhK7H.js → arc.D734Gm5d.js} +1 -1
  20. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CfUdbHsa.js → architectureDiagram-Q4EWVU46.NX1jj-YX.js} +1 -1
  21. package/dist/docs/assets/chunks/{baseUniq.D93LawU9.js → baseUniq.nd8dxdeO.js} +1 -1
  22. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.Zvsd6UHP.js → blockDiagram-DXYQGD6D.DG8faTim.js} +1 -1
  23. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.CGX5xZ9d.js → c4Diagram-AHTNJAMY.zD31AJ3b.js} +1 -1
  24. package/dist/docs/assets/chunks/channel.DQLJQMi3.js +1 -0
  25. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CCIf0QCo.js → chunk-4BX2VUAB.BHQj6Rko.js} +1 -1
  26. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.D_N1RPyi.js → chunk-4TB4RGXK.Cs38Yh16.js} +1 -1
  27. package/dist/docs/assets/chunks/{chunk-55IACEB6.B1oecjzx.js → chunk-55IACEB6.CFUR21JO.js} +1 -1
  28. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BzUNVPGX.js → chunk-EDXVE4YY.C80-Sneg.js} +1 -1
  29. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DheI8WSO.js → chunk-FMBD7UC4.CdT1MGza.js} +1 -1
  30. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Bg4iL0sM.js → chunk-OYMX7WX6.BctEzab0.js} +1 -1
  31. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.CSQjDhAD.js → chunk-QZHKN3VN.DTneeX3k.js} +1 -1
  32. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BDdxnPU4.js → chunk-YZCP3GAM.Cz47F_-o.js} +1 -1
  33. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.j55aerUT.js +1 -0
  34. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.j55aerUT.js +1 -0
  35. package/dist/docs/assets/chunks/clone.XimRS84I.js +1 -0
  36. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.AT0weO8r.js → cose-bilkent-S5V4N54A.BPYgB-_O.js} +1 -1
  37. package/dist/docs/assets/chunks/{dagre-KV5264BT.CJ30TxV0.js → dagre-KV5264BT.Cu6hECod.js} +1 -1
  38. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.KtE--1fW.js → diagram-5BDNPKRD.BMgp95Tz.js} +1 -1
  39. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BFGygSUQ.js → diagram-G4DWMVQ6.towWdhDi.js} +1 -1
  40. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BLU-79eb.js → diagram-MMDJMWI5.D9IfOvE9.js} +1 -1
  41. package/dist/docs/assets/chunks/{diagram-TYMM5635.CdjfJdVG.js → diagram-TYMM5635.NTX57RPu.js} +1 -1
  42. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.Dj1Iwypl.js → erDiagram-SMLLAGMA.DIQLqDqu.js} +1 -1
  43. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BXqj_Su2.js → flowDiagram-DWJPFMVM.DhqpItRe.js} +1 -1
  44. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.CNfgGSst.js → ganttDiagram-T4ZO3ILL.B998R3Ps.js} +1 -1
  45. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.2tgvFDBr.js → gitGraphDiagram-UUTBAWPF.B45nTn8-.js} +1 -1
  46. package/dist/docs/assets/chunks/{graph.CWHZMxx6.js → graph.DPseWzzM.js} +1 -1
  47. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.DhLIK8m1.js → infoDiagram-42DDH7IO._GhhBBai.js} +1 -1
  48. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.BIN11n1G.js → ishikawaDiagram-UXIWVN3A.CTUMcaMM.js} +1 -1
  49. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BARmNJ0n.js → journeyDiagram-VCZTEJTY.DkJBUddC.js} +1 -1
  50. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.BrTJYFyF.js → kanban-definition-6JOO6SKY.B5Q3uwhy.js} +1 -1
  51. package/dist/docs/assets/chunks/{layout.CPZIIywK.js → layout.CDY13IKh.js} +1 -1
  52. package/dist/docs/assets/chunks/{linear.DTpmzI5S.js → linear.BPd1ql9p.js} +1 -1
  53. package/dist/docs/assets/chunks/{min.BBLQmXwZ.js → min.dlGuqIBP.js} +1 -1
  54. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.5qkWJvdl.js → mindmap-definition-QFDTVHPH.Cp7zCtmb.js} +1 -1
  55. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.-4wufv_f.js → pieDiagram-DEJITSTG.CRH034nu.js} +1 -1
  56. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.C0jrp1-8.js → quadrantDiagram-34T5L4WZ.BspgZ-pX.js} +1 -1
  57. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DUDpANfe.js → requirementDiagram-MS252O5E.CQZqZ0nZ.js} +1 -1
  58. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.74Lvg6Gu.js → sankeyDiagram-XADWPNL6.DllwFU3k.js} +1 -1
  59. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BHDIH286.js → sequenceDiagram-FGHM5R23.B5fTXycf.js} +1 -1
  60. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.Dr-HIuLb.js → stateDiagram-FHFEXIEX.12GQjmbD.js} +1 -1
  61. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Ctv5WEMu.js +1 -0
  62. package/dist/docs/assets/chunks/{theme.H8zSBhlM.js → theme.BgocqONV.js} +2 -2
  63. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.GtyCaSiL.js → timeline-definition-GMOUNBTQ.DXKUL5rH.js} +1 -1
  64. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.DLId0rxH.js → vennDiagram-DHZGUBPP.BrsjYCjp.js} +1 -1
  65. package/dist/docs/assets/chunks/wardley-RL74JXVD.DZDndEXQ.js +162 -0
  66. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CI6mGYNG.js → wardleyDiagram-NUSXRM2D.C4oM69gv.js} +1 -1
  67. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CG1n865F.js → xychartDiagram-5P7HB3ND.qzHH9efW.js} +1 -1
  68. package/dist/docs/assets/{deployment.md.ajc3VM0m.js → deployment.md.D0uprX2p.js} +3 -3
  69. package/dist/docs/assets/{deployment.md.ajc3VM0m.lean.js → deployment.md.D0uprX2p.lean.js} +1 -1
  70. package/dist/docs/assets/{guides_agent-to-agent.md.Cps5NiCV.js → guides_agent-to-agent.md.CwL5cwuE.js} +6 -5
  71. package/dist/docs/assets/{guides_agent-to-agent.md.Cps5NiCV.lean.js → guides_agent-to-agent.md.CwL5cwuE.lean.js} +1 -1
  72. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +55 -0
  73. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +1 -0
  74. package/dist/docs/assets/{guides_opentelemetry.md.jcPNrQbH.js → guides_opentelemetry.md.BHPm32OR.js} +3 -3
  75. package/dist/docs/assets/{guides_opentelemetry.md.jcPNrQbH.lean.js → guides_opentelemetry.md.BHPm32OR.lean.js} +1 -1
  76. package/dist/docs/assets/{index.md.CHAFTf6m.js → index.md.CAnsLl8D.js} +2 -2
  77. package/dist/docs/assets/{index.md.CHAFTf6m.lean.js → index.md.CAnsLl8D.lean.js} +1 -1
  78. package/dist/docs/assets/{reference_cli.md.Bt3sAfat.js → reference_cli.md.Bkrsce22.js} +7 -4
  79. package/dist/docs/assets/{reference_cli.md.Bt3sAfat.lean.js → reference_cli.md.Bkrsce22.lean.js} +1 -1
  80. package/dist/docs/assets/{reference_connections.md.CxbLpaaP.js → reference_connections.md.BJE2Zllp.js} +4 -4
  81. package/dist/docs/assets/{reference_connections.md.CxbLpaaP.lean.js → reference_connections.md.BJE2Zllp.lean.js} +1 -1
  82. package/dist/docs/assets/{reference_hooks.md.DbJC8mcZ.js → reference_hooks.md.CP3FENFJ.js} +1 -1
  83. package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +4 -0
  84. package/dist/docs/assets/reference_memory.md.BwyJXYZe.lean.js +1 -0
  85. package/dist/docs/assets/{reference_skills.md.Ckddg6KX.js → reference_skills.md.C2GWh7g8.js} +3 -3
  86. package/dist/docs/building-with-agents.html +35 -35
  87. package/dist/docs/deployment.html +38 -38
  88. package/dist/docs/deployment.md +17 -0
  89. package/dist/docs/evals.html +35 -35
  90. package/dist/docs/guides/agent-to-agent.html +41 -40
  91. package/dist/docs/guides/agent-to-agent.md +34 -21
  92. package/dist/docs/guides/bitbucket.html +35 -35
  93. package/dist/docs/guides/cloud-agents.html +35 -35
  94. package/dist/docs/guides/convert-automation.html +35 -35
  95. package/dist/docs/guides/export-grokbot.html +114 -0
  96. package/dist/docs/guides/export-grokbot.md +239 -0
  97. package/dist/docs/guides/github.html +35 -35
  98. package/dist/docs/guides/gitlab.html +35 -35
  99. package/dist/docs/guides/grokbot-agents.html +35 -35
  100. package/dist/docs/guides/hooks.html +35 -35
  101. package/dist/docs/guides/improve.html +35 -35
  102. package/dist/docs/guides/jev.html +35 -35
  103. package/dist/docs/guides/mcp-oauth.html +35 -35
  104. package/dist/docs/guides/migrate.html +36 -36
  105. package/dist/docs/guides/opentelemetry.html +37 -37
  106. package/dist/docs/guides/opentelemetry.md +19 -0
  107. package/dist/docs/guides/slack.html +35 -35
  108. package/dist/docs/guides/webhooks.html +35 -35
  109. package/dist/docs/hashmap.json +1 -1
  110. package/dist/docs/hillclimbing.html +35 -35
  111. package/dist/docs/index.html +37 -37
  112. package/dist/docs/index.md +3 -0
  113. package/dist/docs/llms-full.txt +493 -29
  114. package/dist/docs/llms.txt +2 -0
  115. package/dist/docs/quickstart.html +35 -35
  116. package/dist/docs/reference/agent-config.html +35 -35
  117. package/dist/docs/reference/artifacts.html +35 -35
  118. package/dist/docs/reference/channels.html +35 -35
  119. package/dist/docs/reference/cli.html +41 -38
  120. package/dist/docs/reference/cli.md +39 -1
  121. package/dist/docs/reference/connections.html +38 -38
  122. package/dist/docs/reference/connections.md +16 -6
  123. package/dist/docs/reference/evals.html +36 -36
  124. package/dist/docs/reference/extensions.html +35 -35
  125. package/dist/docs/reference/hooks.html +38 -38
  126. package/dist/docs/reference/hooks.md +2 -1
  127. package/dist/docs/reference/http-api.html +35 -35
  128. package/dist/docs/reference/instructions.html +35 -35
  129. package/dist/docs/reference/memory.html +63 -0
  130. package/dist/docs/reference/memory.md +114 -0
  131. package/dist/docs/reference/playground.html +35 -35
  132. package/dist/docs/reference/project-layout.html +35 -35
  133. package/dist/docs/reference/prompt.html +35 -35
  134. package/dist/docs/reference/schedules.html +35 -35
  135. package/dist/docs/reference/sessions.html +35 -35
  136. package/dist/docs/reference/skills.html +38 -38
  137. package/dist/docs/reference/subagents.html +35 -35
  138. package/dist/docs/reference/tools.html +35 -35
  139. package/dist/docs/templates/agentic-owners.html +35 -35
  140. package/dist/docs/templates/grokbot-agents.html +35 -35
  141. package/dist/docs/templates/security-reviewer.html +35 -35
  142. package/dist/docs/templates/thermo-quality-review.html +35 -35
  143. package/dist/docs/templates/thermo-review.html +35 -35
  144. package/dist/docs/templates/triage.html +35 -35
  145. package/dist/docs/troubleshooting.html +35 -35
  146. package/dist/evals.d.ts +1 -1
  147. package/dist/evals.js +1 -1
  148. package/dist/extensions/cursor-cloud-agents/extension.d.ts +2 -2
  149. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
  150. package/dist/extensions/cursor-cloud-agents/extension.js +1 -1
  151. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts +8 -1
  152. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -1
  153. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +10 -1
  154. package/dist/internal/cli-ax.d.ts +7 -7
  155. package/dist/internal/cli-ax.d.ts.map +1 -1
  156. package/dist/internal/cli-ax.js +36 -15
  157. package/dist/internal/cli-deploy.d.ts.map +1 -1
  158. package/dist/internal/cli-deploy.js +0 -14
  159. package/dist/internal/cloud-turn-usage.d.ts +34 -0
  160. package/dist/internal/cloud-turn-usage.d.ts.map +1 -0
  161. package/dist/internal/cloud-turn-usage.js +94 -0
  162. package/dist/internal/continuation-channel.d.ts.map +1 -1
  163. package/dist/internal/continuation-channel.js +6 -0
  164. package/dist/internal/continuation-identity.d.ts +6 -3
  165. package/dist/internal/continuation-identity.d.ts.map +1 -1
  166. package/dist/internal/continuation-identity.js +43 -0
  167. package/dist/internal/estimate-cost.d.ts +55 -0
  168. package/dist/internal/estimate-cost.d.ts.map +1 -0
  169. package/dist/internal/{turn-cost.js → estimate-cost.js} +18 -26
  170. package/dist/internal/event-log.d.ts +2 -2
  171. package/dist/internal/event-log.js +2 -2
  172. package/dist/internal/http-channel.d.ts.map +1 -1
  173. package/dist/internal/http-channel.js +21 -2
  174. package/dist/internal/http-control-plane-session.d.ts +5 -2
  175. package/dist/internal/http-control-plane-session.d.ts.map +1 -1
  176. package/dist/internal/http-control-plane-session.js +38 -2
  177. package/dist/internal/init-scaffold.d.ts.map +1 -1
  178. package/dist/internal/init-scaffold.js +3 -4
  179. package/dist/internal/model-config.d.ts +7 -0
  180. package/dist/internal/model-config.d.ts.map +1 -0
  181. package/dist/internal/model-config.js +67 -0
  182. package/dist/internal/otel/collector.d.ts +3 -3
  183. package/dist/internal/otel/collector.d.ts.map +1 -1
  184. package/dist/internal/otel/collector.js +8 -21
  185. package/dist/internal/otel/computer-use-attrs.d.ts +13 -0
  186. package/dist/internal/otel/computer-use-attrs.d.ts.map +1 -0
  187. package/dist/internal/otel/computer-use-attrs.js +29 -0
  188. package/dist/internal/peer-connections.d.ts +17 -8
  189. package/dist/internal/peer-connections.d.ts.map +1 -1
  190. package/dist/internal/peer-connections.js +41 -10
  191. package/dist/internal/request-error-status.d.ts.map +1 -1
  192. package/dist/internal/request-error-status.js +4 -1
  193. package/dist/internal/resolved-connections.d.ts +4 -1
  194. package/dist/internal/resolved-connections.d.ts.map +1 -1
  195. package/dist/internal/resolved-connections.js +9 -4
  196. package/dist/internal/sdk-runner.d.ts.map +1 -1
  197. package/dist/internal/sdk-runner.js +16 -14
  198. package/dist/internal/server.d.ts.map +1 -1
  199. package/dist/internal/server.js +2 -1
  200. package/dist/internal/session-cost.d.ts +21 -22
  201. package/dist/internal/session-cost.d.ts.map +1 -1
  202. package/dist/internal/session-cost.js +38 -46
  203. package/dist/internal/session-engine.d.ts +25 -41
  204. package/dist/internal/session-engine.d.ts.map +1 -1
  205. package/dist/internal/session-engine.js +130 -122
  206. package/dist/internal/sessions-client.d.ts +13 -1
  207. package/dist/internal/sessions-client.d.ts.map +1 -1
  208. package/dist/internal/sessions-client.js +24 -0
  209. package/dist/internal/storage-coordinator.d.ts +9 -9
  210. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  211. package/dist/internal/storage-coordinator.js +116 -36
  212. package/dist/internal/testing/factory-resource-fixtures.d.ts +16 -0
  213. package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -1
  214. package/dist/internal/testing/factory-resource-fixtures.js +14 -0
  215. package/dist/internal/trajectory.d.ts +5 -6
  216. package/dist/internal/trajectory.d.ts.map +1 -1
  217. package/dist/internal/trajectory.js +1 -13
  218. package/dist/memory.d.ts +5 -2
  219. package/dist/memory.d.ts.map +1 -1
  220. package/dist/memory.js +1 -1
  221. package/dist/playground/assets/cursor-icons-16-gwXtdAvu.woff2 +0 -0
  222. package/dist/playground/assets/index-C77_FdOx.css +1 -0
  223. package/dist/playground/assets/index-CvzI2lhj.js +71 -0
  224. package/dist/playground/index.html +2 -2
  225. package/dist/types.d.ts +57 -22
  226. package/dist/types.d.ts.map +1 -1
  227. package/docs/README.md +3 -0
  228. package/docs/deployment.md +17 -0
  229. package/docs/guides/agent-to-agent.md +34 -21
  230. package/docs/guides/export-grokbot.md +244 -0
  231. package/docs/guides/opentelemetry.md +19 -0
  232. package/docs/reference/cli.md +39 -1
  233. package/docs/reference/connections.md +16 -6
  234. package/docs/reference/hooks.md +2 -1
  235. package/docs/reference/memory.md +119 -0
  236. package/package.json +13 -5
  237. package/templates/agentic-owners/bot/lib/owners/matching.ts +57 -2
  238. package/dist/docs/assets/chunks/@localSearchIndexroot.3c56VHUt.js +0 -1
  239. package/dist/docs/assets/chunks/channel.S8-FFjmE.js +0 -1
  240. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BB98tFjZ.js +0 -1
  241. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BB98tFjZ.js +0 -1
  242. package/dist/docs/assets/chunks/clone.B98w8OEv.js +0 -1
  243. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DW_lwpZY.js +0 -1
  244. package/dist/docs/assets/chunks/wardley-RL74JXVD.CSlECTHi.js +0 -162
  245. package/dist/internal/cloud-turn-cost.d.ts +0 -42
  246. package/dist/internal/cloud-turn-cost.d.ts.map +0 -1
  247. package/dist/internal/cloud-turn-cost.js +0 -120
  248. package/dist/internal/turn-cost.d.ts +0 -41
  249. package/dist/internal/turn-cost.d.ts.map +0 -1
  250. package/dist/playground/assets/cursor-icons-16-4RnoYH3n.woff2 +0 -0
  251. package/dist/playground/assets/index-7fVUOA5l.css +0 -1
  252. package/dist/playground/assets/index-U3TRnwAP.js +0 -71
  253. /package/dist/docs/assets/{reference_hooks.md.DbJC8mcZ.lean.js → reference_hooks.md.CP3FENFJ.lean.js} +0 -0
  254. /package/dist/docs/assets/{reference_skills.md.Ckddg6KX.lean.js → reference_skills.md.C2GWh7g8.lean.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{_ as t,c as s,o as a,a3 as n}from"./chunks/framework.BNw1pucY.js";const o="/docs/architecture.svg",m=JSON.parse('{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK).","frontmatter":{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK)."},"headers":[],"relativePath":"index.md","filePath":"README.md"}'),r={name:"index.md"};function i(p,e,l,d,c,h){return a(),s("div",null,[...e[0]||(e[0]=[n('<h1 id="bot-development-kit-bdk" tabindex="-1">Bot Development Kit (BDK) <a class="header-anchor" href="#bot-development-kit-bdk" aria-label="Permalink to &quot;Bot Development Kit (BDK)&quot;">​</a></h1><p>The Bot Development Kit (BDK) lets you define, test, and deploy agents as code. It uses the Cursor SDK harness that powers Bugbot, Security Review, Approval Bot, and Rollouts.</p><p>A BDK project is a folder of Markdown and TypeScript. Combine deterministic code with model judgment, then make the bot or agent available in source control, Slack, issue trackers, and Cursor.</p><h2 id="why-use-it" tabindex="-1">Why use it <a class="header-anchor" href="#why-use-it" aria-label="Permalink to &quot;Why use it&quot;">​</a></h2><ul><li><p><strong>Bots and agents live in your repo.</strong> Instructions, tools, and evals are files you review, version, and ship like the rest of your code.</p></li><li><p><strong>Cursor runs the loop.</strong> You write the instructions and tools. Your agent gets Cursor&#39;s models, tool calling, skills, MCP, and subagents. Each turn runs on your host.</p></li><li><p><strong>Use it where you work.</strong> Trigger a project from source-control events, Slack threads, custom webhooks, or schedules.</p></li><li><p><strong>Test normal TypeScript.</strong> Add evals and unit tests without a separate configuration language.</p></li><li><p><strong>Choose where it runs.</strong> Deploy to Cursor-managed hosting or run the process on your infrastructure.</p></li></ul><h2 id="when-to-use-bdk" tabindex="-1">When to use BDK <a class="header-anchor" href="#when-to-use-bdk" aria-label="Permalink to &quot;When to use BDK&quot;">​</a></h2><table tabindex="0"><thead><tr><th></th><th>Cursor Automations</th><th>Grok Bot</th><th>BDK</th></tr></thead><tbody><tr><td><strong>Use for</strong></td><td>Repeatable jobs driven by a prompt and a trigger</td><td>Interactive agents that work with you in Cursor</td><td>Agents that need custom code, integrations, tests, or deployment choices</td></tr><tr><td><strong>You define</strong></td><td>A prompt, model, and trigger in the dashboard</td><td>Instructions, skills, and connected tools in the app</td><td>A versioned Markdown and TypeScript project</td></tr><tr><td><strong>Where it runs</strong></td><td>Cursor-managed</td><td>Cursor-managed</td><td>Cursor-managed hosting or your infrastructure</td></tr><tr><td><strong>Choose it when</strong></td><td>The job fits a schedule or event trigger</td><td>You want an agent you can configure and talk to without creating a software project</td><td>You want deterministic code around model judgment and a project your team can review and test</td></tr></tbody></table><h2 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to &quot;Architecture&quot;">​</a></h2><p>Define the project in source control. Run execution, inference, and sandboxing on Cursor infrastructure or on your own host.</p><p><img src="'+o+`" alt="BDK architecture: you bring the agent as code, and the platform provides triggers, runtime, integrations, and operations"></p><h2 id="get-started" tabindex="-1">Get started <a class="header-anchor" href="#get-started" aria-label="Permalink to &quot;Get started&quot;">​</a></h2><p>Install <code>@cursor/bdk</code>, then start with <code>bdk init</code> and <code>bdk dev</code>.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>npm install --global @cursor/bdk</span></span>
1
+ import{_ as t,c as a,o as s,a3 as n}from"./chunks/framework.BNw1pucY.js";const o="/docs/architecture.svg",m=JSON.parse('{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK).","frontmatter":{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK)."},"headers":[],"relativePath":"index.md","filePath":"README.md"}'),r={name:"index.md"};function i(p,e,l,d,c,h){return s(),a("div",null,[...e[0]||(e[0]=[n('<h1 id="bot-development-kit-bdk" tabindex="-1">Bot Development Kit (BDK) <a class="header-anchor" href="#bot-development-kit-bdk" aria-label="Permalink to &quot;Bot Development Kit (BDK)&quot;">​</a></h1><p>The Bot Development Kit (BDK) lets you define, test, and deploy agents as code. It uses the Cursor SDK harness that powers Bugbot, Security Review, Approval Bot, and Rollouts.</p><p>A BDK project is a folder of Markdown and TypeScript. Combine deterministic code with model judgment, then make the bot or agent available in source control, Slack, issue trackers, and Cursor.</p><h2 id="why-use-it" tabindex="-1">Why use it <a class="header-anchor" href="#why-use-it" aria-label="Permalink to &quot;Why use it&quot;">​</a></h2><ul><li><p><strong>Bots and agents live in your repo.</strong> Instructions, tools, and evals are files you review, version, and ship like the rest of your code.</p></li><li><p><strong>Cursor runs the loop.</strong> You write the instructions and tools. Your agent gets Cursor&#39;s models, tool calling, skills, MCP, and subagents. Each turn runs on your host.</p></li><li><p><strong>Use it where you work.</strong> Trigger a project from source-control events, Slack threads, custom webhooks, or schedules.</p></li><li><p><strong>Test normal TypeScript.</strong> Add evals and unit tests without a separate configuration language.</p></li><li><p><strong>Choose where it runs.</strong> Deploy to Cursor-managed hosting or run the process on your infrastructure.</p></li></ul><h2 id="when-to-use-bdk" tabindex="-1">When to use BDK <a class="header-anchor" href="#when-to-use-bdk" aria-label="Permalink to &quot;When to use BDK&quot;">​</a></h2><table tabindex="0"><thead><tr><th></th><th>Cursor Automations</th><th>Grok Bot</th><th>BDK</th></tr></thead><tbody><tr><td><strong>Use for</strong></td><td>Repeatable jobs driven by a prompt and a trigger</td><td>Interactive agents that work with you in Cursor</td><td>Agents that need custom code, integrations, tests, or deployment choices</td></tr><tr><td><strong>You define</strong></td><td>A prompt, model, and trigger in the dashboard</td><td>Instructions, skills, and connected tools in the app</td><td>A versioned Markdown and TypeScript project</td></tr><tr><td><strong>Where it runs</strong></td><td>Cursor-managed</td><td>Cursor-managed</td><td>Cursor-managed hosting or your infrastructure</td></tr><tr><td><strong>Choose it when</strong></td><td>The job fits a schedule or event trigger</td><td>You want an agent you can configure and talk to without creating a software project</td><td>You want deterministic code around model judgment and a project your team can review and test</td></tr></tbody></table><h2 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to &quot;Architecture&quot;">​</a></h2><p>Define the project in source control. Run execution, inference, and sandboxing on Cursor infrastructure or on your own host.</p><p><img src="'+o+`" alt="BDK architecture: you bring the agent as code, and the platform provides triggers, runtime, integrations, and operations"></p><h2 id="get-started" tabindex="-1">Get started <a class="header-anchor" href="#get-started" aria-label="Permalink to &quot;Get started&quot;">​</a></h2><p>Install <code>@cursor/bdk</code>, then start with <code>bdk init</code> and <code>bdk dev</code>.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>npm install --global @cursor/bdk</span></span>
2
2
  <span class="line"><span>bdk init ./my-bot</span></span>
3
3
  <span class="line"><span>cd my-bot</span></span>
4
4
  <span class="line"><span>bdk dev</span></span></code></pre></div><p>Open the project in Cursor. BDK projects use <code>bot/</code>.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>my-bot/</span></span>
@@ -24,4 +24,4 @@ import{_ as t,c as s,o as a,a3 as n}from"./chunks/framework.BNw1pucY.js";const o
24
24
  <span class="line"><span>│ └── hooks/</span></span>
25
25
  <span class="line"><span>│ └── audit.ts # observe session events</span></span>
26
26
  <span class="line"><span>└── evals/</span></span>
27
- <span class="line"><span> └── readiness.eval.ts # regression checks</span></span></code></pre></div><p>Describe your bot or agent in Cursor, or edit the files yourself.</p><h2 id="next-steps" tabindex="-1">Next steps <a class="header-anchor" href="#next-steps" aria-label="Permalink to &quot;Next steps&quot;">​</a></h2><ul><li><p><a href="./quickstart.html">Build your first PR reviewer</a>: a working GitHub reviewer, one step at a time.</p></li><li><p>Start from a template: <a href="./templates/grokbot-agents.html">Grok Bot agents</a>, <a href="./templates/security-reviewer.html">security reviewer</a>, <a href="./templates/thermo-review.html">Thermo review</a>, <a href="./templates/thermo-quality-review.html">Thermo quality review</a>, <a href="./templates/agentic-owners.html">owners-policy approver</a>, <a href="./templates/triage.html">issue triager</a>.</p></li><li><p><a href="./guides/convert-automation.html">Convert a Cursor Automation</a>: export an Automation from the dashboard into a project you own.</p></li><li><p><a href="./building-with-agents.html">Build agents with agents</a>: hand the build to a coding agent with the package&#39;s bundled skills.</p></li><li><p><a href="./reference/project-layout.html">Project layout</a> and <a href="./reference/cli.html">CLI</a>: every folder and every command.</p></li></ul>`,18)])])}const g=t(r,[["render",i]]);export{m as __pageData,g as default};
27
+ <span class="line"><span> └── readiness.eval.ts # regression checks</span></span></code></pre></div><p>Describe your bot or agent in Cursor, or edit the files yourself.</p><h2 id="next-steps" tabindex="-1">Next steps <a class="header-anchor" href="#next-steps" aria-label="Permalink to &quot;Next steps&quot;">​</a></h2><ul><li><p><a href="./quickstart.html">Build your first PR reviewer</a>: a working GitHub reviewer, one step at a time.</p></li><li><p>Start from a template: <a href="./templates/grokbot-agents.html">Grok Bot agents</a>, <a href="./templates/security-reviewer.html">security reviewer</a>, <a href="./templates/thermo-review.html">Thermo review</a>, <a href="./templates/thermo-quality-review.html">Thermo quality review</a>, <a href="./templates/agentic-owners.html">owners-policy approver</a>, <a href="./templates/triage.html">issue triager</a>.</p></li><li><p><a href="./guides/convert-automation.html">Convert a Cursor Automation</a>: export an Automation from the dashboard into a project you own.</p></li><li><p><a href="./guides/export-grokbot.html">Export a Grok Bot</a>: turn a recipe into a BDK project and review what needs manual setup.</p></li><li><p><a href="./building-with-agents.html">Build agents with agents</a>: hand the build to a coding agent with the package&#39;s bundled skills.</p></li><li><p><a href="./reference/project-layout.html">Project layout</a> and <a href="./reference/cli.html">CLI</a>: every folder and every command.</p></li></ul>`,18)])])}const g=t(r,[["render",i]]);export{m as __pageData,g as default};
@@ -1 +1 @@
1
- import{_ as t,c as s,o as a,a3 as n}from"./chunks/framework.BNw1pucY.js";const o="/docs/architecture.svg",m=JSON.parse('{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK).","frontmatter":{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK)."},"headers":[],"relativePath":"index.md","filePath":"README.md"}'),r={name:"index.md"};function i(p,e,l,d,c,h){return a(),s("div",null,[...e[0]||(e[0]=[n("",18)])])}const g=t(r,[["render",i]]);export{m as __pageData,g as default};
1
+ import{_ as t,c as a,o as s,a3 as n}from"./chunks/framework.BNw1pucY.js";const o="/docs/architecture.svg",m=JSON.parse('{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK).","frontmatter":{"title":"Bot Development Kit (BDK)","description":"Build, test, and deploy bots and agents as code with the Bot Development Kit (BDK)."},"headers":[],"relativePath":"index.md","filePath":"README.md"}'),r={name:"index.md"};function i(p,e,l,d,c,h){return s(),a("div",null,[...e[0]||(e[0]=[n("",18)])])}const g=t(r,[["render",i]]);export{m as __pageData,g as default};
@@ -1,4 +1,4 @@
1
- import{_ as t,c as a,o,a3 as s}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status.","frontmatter":{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status."},"headers":[],"relativePath":"reference/cli.md","filePath":"reference/cli.md"}'),d={name:"reference/cli.md"};function n(c,e,r,i,l,p){return o(),a("div",null,[...e[0]||(e[0]=[s(`<h1 id="bdk-cli" tabindex="-1">BDK CLI <a class="header-anchor" href="#bdk-cli" aria-label="Permalink to &quot;BDK CLI&quot;">​</a></h1><p>The Bot Development Kit (BDK) is published as <code>@cursor/bdk</code> with the <code>bdk</code> CLI.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk &lt;command&gt;</span></span></code></pre></div><p>The command catalog below documents the <code>bdk</code> binary from <code>@cursor/bdk</code>. Run it with Node 22.13 or newer; Bun is not supported. Commands exit nonzero when validation or a synchronous request fails; asynchronous commands can exit <code>0</code> once work is accepted. Project paths use the <a href="./project-layout.html">BDK project layout</a>.</p><p>Install <code>@cursor/bdk</code> to obtain the binary. <code>bdk help</code> prints top-level help; the Slack, GitHub, GitLab, and Bitbucket command packs provide their own <code>help</code> subcommands.</p><h2 id="command-catalog" tabindex="-1">Command catalog <a class="header-anchor" href="#command-catalog" aria-label="Permalink to &quot;Command catalog&quot;">​</a></h2><h3 id="development-commands" tabindex="-1">Development commands <a class="header-anchor" href="#development-commands" aria-label="Permalink to &quot;Development commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><code>help</code>, <code>--help</code>, <code>-h</code></td><td>Print top-level help</td></tr><tr><td><a href="#serve"><code>serve</code></a></td><td>Serve one or more agents over HTTP</td></tr><tr><td><a href="#dev"><code>dev</code></a></td><td>Serve agents with local-development behavior</td></tr><tr><td><a href="#docs"><code>docs</code></a></td><td>Serve the documentation bundled with <code>@cursor/bdk</code></td></tr><tr><td><a href="#init"><code>init</code></a></td><td>Scaffold a BDK project</td></tr><tr><td><a href="#convert-automation"><code>convert-automation</code></a></td><td>Export a Cursor Automation into a project</td></tr><tr><td><a href="#migrate"><code>migrate</code></a></td><td>Move an early-alpha project to architecture v2 through a pull request</td></tr><tr><td><a href="#install-skills"><code>install-skills</code></a></td><td>Refresh the bundled coding-agent skills</td></tr><tr><td><a href="#info"><code>info</code></a></td><td>Print the discovered project surface</td></tr><tr><td><a href="#validate"><code>validate</code></a></td><td>Check project diagnostics and set the exit status</td></tr><tr><td><a href="#manifest"><code>manifest</code></a></td><td>Print deployment metadata as JSON</td></tr><tr><td><a href="#version"><code>version</code></a></td><td>Print the installed package version</td></tr><tr><td><a href="#update"><code>update</code></a></td><td>Upgrade the installed CLI</td></tr><tr><td><a href="#login-logout-whoami"><code>login</code></a></td><td>Sign the host in to Cursor</td></tr><tr><td><a href="#login-logout-whoami"><code>logout</code></a></td><td>Remove the stored Cursor credential</td></tr><tr><td><a href="#login-logout-whoami"><code>whoami</code></a></td><td>Show the active Cursor credential</td></tr></tbody></table><h3 id="session-and-eval-commands" tabindex="-1">Session and eval commands <a class="header-anchor" href="#session-and-eval-commands" aria-label="Permalink to &quot;Session and eval commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><a href="#chat"><code>chat</code></a></td><td>Talk to a running agent</td></tr><tr><td><a href="#resume"><code>resume</code></a></td><td>Reattach chat to a previous session</td></tr><tr><td><a href="#run"><code>run</code></a></td><td>Start or continue work on a local, running, or hosted agent</td></tr><tr><td><a href="#call"><code>call</code></a></td><td>Call a server tool without a model turn</td></tr><tr><td><a href="#skill"><code>skill</code></a></td><td>Read an authored skill without a model turn</td></tr><tr><td><a href="#logs"><code>logs</code></a></td><td>Follow or dump agent logs</td></tr><tr><td><a href="#sessions"><code>sessions</code></a></td><td>List sessions</td></tr><tr><td><a href="#session"><code>session</code></a></td><td>Inspect a session or start a hosted session turn</td></tr><tr><td><a href="#cost"><code>cost</code></a></td><td>Report token usage and estimated cost</td></tr><tr><td><a href="#playground"><code>playground</code></a></td><td>Open an agent&#39;s playground</td></tr><tr><td><a href="#trajectory"><code>trajectory</code></a></td><td>Summarize a saved event stream</td></tr><tr><td><a href="#eval"><code>eval</code></a></td><td>List, run, inspect, or cancel evals</td></tr></tbody></table><h3 id="managed-hosting-commands" tabindex="-1">Managed hosting commands <a class="header-anchor" href="#managed-hosting-commands" aria-label="Permalink to &quot;Managed hosting commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><a href="#deploy"><code>deploy</code></a></td><td>Deploy one or more agents</td></tr><tr><td><a href="#deployments"><code>deployments</code></a></td><td>List deployments</td></tr><tr><td><a href="#deployment"><code>deployment</code></a></td><td>Inspect one deployment</td></tr><tr><td><a href="#stop"><code>stop</code></a></td><td>Stop a deployment</td></tr><tr><td><a href="#start"><code>start</code></a></td><td>Start a stopped deployment</td></tr><tr><td><a href="#kill"><code>kill</code></a></td><td>Stop a deployment, cancel its runs, and lock deploys</td></tr><tr><td><a href="#unlock-deploys"><code>unlock-deploys</code></a></td><td>Let a killed deployment deploy again</td></tr><tr><td><a href="#cancel-runs"><code>cancel-runs</code></a></td><td>Cancel active runs and reminder wakes</td></tr><tr><td><a href="#event-repos"><code>event-repos</code></a></td><td>Replace a deployment&#39;s event repositories</td></tr><tr><td><a href="#upgrade"><code>upgrade</code></a></td><td>Move a deployment to a release</td></tr><tr><td><a href="#rollback"><code>rollback</code></a></td><td>Move a deployment to an earlier release</td></tr><tr><td><a href="#delete"><code>delete</code></a></td><td>Delete a deployment</td></tr><tr><td><a href="#rotate-token"><code>rotate-token</code></a></td><td>Replace a deployment&#39;s alias token</td></tr><tr><td><a href="#secrets"><code>secrets</code></a></td><td>Set, list, or remove deployment secrets</td></tr><tr><td><a href="#images"><code>images</code></a></td><td>Push, list, or remove container images for persistent agents</td></tr></tbody></table><h3 id="connection-and-channel-commands" tabindex="-1">Connection and channel commands <a class="header-anchor" href="#connection-and-channel-commands" aria-label="Permalink to &quot;Connection and channel commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><a href="#mcp"><code>mcp</code></a></td><td>Proxy an agent&#39;s MCP endpoint over stdio</td></tr><tr><td><a href="#mcp"><code>mcp install</code></a></td><td>Add the agent to an MCP client config</td></tr><tr><td><a href="#mcp-oauth"><code>mcp oauth</code></a></td><td>Authorize an MCP connection</td></tr><tr><td><a href="#slack"><code>slack</code></a></td><td>Provision and check Slack channel apps</td></tr><tr><td><a href="#github"><code>github</code></a></td><td>Forward, replay, and inspect GitHub webhooks</td></tr><tr><td><a href="#gitlab"><code>gitlab</code></a></td><td>Replay and inspect GitLab webhooks</td></tr><tr><td><a href="#bitbucket"><code>bitbucket</code></a></td><td>Replay and inspect Bitbucket webhooks</td></tr></tbody></table><h2 id="choose-a-target" tabindex="-1">Targets <a class="header-anchor" href="#choose-a-target" aria-label="Permalink to &quot;Targets {#choose-a-target}&quot;">​</a></h2><p>Commands that send requests support these targets:</p><table tabindex="0"><thead><tr><th>Target</th><th>Selection</th><th>Commands</th></tr></thead><tbody><tr><td>Ephemeral local server</td><td>Omit <code>--url</code> and <code>--prod</code></td><td><code>run</code>, <code>call</code>, <code>skill</code>, <code>eval</code></td></tr><tr><td>Running server</td><td>Pass <code>--url &lt;baseUrl&gt;</code></td><td><code>chat</code>, <code>resume</code>, <code>run</code>, <code>call</code>, <code>skill</code>, <code>eval</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code>, <code>mcp</code></td></tr><tr><td>Default local server</td><td>Omit <code>--url</code> and <code>--prod</code>; uses <code>http://127.0.0.1:3000</code></td><td><code>chat</code>, <code>resume</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code></td></tr><tr><td>Hosted deployment</td><td>Pass <code>--prod</code></td><td><code>run</code>, <code>session</code>, <code>logs</code>, <code>playground</code></td></tr></tbody></table><p>An explicit <code>--url</code> must include the slug for a multi-agent server, such as <code>http://127.0.0.1:3000/pr-approver</code>. <code>--slug</code> never changes an explicit URL. <code>--url</code> and <code>--prod</code> are mutually exclusive.</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--dir &lt;path&gt;</code></td><td>Select the project root. The default is the current directory.</td></tr><tr><td><code>--url &lt;baseUrl&gt;</code></td><td>Use a running agent instead of local project discovery.</td></tr><tr><td><code>--prod</code></td><td>Use the hosted deployment. Only <code>run</code>, <code>session</code>, <code>logs</code>, and <code>playground</code> accept it; <code>chat</code>, <code>resume</code>, <code>call</code>, <code>skill</code>, <code>sessions</code>, <code>cost</code>, and <code>mcp</code> report that the deployment doesn&#39;t support the command, and <code>eval</code> rejects the flag.</td></tr><tr><td><code>--slug &lt;slug&gt;</code></td><td>Select an agent from a multi-agent project or a hosted deployment. Under <code>--prod</code>, the default is the <code>--dir</code> basename.</td></tr><tr><td><code>--team &lt;id&gt;</code></td><td>Select a Cursor team. The signed-in account&#39;s team is the default.</td></tr><tr><td><code>--api-key &lt;key&gt;</code></td><td>Override the Cursor credential for commands that authenticate with Cursor.</td></tr><tr><td><code>--bearer-token &lt;token&gt;</code></td><td>Authenticate to a running server with a bearer token.</td></tr><tr><td><code>--state-root &lt;path&gt;</code></td><td>Select local state for <code>serve</code> and ephemeral <code>run</code>, <code>call</code>, <code>skill</code>, and <code>eval</code> targets. Running and <code>--prod</code> targets ignore it.</td></tr><tr><td><code>--json</code></td><td>Request machine-readable output when the command supports it. <code>run</code> already defaults to JSON.</td></tr></tbody></table><h2 id="local-servers" tabindex="-1">Local servers <a class="header-anchor" href="#local-servers" aria-label="Permalink to &quot;Local servers&quot;">​</a></h2><h3 id="serve" tabindex="-1">Serve agents <a class="header-anchor" href="#serve" aria-label="Permalink to &quot;Serve agents {#serve}&quot;">​</a></h3><p><code>serve</code> mounts every project discovered under <code>--dir</code>:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk serve [--dir &lt;path&gt;] [--port &lt;n&gt;] [--host &lt;host&gt;]</span></span>
1
+ import{_ as t,c as a,o,a3 as s}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status.","frontmatter":{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status."},"headers":[],"relativePath":"reference/cli.md","filePath":"reference/cli.md"}'),d={name:"reference/cli.md"};function n(r,e,c,i,l,p){return o(),a("div",null,[...e[0]||(e[0]=[s(`<h1 id="bdk-cli" tabindex="-1">BDK CLI <a class="header-anchor" href="#bdk-cli" aria-label="Permalink to &quot;BDK CLI&quot;">​</a></h1><p>The Bot Development Kit (BDK) is published as <code>@cursor/bdk</code> with the <code>bdk</code> CLI.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk &lt;command&gt;</span></span></code></pre></div><p>The command catalog below documents the <code>bdk</code> binary from <code>@cursor/bdk</code>. Run it with Node 22.13 or newer; Bun is not supported. Commands exit nonzero when validation or a synchronous request fails; asynchronous commands can exit <code>0</code> once work is accepted. Project paths use the <a href="./project-layout.html">BDK project layout</a>.</p><p>Install <code>@cursor/bdk</code> to obtain the binary. <code>bdk help</code> prints top-level help; the Slack, GitHub, GitLab, and Bitbucket command packs provide their own <code>help</code> subcommands.</p><h2 id="command-catalog" tabindex="-1">Command catalog <a class="header-anchor" href="#command-catalog" aria-label="Permalink to &quot;Command catalog&quot;">​</a></h2><h3 id="development-commands" tabindex="-1">Development commands <a class="header-anchor" href="#development-commands" aria-label="Permalink to &quot;Development commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><code>help</code>, <code>--help</code>, <code>-h</code></td><td>Print top-level help</td></tr><tr><td><a href="#serve"><code>serve</code></a></td><td>Serve one or more agents over HTTP</td></tr><tr><td><a href="#dev"><code>dev</code></a></td><td>Serve agents with local-development behavior</td></tr><tr><td><a href="#docs"><code>docs</code></a></td><td>Serve the documentation bundled with <code>@cursor/bdk</code></td></tr><tr><td><a href="#init"><code>init</code></a></td><td>Scaffold a BDK project</td></tr><tr><td><a href="#convert-automation"><code>convert-automation</code></a></td><td>Export a Cursor Automation into a project</td></tr><tr><td><a href="#migrate"><code>migrate</code></a></td><td>Move an early-alpha project to architecture v2 through a pull request</td></tr><tr><td><a href="#install-skills"><code>install-skills</code></a></td><td>Refresh the bundled coding-agent skills</td></tr><tr><td><a href="#info"><code>info</code></a></td><td>Print the discovered project surface</td></tr><tr><td><a href="#validate"><code>validate</code></a></td><td>Check project diagnostics and set the exit status</td></tr><tr><td><a href="#manifest"><code>manifest</code></a></td><td>Print deployment metadata as JSON</td></tr><tr><td><a href="#version"><code>version</code></a></td><td>Print the installed package version</td></tr><tr><td><a href="#update"><code>update</code></a></td><td>Upgrade the installed CLI</td></tr><tr><td><a href="#login-logout-whoami"><code>login</code></a></td><td>Sign the host in to Cursor</td></tr><tr><td><a href="#login-logout-whoami"><code>logout</code></a></td><td>Remove the stored Cursor credential</td></tr><tr><td><a href="#login-logout-whoami"><code>whoami</code></a></td><td>Show the active Cursor credential</td></tr></tbody></table><h3 id="session-and-eval-commands" tabindex="-1">Session and eval commands <a class="header-anchor" href="#session-and-eval-commands" aria-label="Permalink to &quot;Session and eval commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><a href="#chat"><code>chat</code></a></td><td>Talk to a running agent</td></tr><tr><td><a href="#resume"><code>resume</code></a></td><td>Reattach chat to a previous session</td></tr><tr><td><a href="#run"><code>run</code></a></td><td>Start or continue work on a local, running, or hosted agent</td></tr><tr><td><a href="#call"><code>call</code></a></td><td>Call a server tool without a model turn</td></tr><tr><td><a href="#skill"><code>skill</code></a></td><td>Read an authored skill without a model turn</td></tr><tr><td><a href="#logs"><code>logs</code></a></td><td>Follow or dump agent logs</td></tr><tr><td><a href="#sessions"><code>sessions</code></a></td><td>List sessions</td></tr><tr><td><a href="#session"><code>session</code></a></td><td>Inspect a session or start a hosted session turn</td></tr><tr><td><a href="#cost"><code>cost</code></a></td><td>Report token usage and estimated cost</td></tr><tr><td><a href="#playground"><code>playground</code></a></td><td>Open an agent&#39;s playground</td></tr><tr><td><a href="#trajectory"><code>trajectory</code></a></td><td>Summarize a saved event stream</td></tr><tr><td><a href="#eval"><code>eval</code></a></td><td>List, run, inspect, or cancel evals</td></tr></tbody></table><h3 id="managed-hosting-commands" tabindex="-1">Managed hosting commands <a class="header-anchor" href="#managed-hosting-commands" aria-label="Permalink to &quot;Managed hosting commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><a href="#deploy"><code>deploy</code></a></td><td>Deploy one or more agents</td></tr><tr><td><a href="#deployments"><code>deployments</code></a></td><td>List deployments</td></tr><tr><td><a href="#deployment"><code>deployment</code></a></td><td>Inspect one deployment</td></tr><tr><td><a href="#stop"><code>stop</code></a></td><td>Stop a deployment</td></tr><tr><td><a href="#start"><code>start</code></a></td><td>Start a stopped deployment</td></tr><tr><td><a href="#kill"><code>kill</code></a></td><td>Stop a deployment, cancel its runs, and lock deploys</td></tr><tr><td><a href="#unlock-deploys"><code>unlock-deploys</code></a></td><td>Let a killed deployment deploy again</td></tr><tr><td><a href="#cancel-runs"><code>cancel-runs</code></a></td><td>Cancel active runs and reminder wakes</td></tr><tr><td><a href="#event-repos"><code>event-repos</code></a></td><td>Replace a deployment&#39;s event repositories</td></tr><tr><td><a href="#upgrade"><code>upgrade</code></a></td><td>Move a deployment to a release</td></tr><tr><td><a href="#rollback"><code>rollback</code></a></td><td>Move a deployment to an earlier release</td></tr><tr><td><a href="#delete"><code>delete</code></a></td><td>Delete a deployment</td></tr><tr><td><a href="#rotate-token"><code>rotate-token</code></a></td><td>Replace a deployment&#39;s alias token</td></tr><tr><td><a href="#secrets"><code>secrets</code></a></td><td>Set, list, or remove deployment secrets</td></tr><tr><td><a href="#images"><code>images</code></a></td><td>Push, list, or remove container images for persistent agents</td></tr></tbody></table><h3 id="connection-and-channel-commands" tabindex="-1">Connection and channel commands <a class="header-anchor" href="#connection-and-channel-commands" aria-label="Permalink to &quot;Connection and channel commands&quot;">​</a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><a href="#mcp"><code>mcp</code></a></td><td>Proxy an agent&#39;s MCP endpoint over stdio</td></tr><tr><td><a href="#mcp"><code>mcp install</code></a></td><td>Add the agent to an MCP client config</td></tr><tr><td><a href="#mcp-oauth"><code>mcp oauth</code></a></td><td>Authorize an MCP connection</td></tr><tr><td><a href="#slack"><code>slack</code></a></td><td>Provision and check Slack channel apps</td></tr><tr><td><a href="#github"><code>github</code></a></td><td>Forward, replay, and inspect GitHub webhooks</td></tr><tr><td><a href="#gitlab"><code>gitlab</code></a></td><td>Replay and inspect GitLab webhooks</td></tr><tr><td><a href="#bitbucket"><code>bitbucket</code></a></td><td>Replay and inspect Bitbucket webhooks</td></tr></tbody></table><h2 id="choose-a-target" tabindex="-1">Targets <a class="header-anchor" href="#choose-a-target" aria-label="Permalink to &quot;Targets {#choose-a-target}&quot;">​</a></h2><p>Commands that send requests support these targets:</p><table tabindex="0"><thead><tr><th>Target</th><th>Selection</th><th>Commands</th></tr></thead><tbody><tr><td>Ephemeral local server</td><td>Omit <code>--url</code> and <code>--prod</code></td><td><code>run</code>, <code>call</code>, <code>skill</code>, <code>eval</code></td></tr><tr><td>Running server</td><td>Pass <code>--url &lt;baseUrl&gt;</code></td><td><code>chat</code>, <code>resume</code>, <code>run</code>, <code>call</code>, <code>skill</code>, <code>eval</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code>, <code>mcp</code></td></tr><tr><td>Default local server</td><td>Omit <code>--url</code> and <code>--prod</code>; uses <code>http://127.0.0.1:3000</code></td><td><code>chat</code>, <code>resume</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code></td></tr><tr><td>Hosted deployment</td><td>Pass <code>--prod</code></td><td><code>run</code>, <code>session</code>, <code>logs</code>, <code>playground</code></td></tr></tbody></table><p>An explicit <code>--url</code> must include the slug for a multi-agent server, such as <code>http://127.0.0.1:3000/pr-approver</code>. <code>--slug</code> never changes an explicit URL. <code>--url</code> and <code>--prod</code> are mutually exclusive.</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--dir &lt;path&gt;</code></td><td>Select the project root. The default is the current directory.</td></tr><tr><td><code>--url &lt;baseUrl&gt;</code></td><td>Use a running agent instead of local project discovery.</td></tr><tr><td><code>--prod</code></td><td>Use the hosted deployment. Only <code>run</code>, <code>session</code>, <code>logs</code>, and <code>playground</code> accept it; <code>chat</code>, <code>resume</code>, <code>call</code>, <code>skill</code>, <code>sessions</code>, <code>cost</code>, and <code>mcp</code> report that the deployment doesn&#39;t support the command, and <code>eval</code> rejects the flag.</td></tr><tr><td><code>--slug &lt;slug&gt;</code></td><td>Select an agent from a multi-agent project or a hosted deployment. Under <code>--prod</code>, the default is the <code>--dir</code> basename.</td></tr><tr><td><code>--team &lt;id&gt;</code></td><td>Select a Cursor team. The signed-in account&#39;s team is the default.</td></tr><tr><td><code>--api-key &lt;key&gt;</code></td><td>Override the Cursor credential for commands that authenticate with Cursor.</td></tr><tr><td><code>--bearer-token &lt;token&gt;</code></td><td>Authenticate to a running server with a bearer token.</td></tr><tr><td><code>--state-root &lt;path&gt;</code></td><td>Select local state for <code>serve</code> and ephemeral <code>run</code>, <code>call</code>, <code>skill</code>, and <code>eval</code> targets. Running and <code>--prod</code> targets ignore it.</td></tr><tr><td><code>--json</code></td><td>Request machine-readable output when the command supports it. <code>run</code> already defaults to JSON.</td></tr></tbody></table><h2 id="local-servers" tabindex="-1">Local servers <a class="header-anchor" href="#local-servers" aria-label="Permalink to &quot;Local servers&quot;">​</a></h2><h3 id="serve" tabindex="-1">Serve agents <a class="header-anchor" href="#serve" aria-label="Permalink to &quot;Serve agents {#serve}&quot;">​</a></h3><p><code>serve</code> mounts every project discovered under <code>--dir</code>:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk serve [--dir &lt;path&gt;] [--port &lt;n&gt;] [--host &lt;host&gt;]</span></span>
2
2
  <span class="line"><span> [--mode multi|single] [--dev] [--api-key &lt;key&gt;]</span></span>
3
3
  <span class="line"><span> [--state-root &lt;path&gt;]</span></span>
4
4
  <span class="line"><span> [--bearer-token &lt;secret&gt; | --allow-anonymous]</span></span>
@@ -6,8 +6,9 @@ import{_ as t,c as a,o,a3 as s}from"./chunks/framework.BNw1pucY.js";const u=JSON
6
6
  <span class="line"><span> [--allow-anonymous-cursor-account-mcp]</span></span>
7
7
  <span class="line"><span> [--allow-anonymous-grokbot]</span></span>
8
8
  <span class="line"><span> [--public-url &lt;url&gt;]</span></span>
9
+ <span class="line"><span> [--peers-url &lt;url&gt;]</span></span>
9
10
  <span class="line"><span> [--no-schedules] [--no-playground] [--no-docs]</span></span>
10
- <span class="line"><span> [--cursor-events --repo &lt;owner/name&gt;]...</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--port &lt;n&gt;</code></td><td>Listen on this port. The default is <code>3000</code>; <code>0</code> 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.</td></tr><tr><td><code>--host &lt;host&gt;</code></td><td>Bind this host. The default is loopback-only <code>127.0.0.1</code>.</td></tr><tr><td><code>--mode multi</code></td><td>Mount projects at <code>/&lt;slug&gt;/v1/*</code> and <code>/&lt;slug&gt;/playground</code>, with an index at <code>/</code>. This is the default.</td></tr><tr><td><code>--mode single</code></td><td>Mount one project at <code>/v1/*</code> and <code>/playground</code>.</td></tr><tr><td><code>--dev</code></td><td>Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and enable local playground access.</td></tr><tr><td><code>--state-root &lt;path&gt;</code></td><td>Store local sessions, streams, workspaces, and channel state here. Keep durable state outside a repository whose rules shouldn&#39;t reach agent workspaces.</td></tr><tr><td><code>--bearer-token &lt;secret&gt;</code></td><td>Require this token on routes without authored authentication. Mutually exclusive with <code>--allow-anonymous</code>.</td></tr><tr><td><code>--allow-anonymous</code></td><td>Admit callers as one anonymous principal. Use it only behind a trusted network boundary.</td></tr><tr><td><code>--allow-anonymous-cursor-github</code></td><td>Let anonymous callers use sessions with a Cursor account&#39;s repository-scoped GitHub credential. Requires an authenticating proxy.</td></tr><tr><td><code>--allow-anonymous-cursor-account-mcp</code></td><td>Let anonymous callers use Cursor account MCP connections. Requires an authenticating proxy.</td></tr><tr><td><code>--allow-anonymous-grokbot</code></td><td>Let anonymous callers drive hosted Grok Bot runtime agents. Requires an authenticating proxy.</td></tr><tr><td><code>--public-url &lt;url&gt;</code></td><td>Set the externally reachable base URL that turns running off the serve host use for peer MCP and host bridges. It does not expose the server; configure the listener or proxy separately. Local-runtime peers use loopback.</td></tr><tr><td><code>--no-schedules</code></td><td>Disable schedule firing outside dev mode.</td></tr><tr><td><code>--no-playground</code></td><td>Skip the playground.</td></tr><tr><td><code>--no-docs</code></td><td>Skip the documentation site at <code>/docs</code>.</td></tr><tr><td><code>--cursor-events</code></td><td>Receive SCM events through Cursor. Requires sign-in and one or more repeatable <code>--repo owner/name</code> values.</td></tr></tbody></table><p>Multi-agent slugs start with a letter or digit and contain only letters, digits, <code>_</code>, or <code>-</code>. The reserved slugs are <code>v1</code>, <code>playground</code>, and <code>docs</code>.</p><h3 id="dev" tabindex="-1">Develop locally <a class="header-anchor" href="#dev" aria-label="Permalink to &quot;Develop locally {#dev}&quot;">​</a></h3><p><code>dev</code> is <code>serve --dev</code> with an optional positional project path:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk dev</span></span>
11
+ <span class="line"><span> [--cursor-events --repo &lt;owner/name&gt;]...</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--port &lt;n&gt;</code></td><td>Listen on this port. The default is <code>3000</code>; <code>0</code> 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.</td></tr><tr><td><code>--host &lt;host&gt;</code></td><td>Bind this host. The default is loopback-only <code>127.0.0.1</code>.</td></tr><tr><td><code>--mode multi</code></td><td>Mount projects at <code>/&lt;slug&gt;/v1/*</code> and <code>/&lt;slug&gt;/playground</code>, with an index at <code>/</code>. This is the default.</td></tr><tr><td><code>--mode single</code></td><td>Mount one project at <code>/v1/*</code> and <code>/playground</code>. Declared peers are omitted with a warning unless <code>--peers-url</code> is set.</td></tr><tr><td><code>--dev</code></td><td>Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and enable local playground access.</td></tr><tr><td><code>--state-root &lt;path&gt;</code></td><td>Store local sessions, streams, workspaces, and channel state here. Keep durable state outside a repository whose rules shouldn&#39;t reach agent workspaces.</td></tr><tr><td><code>--bearer-token &lt;secret&gt;</code></td><td>Require this token on routes without authored authentication. Mutually exclusive with <code>--allow-anonymous</code>.</td></tr><tr><td><code>--allow-anonymous</code></td><td>Admit callers as one anonymous principal. Use it only behind a trusted network boundary.</td></tr><tr><td><code>--allow-anonymous-cursor-github</code></td><td>Let anonymous callers use sessions with a Cursor account&#39;s repository-scoped GitHub credential. Requires an authenticating proxy.</td></tr><tr><td><code>--allow-anonymous-cursor-account-mcp</code></td><td>Let anonymous callers use Cursor account MCP connections. Requires an authenticating proxy.</td></tr><tr><td><code>--allow-anonymous-grokbot</code></td><td>Let anonymous callers drive hosted Grok Bot runtime agents. Requires an authenticating proxy.</td></tr><tr><td><code>--public-url &lt;url&gt;</code></td><td>Set the externally reachable base URL that turns running off the serve host use for peer MCP and host bridges. It does not expose the server; configure the listener or proxy separately. Local-runtime peers use loopback.</td></tr><tr><td><code>--peers-url &lt;url&gt;</code></td><td>Resolve declared peers for a single-agent serve through a hosting-provided peer service. Cursor-managed hosting sets this option automatically; a multi-agent serve rejects it.</td></tr><tr><td><code>--no-schedules</code></td><td>Disable schedule firing outside dev mode.</td></tr><tr><td><code>--no-playground</code></td><td>Skip the playground.</td></tr><tr><td><code>--no-docs</code></td><td>Skip the documentation site at <code>/docs</code>.</td></tr><tr><td><code>--cursor-events</code></td><td>Receive SCM events through Cursor. Requires sign-in and one or more repeatable <code>--repo owner/name</code> values.</td></tr></tbody></table><p>Multi-agent slugs start with a letter or digit and contain only letters, digits, <code>_</code>, or <code>-</code>. The reserved slugs are <code>v1</code>, <code>playground</code>, and <code>docs</code>.</p><h3 id="dev" tabindex="-1">Develop locally <a class="header-anchor" href="#dev" aria-label="Permalink to &quot;Develop locally {#dev}&quot;">​</a></h3><p><code>dev</code> is <code>serve --dev</code> with an optional positional project path:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk dev</span></span>
11
12
  <span class="line"><span>bdk dev ./bdk-pr-reviewer --port 3000</span></span></code></pre></div><p>It accepts every <code>serve</code> option. Pass at most one positional path, and don&#39;t combine it with a different <code>--dir</code>.</p><h3 id="docs" tabindex="-1">Serve the docs <a class="header-anchor" href="#docs" aria-label="Permalink to &quot;Serve the docs {#docs}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk docs [--port &lt;n&gt;] [--host 127.0.0.1] [--print]</span></span></code></pre></div><p><code>docs</code> serves the bundled documentation without an agent project. It uses an available loopback port by default and stays open until Ctrl-C. <code>--print</code> prints the URL without opening a browser.</p><h2 id="sessions-and-turns" tabindex="-1">Sessions and turns <a class="header-anchor" href="#sessions-and-turns" aria-label="Permalink to &quot;Sessions and turns&quot;">​</a></h2><h3 id="chat" tabindex="-1">Chat with an agent <a class="header-anchor" href="#chat" aria-label="Permalink to &quot;Chat with an agent {#chat}&quot;">​</a></h3><p><code>chat</code> connects to a running server and never starts an ephemeral one:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk chat [--url &lt;baseUrl&gt;] [--message &lt;text&gt;]</span></span>
12
13
  <span class="line"><span> [--session &lt;id&gt; | --resume] [--continuation-token &lt;token&gt;]</span></span>
13
14
  <span class="line"><span> [--slug &lt;slug&gt;] [--json] [--text] [--no-color]</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Input mode</th><th>Behavior</th></tr></thead><tbody><tr><td>TTY without <code>--message</code></td><td>Open an interactive REPL.</td></tr><tr><td>TTY with <code>--message</code></td><td>Send the message, then keep the REPL open.</td></tr><tr><td>Non-TTY with <code>--message</code></td><td>Send one turn and exit.</td></tr><tr><td>Non-TTY without <code>--message</code></td><td>Read newline-delimited messages until EOF.</td></tr><tr><td><code>--json --message &lt;text&gt;</code></td><td>Send one turn and print <code>{ ok, sessionId, continuationToken, trajectory }</code>.</td></tr><tr><td><code>--json --text --message &lt;text&gt;</code></td><td>Print a compact trajectory instead of JSON.</td></tr></tbody></table><p>Use <code>--session &lt;id&gt;</code> to reattach a stored session. If you omit <code>--continuation-token</code>, the CLI looks it up from the target&#39;s session list. <code>--resume</code> selects the most recently updated session with a continuation token. An explicit session ID takes precedence.</p><h3 id="resume" tabindex="-1">Resume a session <a class="header-anchor" href="#resume" aria-label="Permalink to &quot;Resume a session {#resume}&quot;">​</a></h3><p><code>resume</code> provides the same reattachment contract as <code>chat --session</code>:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk resume [sessionId] [--url &lt;baseUrl&gt;]</span></span>
@@ -35,7 +36,9 @@ import{_ as t,c as a,o,a3 as s}from"./chunks/framework.BNw1pucY.js";const u=JSON
35
36
  <span class="line"><span> [--junit &lt;path&gt;] [--artifacts &lt;dir&gt; | --no-artifacts]</span></span>
36
37
  <span class="line"><span> [--skip-report] [--out &lt;file.json&gt;] [--no-stream]</span></span>
37
38
  <span class="line"><span> [--url &lt;baseUrl&gt;] [--no-wait] [--slug &lt;slug&gt;]</span></span></code></pre></div><p>Select an exact case such as <code>weather/nyc</code>, a file prefix such as <code>weather</code>, several IDs, or no IDs for every case. Repeat <code>--tag</code> for OR matching. Projects must provide <code>evals/evals.config.{ts,js}</code> with <code>maxConcurrency</code> between 1 and 200.</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--list</code></td><td>List matching cases without running them. <code>--list --json</code> prints an array.</td></tr><tr><td><code>--tag &lt;tag&gt;</code></td><td>Select a tag. Repeat the option for OR matching.</td></tr><tr><td><code>--json</code></td><td>Print <code>{ ok, passed, failed, scored, skipped, strict, results }</code>.</td></tr><tr><td><code>--verbose</code></td><td>Stream <code>t.log</code> lines and reply snippets.</td></tr><tr><td><code>--no-stream</code></td><td>Hide live progress on stderr.</td></tr><tr><td><code>--strict</code></td><td>Treat a scored case below its soft threshold as a failure.</td></tr><tr><td><code>--max-concurrency &lt;n&gt;</code></td><td>Override <code>maxConcurrency</code> from the eval config for an ephemeral local run.</td></tr><tr><td><code>--timeout-ms &lt;n&gt;</code></td><td>Override the per-case timeout. A case timeout takes precedence, followed by this option, the config timeout, and the 180-second default.</td></tr><tr><td><code>--junit &lt;path&gt;</code></td><td>Write JUnit XML for an ephemeral local run.</td></tr><tr><td><code>--artifacts &lt;dir&gt;</code></td><td>Select the artifact directory for an ephemeral local run. The default is a timestamped directory under the project&#39;s state directory.</td></tr><tr><td><code>--no-artifacts</code></td><td>Skip artifacts for an ephemeral local run.</td></tr><tr><td><code>--skip-report</code></td><td>Ignore reporters from eval files and the eval config during an ephemeral local run.</td></tr><tr><td><code>--out &lt;file.json&gt;</code></td><td>Also write the full result JSON.</td></tr><tr><td><code>--no-wait</code></td><td>Return after a running server accepts the batch.</td></tr></tbody></table><p>A running server prints its Eval ID when it accepts the batch. Use these commands to inspect or cancel it:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk eval status [evalId] --url &lt;baseUrl&gt;</span></span>
38
- <span class="line"><span>bdk eval cancel &lt;evalId&gt; --url &lt;baseUrl&gt;</span></span></code></pre></div><p><code>eval status</code> without an ID lists recent remote runs. <code>eval status --out</code> requires an ID. The <code>status</code> and <code>cancel</code> subcommands require <code>--url</code>.</p><h2 id="projects" tabindex="-1">Projects <a class="header-anchor" href="#projects" aria-label="Permalink to &quot;Projects&quot;">​</a></h2><h3 id="init" tabindex="-1">Scaffold a project <a class="header-anchor" href="#init" aria-label="Permalink to &quot;Scaffold a project {#init}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk init [directory] [--template &lt;name&gt;] [--var id=value]... [--json]</span></span></code></pre></div><p>Without a directory, <code>init</code> prints the setup guide and changes no files. With a directory, it preserves existing scaffold files, adds missing files, installs dependencies, and tries to put <code>bdk</code> on <code>PATH</code>.</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--template &lt;name&gt;</code></td><td>Use a bundled template: <code>agentic-owners</code>, <code>agents-md</code>, <code>code-wiki</code>, <code>demo</code>, <code>grokbot-agents</code>, <code>security-help</code>, <code>security-reviewer</code>, <code>thermo-quality-review</code>, <code>thermo-review</code>, <code>triage-jira</code>, or <code>triage-linear</code>. <code>triage</code> selects <code>triage-linear</code>.</td></tr><tr><td><code>--var id=value</code></td><td>Answer a template question without a prompt. Repeat for multiple answers.</td></tr><tr><td><code>--json</code></td><td>Skip interactive login and skill prompts, then print <code>{ ok, directory, template, created, skipped, installed, installError, cliOnPath, cliLinkError, next }</code>. <code>ok</code> reflects dependency installation.</td></tr></tbody></table><p>On a TTY, templates with questions run their interview before writing files. <code>init</code> also offers to refresh the bundled coding-agent skills and starts login when the host has no Cursor credential.</p><h3 id="convert-automation" tabindex="-1">Convert an Automation <a class="header-anchor" href="#convert-automation" aria-label="Permalink to &quot;Convert an Automation {#convert-automation}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk convert-automation &lt;url-or-uuid&gt; [--dir &lt;path&gt;] [--json]</span></span></code></pre></div><p>The input can be a Cursor Automation dashboard URL or its UUID. The output directory defaults to <code>./&lt;automation-name&gt;</code>. Generated files don&#39;t overwrite existing paths, and missing scaffold files are added. The following <code>npm install</code> can update lockfiles and run lifecycle scripts from an existing <code>package.json</code>.</p><p><code>--json</code> prints <code>{ ok, directory, files, warnings, setupSteps, installed, installError, mcpConnections }</code>. Conversion warnings and dependency-install failures remain visible in this output without failing a completed file conversion. Invalid input, authentication, export, and file-write failures exit nonzero.</p><p>See <a href="./../guides/convert-automation.html">Convert a Cursor Automation</a> for the generated project and features that need manual review.</p><h3 id="migrate" tabindex="-1">Migrate an early-alpha project <a class="header-anchor" href="#migrate" aria-label="Permalink to &quot;Migrate an early-alpha project {#migrate}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk migrate [--dir &lt;path&gt;] [--repo &lt;https-url&gt;] [--ref &lt;git-ref&gt;]</span></span>
39
+ <span class="line"><span>bdk eval cancel &lt;evalId&gt; --url &lt;baseUrl&gt;</span></span></code></pre></div><p><code>eval status</code> without an ID lists recent remote runs. <code>eval status --out</code> requires an ID. The <code>status</code> and <code>cancel</code> subcommands require <code>--url</code>.</p><h2 id="projects" tabindex="-1">Projects <a class="header-anchor" href="#projects" aria-label="Permalink to &quot;Projects&quot;">​</a></h2><h3 id="init" tabindex="-1">Scaffold a project <a class="header-anchor" href="#init" aria-label="Permalink to &quot;Scaffold a project {#init}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk init [directory] [--template &lt;name&gt;] [--var id=value]... [--json]</span></span>
40
+ <span class="line"><span>bdk init [directory] --from-grokbot &lt;recipe.json&gt;</span></span>
41
+ <span class="line"><span> [--answers &lt;file&gt;] [--dry-run] [--json]</span></span></code></pre></div><p>Without a directory, <code>init</code> prints the setup guide and changes no files. With a directory, it preserves existing scaffold files, adds missing files, installs dependencies, and tries to put <code>bdk</code> on <code>PATH</code>.</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--template &lt;name&gt;</code></td><td>Use a bundled template: <code>agentic-owners</code>, <code>agents-md</code>, <code>code-wiki</code>, <code>demo</code>, <code>grokbot-agents</code>, <code>security-help</code>, <code>security-reviewer</code>, <code>thermo-quality-review</code>, <code>thermo-review</code>, <code>triage-jira</code>, or <code>triage-linear</code>. <code>triage</code> selects <code>triage-linear</code>.</td></tr><tr><td><code>--var id=value</code></td><td>Answer a template question without a prompt. Repeat for multiple answers.</td></tr><tr><td><code>--json</code></td><td>Skip interactive login and skill prompts, then print <code>{ ok, directory, template, created, skipped, installed, installError, cliOnPath, cliLinkError, next }</code>. <code>ok</code> reflects dependency installation.</td></tr></tbody></table><p>On a TTY, templates with questions run their interview before writing files. <code>init</code> also offers to refresh the bundled coding-agent skills and starts login when the host has no Cursor credential.</p><h4 id="export-a-grok-bot-recipe" tabindex="-1">Export a Grok Bot recipe <a class="header-anchor" href="#export-a-grok-bot-recipe" aria-label="Permalink to &quot;Export a Grok Bot recipe&quot;">​</a></h4><p><code>--from-grokbot</code> reads a Grok Bot recipe and maps its profile, selected skills and routines, memory, channels, and connectors into a BDK project. The target directory defaults to the resolved <code>location</code> answer; a positional directory overrides it. A target previously created with <code>bdk init --template</code> is rejected; export into a fresh directory instead.</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--from-grokbot &lt;recipe.json&gt;</code></td><td>Read the recipe to export.</td></tr><tr><td><code>--answers &lt;file&gt;</code></td><td>Read export decisions from a JSON object. Fields present in the file are not asked again. The published schema is <code>schemas/grokbot-answers.schema.json</code>.</td></tr><tr><td><code>--dry-run</code></td><td>Print the planned files, defaults, exclusions, unmapped behavior, placeholders, secret names, warnings, and setup steps without writing files or installing dependencies.</td></tr><tr><td><code>--json</code></td><td>Never prompt and print machine-readable output. Combine it with <code>--dry-run</code> for a machine-readable preview.</td></tr></tbody></table><p>On a TTY, the command asks for missing decisions and offers recipe-derived defaults. Off a TTY, it never prompts, takes defaults where possible, and lists the fields it defaulted.</p><p><code>--dry-run --json</code> prints <code>{ ok, dryRun, directory, preview }</code>. The preview contains <code>version</code>, <code>name</code>, resolved <code>answers</code>, <code>defaulted</code>, <code>ignored</code>, <code>files</code> as <code>{ path, from }</code>, <code>excluded</code>, <code>unmapped</code> as <code>{ from, reason }</code>, <code>fillIns</code>, <code>secrets</code> as <code>{ names, reauth }</code>, <code>warnings</code>, and <code>setupSteps</code>. A write with <code>--json</code> also reports <code>files</code>, <code>installed</code>, and <code>installError</code>. A dependency install failure leaves <code>ok: true</code>, sets <code>installed: false</code>, reports <code>installError</code>, and exits <code>0</code>. Other errors print <code>{ ok: false, error }</code> and exit nonzero.</p><p><code>--answers</code> and <code>--dry-run</code> require <code>--from-grokbot</code>. This export mode does not accept <code>--template</code> or <code>--var</code>.</p><p>See <a href="./../guides/export-grokbot.html">Export a Grok Bot</a> for the preview-first workflow, mapping table, and post-export checklist.</p><h3 id="convert-automation" tabindex="-1">Convert an Automation <a class="header-anchor" href="#convert-automation" aria-label="Permalink to &quot;Convert an Automation {#convert-automation}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk convert-automation &lt;url-or-uuid&gt; [--dir &lt;path&gt;] [--json]</span></span></code></pre></div><p>The input can be a Cursor Automation dashboard URL or its UUID. The output directory defaults to <code>./&lt;automation-name&gt;</code>. Generated files don&#39;t overwrite existing paths, and missing scaffold files are added. The following <code>npm install</code> can update lockfiles and run lifecycle scripts from an existing <code>package.json</code>.</p><p><code>--json</code> prints <code>{ ok, directory, files, warnings, setupSteps, installed, installError, mcpConnections }</code>. Conversion warnings and dependency-install failures remain visible in this output without failing a completed file conversion. Invalid input, authentication, export, and file-write failures exit nonzero.</p><p>See <a href="./../guides/convert-automation.html">Convert a Cursor Automation</a> for the generated project and features that need manual review.</p><h3 id="migrate" tabindex="-1">Migrate an early-alpha project <a class="header-anchor" href="#migrate" aria-label="Permalink to &quot;Migrate an early-alpha project {#migrate}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk migrate [--dir &lt;path&gt;] [--repo &lt;https-url&gt;] [--ref &lt;git-ref&gt;]</span></span>
39
42
  <span class="line"><span> [--path &lt;agent-path&gt;] [--no-wait] [--json] [--api-key &lt;key&gt;]</span></span></code></pre></div><p><code>migrate</code> applies only to projects deployed on architecture v1 during the BDK early alpha. It reads a pushed Git ref, starts a Cursor cloud agent with the bundled <code>bdk-migrate-v2</code> skill, and opens a pull request with the source changes. The command waits for the pull request by default and never deploys the project or changes deployment secrets.</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>--dir &lt;path&gt;</code></td><td>Select the local BDK project. The default is the current directory.</td></tr><tr><td><code>--repo &lt;https-url&gt;</code></td><td>Select the source repository. The CLI infers the current checkout&#39;s origin when possible.</td></tr><tr><td><code>--ref &lt;git-ref&gt;</code></td><td>Select the pushed ref for the cloud agent. The CLI infers the current branch when possible.</td></tr><tr><td><code>--path &lt;agent-path&gt;</code></td><td>Select the project path relative to the repository root. The CLI infers it from <code>--dir</code> when possible.</td></tr><tr><td><code>--no-wait</code></td><td>Print the cloud agent URL and return after the agent starts.</td></tr><tr><td><code>--json</code></td><td>Print a report with <code>ok</code>, <code>status</code>, <code>agentId</code>, and the cloud agent <code>url</code>. A completed migration adds <code>prUrl</code>; a blocked or failed migration adds its explanation.</td></tr><tr><td><code>--api-key &lt;key&gt;</code></td><td>Override the Cursor credential.</td></tr></tbody></table><p>Credential resolution follows the normal order: <code>--api-key</code>, <code>CURSOR_API_KEY</code>, <code>CURSOR_API_KEY_FILE</code>, <code>CURSOR_SERVICE_ACCOUNT_KEY</code>, then the stored <code>bdk login</code> credential. See <a href="./../guides/migrate.html">Migrate an early-alpha project</a> for detection, pull request review, and deployment cutover.</p><h3 id="install-skills" tabindex="-1">Install coding-agent skills <a class="header-anchor" href="#install-skills" aria-label="Permalink to &quot;Install coding-agent skills {#install-skills}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk install-skills [--print] [--json]</span></span></code></pre></div><p>The command replaces the installed BDK skills with the package copy and removes stale bundled skills. <code>--print</code> previews the change. <code>--json</code> prints <code>{ ok, dryRun, directory, firstInstall, skills, removed }</code>.</p><p>Package installation performs this copy. Run <code>bdk install-skills</code> when you need to refresh it.</p><h3 id="info" tabindex="-1">Inspect a project <a class="header-anchor" href="#info" aria-label="Permalink to &quot;Inspect a project {#info}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk info [--dir &lt;path&gt;] [--json]</span></span></code></pre></div><p>Text output lists the model, instructions, tools, skills, extensions, connections, subagents, channels, schedules, hooks, hosting settings, and diagnostics. For one unslugged project, <code>--json</code> prints its project info object. For slugged or multi-agent discovery, it prints <code>{ agents }</code>.</p><h3 id="validate" tabindex="-1">Validate a project <a class="header-anchor" href="#validate" aria-label="Permalink to &quot;Validate a project {#validate}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk validate [--dir &lt;path&gt;]</span></span></code></pre></div><p><code>validate</code> prints every discovered project&#39;s diagnostics and exits nonzero when any diagnostic has error severity. Use it instead of <code>info --json</code> when a script needs validation status.</p><p>Hosting checks run here too. On architecture v2 (the default), a <code>githubChannel</code> credential or a GitLab or Bitbucket <code>webhookSecret</code> written as a literal or a <code>() =&gt; process.env.NAME</code> getter is an error whose message quotes the <code>{ secretName: &quot;NAME&quot; }</code> form to use instead. A project that still sets <code>architecture: &quot;v1&quot;</code> gets the same finding as a warning, so run <code>validate</code> before removing the pin to list what the migration must rename.</p><h3 id="manifest" tabindex="-1">Print a deployment manifest <a class="header-anchor" href="#manifest" aria-label="Permalink to &quot;Print a deployment manifest {#manifest}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk manifest [--dir &lt;path&gt;] [--json]</span></span></code></pre></div><p><code>manifest</code> validates one project and prints its deployment metadata without a network request. Default output is indented JSON; <code>--json</code> prints one compact line.</p><h2 id="credentials-and-versions" tabindex="-1">Credentials and versions <a class="header-anchor" href="#credentials-and-versions" aria-label="Permalink to &quot;Credentials and versions&quot;">​</a></h2><h3 id="login-logout-whoami" tabindex="-1">Manage credentials <a class="header-anchor" href="#login-logout-whoami" aria-label="Permalink to &quot;Manage credentials {#login-logout-whoami}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk login [--api-key &lt;key&gt;] [--key-name &lt;name&gt;]</span></span>
40
43
  <span class="line"><span>bdk whoami [--json]</span></span>
41
44
  <span class="line"><span>bdk logout</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Command</th><th>Contract</th></tr></thead><tbody><tr><td><code>login</code></td><td>Use a supplied API key, or open browser sign-in and store the resulting dashboard-revocable key in the CLI config directory. <code>--key-name</code> labels a browser-created key.</td></tr><tr><td><code>whoami</code></td><td>Show the active credential and its source. <code>--json</code> returns the same identity as JSON.</td></tr><tr><td><code>logout</code></td><td>Remove the stored credential file. It doesn&#39;t revoke the API key; revoke the key in the Cursor dashboard.</td></tr></tbody></table><h3 id="version" tabindex="-1">Print the version <a class="header-anchor" href="#version" aria-label="Permalink to &quot;Print the version {#version}&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk version [--json]</span></span>
@@ -92,4 +95,4 @@ import{_ as t,c as a,o,a3 as s}from"./chunks/framework.BNw1pucY.js";const u=JSON
92
95
  <span class="line"><span> [--url &lt;url&gt;] [--host &lt;host&gt;] [--port &lt;n&gt;]</span></span>
93
96
  <span class="line"><span> [--secret &lt;secret&gt;] [--dry-run] [--out &lt;dir&gt;] [--json]</span></span>
94
97
  <span class="line"><span>bdk bitbucket events [--dir &lt;path&gt;] [--host &lt;host&gt;] [--port &lt;n&gt;] [--json]</span></span>
95
- <span class="line"><span>bdk bitbucket forward [--dir &lt;path&gt;] [--host &lt;host&gt;] [--port &lt;n&gt;]</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Subcommand</th><th>Contract</th></tr></thead><tbody><tr><td><code>replay</code></td><td>Read a pull request, synthesize webhook payloads in the host&#39;s Cloud or Data Center format, and post them to matching channels.</td></tr><tr><td><code>events</code></td><td>List discovered Bitbucket channel URLs and event keys.</td></tr><tr><td><code>forward</code></td><td>Print the repository-hook and tunnel recipe for live deliveries.</td></tr></tbody></table><p>Replay supports <code>pullrequest:created</code>, <code>pullrequest:updated</code>, <code>pullrequest:comment_created</code>, and <code>repo:push</code>, along with their supported Data Center forms. It requires <code>BITBUCKET_TOKEN</code> with pull-request read access. <code>--secret</code> defaults to <code>BITBUCKET_WEBHOOK_SECRET</code>; <code>--dry-run</code> and <code>--out</code> follow the GitHub replay contract.</p><p>See <a href="./../guides/bitbucket.html">Bitbucket</a> for Cloud and Data Center setup.</p><h2 id="environment-variables" tabindex="-1">Environment variables <a class="header-anchor" href="#environment-variables" aria-label="Permalink to &quot;Environment variables&quot;">​</a></h2><p>Credential resolution follows this order: <code>--api-key</code>, <code>CURSOR_API_KEY</code>, <code>CURSOR_API_KEY_FILE</code>, <code>CURSOR_SERVICE_ACCOUNT_KEY</code>, then the stored login.</p><table tabindex="0"><thead><tr><th>Variable</th><th>Contract</th></tr></thead><tbody><tr><td><code>CURSOR_API_KEY</code></td><td>Cursor credential.</td></tr><tr><td><code>CURSOR_API_KEY_FILE</code></td><td>Path to a Cursor credential file.</td></tr><tr><td><code>CURSOR_SERVICE_ACCOUNT_KEY</code></td><td>Team service-account credential used after the API key and key-file sources.</td></tr><tr><td><code>CURSOR_API_BASE_URL</code></td><td>Backend for login, account, deployment, and event commands.</td></tr><tr><td><code>CURSOR_BACKEND_URL</code></td><td>Backend for BDK turns. Set it with <code>CURSOR_API_BASE_URL</code> when using a non-default backend.</td></tr><tr><td><code>AGENT_SERVE_CONFIG_DIR</code></td><td>Override the CLI config directory for stored credentials and update state.</td></tr><tr><td><code>AGENT_SERVE_NO_UPDATE_CHECK</code>, <code>NO_UPDATE_NOTIFIER</code>, <code>CI</code></td><td>Disable published-version checks when set to a non-empty value other than <code>0</code>.</td></tr><tr><td><code>GITHUB_WEBHOOK_SECRET</code></td><td>Default signature secret for GitHub forwarding and replay.</td></tr><tr><td><code>GITHUB_APP_ID</code>, <code>GITHUB_APP_PRIVATE_KEY</code>, <code>GITHUB_APP_INSTALLATION_ID</code></td><td>GitHub App credentials for outbound API calls.</td></tr><tr><td><code>GITHUB_TOKEN</code>, <code>GH_TOKEN</code></td><td>Token credentials for outbound GitHub calls. Unset both for <code>github forward</code>.</td></tr><tr><td><code>GITLAB_TOKEN</code></td><td>Token for GitLab API reads and direct channel calls.</td></tr><tr><td><code>GITLAB_API_BASE_URL</code></td><td>Override the GitLab REST base URL for self-managed hosts.</td></tr><tr><td><code>GITLAB_WEBHOOK_SECRET</code></td><td>Default GitLab webhook token for replay and channel verification.</td></tr><tr><td><code>BITBUCKET_TOKEN</code></td><td>Token for Bitbucket API reads and direct channel calls.</td></tr><tr><td><code>BITBUCKET_API_BASE_URL</code></td><td>Override the Bitbucket Data Center REST base URL.</td></tr><tr><td><code>BITBUCKET_WEBHOOK_SECRET</code></td><td>Default Bitbucket signing secret for replay and channel verification.</td></tr><tr><td><code>SLACK_BOT_TOKEN</code>, <code>SLACK_APP_TOKEN</code></td><td>Slack tokens for one agent. Multi-agent servers use <code>&lt;PREFIX&gt;_SLACK_BOT_TOKEN</code> and <code>&lt;PREFIX&gt;_SLACK_APP_TOKEN</code>.</td></tr></tbody></table><h2 id="exit-status" tabindex="-1">Exit status <a class="header-anchor" href="#exit-status" aria-label="Permalink to &quot;Exit status&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Command</th><th>Nonzero contract</th></tr></thead><tbody><tr><td>No command</td><td>Print help and exit <code>1</code>. Explicit <code>help</code>, <code>--help</code>, and <code>-h</code> exit <code>0</code>.</td></tr><tr><td><code>run</code></td><td>For local and running-server trajectories, exit <code>1</code> when the trajectory fails.</td></tr><tr><td><code>call</code></td><td>Exit <code>1</code> unless the response succeeds with <code>ok: true</code>.</td></tr><tr><td><code>skill</code></td><td>Exit <code>2</code> when the name is missing and <code>1</code> when the request fails.</td></tr><tr><td><code>trajectory</code></td><td>Exit <code>1</code> when the reconstructed trajectory failed.</td></tr><tr><td><code>eval</code></td><td>Exit <code>1</code> for failed cases, or scored cases below threshold with <code>--strict</code>; exit <code>2</code> for invalid eval options or an execution with no matching cases. An empty <code>--list</code> succeeds.</td></tr><tr><td><code>eval status</code></td><td>Exit <code>3</code> while the batch runs, <code>1</code> when it failed or was cancelled, and <code>2</code> for invalid usage.</td></tr><tr><td><code>chat</code>, <code>session</code></td><td>Exit <code>2</code> for documented option conflicts or missing required input.</td></tr><tr><td><code>validate</code></td><td>Exit <code>1</code> when any project diagnostic has error severity.</td></tr><tr><td><code>convert-automation</code></td><td>Exit <code>1</code> for invalid input, authentication, export, or file-write failure. Warnings and dependency-install failure don&#39;t change a successful conversion exit.</td></tr><tr><td><code>migrate</code></td><td>Exit <code>0</code> after starting with <code>--no-wait</code> or after the agent opens a pull request. Exit <code>1</code> for invalid input, authentication or agent failure, or a completed run without a pull request.</td></tr><tr><td>Other commands</td><td>Exit nonzero when validation, authentication, a request, or the requested operation fails.</td></tr></tbody></table><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./project-layout.html">Project layout</a></li><li><a href="./sessions.html">Sessions, events, and streaming</a></li><li><a href="./evals.html">Evals</a></li><li><a href="./http-api.html">HTTP API</a></li><li><a href="./../deployment.html">Deployment</a></li><li><a href="./../guides/migrate.html">Early-alpha migration</a></li></ul>`,223)])])}const g=t(d,[["render",n]]);export{u as __pageData,g as default};
98
+ <span class="line"><span>bdk bitbucket forward [--dir &lt;path&gt;] [--host &lt;host&gt;] [--port &lt;n&gt;]</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Subcommand</th><th>Contract</th></tr></thead><tbody><tr><td><code>replay</code></td><td>Read a pull request, synthesize webhook payloads in the host&#39;s Cloud or Data Center format, and post them to matching channels.</td></tr><tr><td><code>events</code></td><td>List discovered Bitbucket channel URLs and event keys.</td></tr><tr><td><code>forward</code></td><td>Print the repository-hook and tunnel recipe for live deliveries.</td></tr></tbody></table><p>Replay supports <code>pullrequest:created</code>, <code>pullrequest:updated</code>, <code>pullrequest:comment_created</code>, and <code>repo:push</code>, along with their supported Data Center forms. It requires <code>BITBUCKET_TOKEN</code> with pull-request read access. <code>--secret</code> defaults to <code>BITBUCKET_WEBHOOK_SECRET</code>; <code>--dry-run</code> and <code>--out</code> follow the GitHub replay contract.</p><p>See <a href="./../guides/bitbucket.html">Bitbucket</a> for Cloud and Data Center setup.</p><h2 id="environment-variables" tabindex="-1">Environment variables <a class="header-anchor" href="#environment-variables" aria-label="Permalink to &quot;Environment variables&quot;">​</a></h2><p>Credential resolution follows this order: <code>--api-key</code>, <code>CURSOR_API_KEY</code>, <code>CURSOR_API_KEY_FILE</code>, <code>CURSOR_SERVICE_ACCOUNT_KEY</code>, then the stored login.</p><table tabindex="0"><thead><tr><th>Variable</th><th>Contract</th></tr></thead><tbody><tr><td><code>CURSOR_API_KEY</code></td><td>Cursor credential.</td></tr><tr><td><code>CURSOR_API_KEY_FILE</code></td><td>Path to a Cursor credential file.</td></tr><tr><td><code>CURSOR_SERVICE_ACCOUNT_KEY</code></td><td>Team service-account credential used after the API key and key-file sources.</td></tr><tr><td><code>CURSOR_API_BASE_URL</code></td><td>Backend for login, account, deployment, and event commands.</td></tr><tr><td><code>CURSOR_BACKEND_URL</code></td><td>Backend for BDK turns. Set it with <code>CURSOR_API_BASE_URL</code> when using a non-default backend.</td></tr><tr><td><code>AGENT_SERVE_CONFIG_DIR</code></td><td>Override the CLI config directory for stored credentials and update state.</td></tr><tr><td><code>AGENT_SERVE_NO_UPDATE_CHECK</code>, <code>NO_UPDATE_NOTIFIER</code>, <code>CI</code></td><td>Disable published-version checks when set to a non-empty value other than <code>0</code>.</td></tr><tr><td><code>GITHUB_WEBHOOK_SECRET</code></td><td>Default signature secret for GitHub forwarding and replay.</td></tr><tr><td><code>GITHUB_APP_ID</code>, <code>GITHUB_APP_PRIVATE_KEY</code>, <code>GITHUB_APP_INSTALLATION_ID</code></td><td>GitHub App credentials for outbound API calls.</td></tr><tr><td><code>GITHUB_TOKEN</code>, <code>GH_TOKEN</code></td><td>Token credentials for outbound GitHub calls. Unset both for <code>github forward</code>.</td></tr><tr><td><code>GITLAB_TOKEN</code></td><td>Token for GitLab API reads and direct channel calls.</td></tr><tr><td><code>GITLAB_API_BASE_URL</code></td><td>Override the GitLab REST base URL for self-managed hosts.</td></tr><tr><td><code>GITLAB_WEBHOOK_SECRET</code></td><td>Default GitLab webhook token for replay and channel verification.</td></tr><tr><td><code>BITBUCKET_TOKEN</code></td><td>Token for Bitbucket API reads and direct channel calls.</td></tr><tr><td><code>BITBUCKET_API_BASE_URL</code></td><td>Override the Bitbucket Data Center REST base URL.</td></tr><tr><td><code>BITBUCKET_WEBHOOK_SECRET</code></td><td>Default Bitbucket signing secret for replay and channel verification.</td></tr><tr><td><code>SLACK_BOT_TOKEN</code>, <code>SLACK_APP_TOKEN</code></td><td>Slack tokens for one agent. Multi-agent servers use <code>&lt;PREFIX&gt;_SLACK_BOT_TOKEN</code> and <code>&lt;PREFIX&gt;_SLACK_APP_TOKEN</code>.</td></tr></tbody></table><h2 id="exit-status" tabindex="-1">Exit status <a class="header-anchor" href="#exit-status" aria-label="Permalink to &quot;Exit status&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Command</th><th>Nonzero contract</th></tr></thead><tbody><tr><td>No command</td><td>Print help and exit <code>1</code>. Explicit <code>help</code>, <code>--help</code>, and <code>-h</code> exit <code>0</code>.</td></tr><tr><td><code>run</code></td><td>For local and running-server trajectories, exit <code>1</code> when the trajectory fails.</td></tr><tr><td><code>call</code></td><td>Exit <code>1</code> unless the response succeeds with <code>ok: true</code>.</td></tr><tr><td><code>skill</code></td><td>Exit <code>2</code> when the name is missing and <code>1</code> when the request fails.</td></tr><tr><td><code>trajectory</code></td><td>Exit <code>1</code> when the reconstructed trajectory failed.</td></tr><tr><td><code>eval</code></td><td>Exit <code>1</code> for failed cases, or scored cases below threshold with <code>--strict</code>; exit <code>2</code> for invalid eval options or an execution with no matching cases. An empty <code>--list</code> succeeds.</td></tr><tr><td><code>eval status</code></td><td>Exit <code>3</code> while the batch runs, <code>1</code> when it failed or was cancelled, and <code>2</code> for invalid usage.</td></tr><tr><td><code>chat</code>, <code>session</code></td><td>Exit <code>2</code> for documented option conflicts or missing required input.</td></tr><tr><td><code>validate</code></td><td>Exit <code>1</code> when any project diagnostic has error severity.</td></tr><tr><td><code>convert-automation</code></td><td>Exit <code>1</code> for invalid input, authentication, export, or file-write failure. Warnings and dependency-install failure don&#39;t change a successful conversion exit.</td></tr><tr><td><code>migrate</code></td><td>Exit <code>0</code> after starting with <code>--no-wait</code> or after the agent opens a pull request. Exit <code>1</code> for invalid input, authentication or agent failure, or a completed run without a pull request.</td></tr><tr><td>Other commands</td><td>Exit nonzero when validation, authentication, a request, or the requested operation fails.</td></tr></tbody></table><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./project-layout.html">Project layout</a></li><li><a href="./sessions.html">Sessions, events, and streaming</a></li><li><a href="./evals.html">Evals</a></li><li><a href="./http-api.html">HTTP API</a></li><li><a href="./../deployment.html">Deployment</a></li><li><a href="./../guides/migrate.html">Early-alpha migration</a></li></ul>`,230)])])}const g=t(d,[["render",n]]);export{u as __pageData,g as default};
@@ -1 +1 @@
1
- import{_ as t,c as a,o,a3 as s}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status.","frontmatter":{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status."},"headers":[],"relativePath":"reference/cli.md","filePath":"reference/cli.md"}'),d={name:"reference/cli.md"};function n(c,e,r,i,l,p){return o(),a("div",null,[...e[0]||(e[0]=[s("",223)])])}const g=t(d,[["render",n]]);export{u as __pageData,g as default};
1
+ import{_ as t,c as a,o,a3 as s}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status.","frontmatter":{"title":"CLI","description":"Look up BDK commands, targets, flags, outputs, and exit status."},"headers":[],"relativePath":"reference/cli.md","filePath":"reference/cli.md"}'),d={name:"reference/cli.md"};function n(r,e,c,i,l,p){return o(),a("div",null,[...e[0]||(e[0]=[s("",230)])])}const g=t(d,[["render",n]]);export{u as __pageData,g as default};
@@ -1,4 +1,4 @@
1
- import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse(`{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents.","frontmatter":{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents."},"headers":[],"relativePath":"reference/connections.md","filePath":"reference/connections.md"}`),n={name:"reference/connections.md"};function h(l,s,o,p,r,k){return e(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="mcp-connections" tabindex="-1">MCP connections <a class="header-anchor" href="#mcp-connections" aria-label="Permalink to &quot;MCP connections&quot;">​</a></h1><p>An MCP connection gives the agent tools from an MCP server. Define one file per server under <code>bot/mcp-connections/</code>; the filename becomes the server name. Default-export <code>defineConnection</code> from <code>@cursor/bdk/connections</code>. The transport is remote HTTP, local stdio, the signed-in Cursor account&#39;s connectors, or a peer agent on the same host.</p><p>Put a server in <code>bot/host-connections/</code> when only host tools should call it. Host connections use the same <code>defineConnection</code> shape and support <code>bdk mcp oauth</code>; the model and playground don&#39;t see them.</p><h2 id="remote-mcp-server" tabindex="-1">Remote MCP server <a class="header-anchor" href="#remote-mcp-server" aria-label="Permalink to &quot;Remote MCP server&quot;">​</a></h2><p>Point an MCP connection at a remote server with a URL.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineConnection } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/connections&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
1
+ import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse(`{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents.","frontmatter":{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents."},"headers":[],"relativePath":"reference/connections.md","filePath":"reference/connections.md"}`),n={name:"reference/connections.md"};function h(l,s,o,p,r,k){return e(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="mcp-connections" tabindex="-1">MCP connections <a class="header-anchor" href="#mcp-connections" aria-label="Permalink to &quot;MCP connections&quot;">​</a></h1><p>An MCP connection gives the agent tools from an MCP server. Define one file per server under <code>bot/mcp-connections/</code>; the filename becomes the server name. Default-export <code>defineConnection</code> from <code>@cursor/bdk/connections</code>. The transport is remote HTTP, local stdio, the signed-in Cursor account&#39;s connectors, or a peer agent addressed by slug.</p><p>Put a server in <code>bot/host-connections/</code> when only host tools should call it. Host connections use the same <code>defineConnection</code> shape and support <code>bdk mcp oauth</code>; the model and playground don&#39;t see them.</p><h2 id="remote-mcp-server" tabindex="-1">Remote MCP server <a class="header-anchor" href="#remote-mcp-server" aria-label="Permalink to &quot;Remote MCP server&quot;">​</a></h2><p>Point an MCP connection at a remote server with a URL.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineConnection } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/connections&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
2
2
  <span class="line"></span>
3
3
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineConnection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
4
4
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> url: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;https://mcp.linear.app/mcp&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
@@ -50,10 +50,10 @@ import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
50
50
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> cursorAccount: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
51
51
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> servers: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Linear&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
52
52
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> advertiseTools: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
53
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Name the file <code>account.ts</code>. <code>cursor.ts</code> collides with the IDE <code>cursor</code> MCP namespace. <code>advertiseTools: true</code> puts connector tools on local turns by name.</p><p>The host must be signed in (<code>bdk login</code>, <code>CURSOR_API_KEY</code>, or <code>CURSOR_SERVICE_ACCOUNT_KEY</code>). <code>serve</code> fails at startup otherwise.</p><p>Use a <code>{ command }</code> connection for stdio servers.</p><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p>Whoever can talk to the agent can drive these connectors, because they are ordinary agent tools. <code>serve</code> refuses to start when <code>--allow-anonymous</code> is combined with account MCP connections unless you also pass <code>--allow-anonymous-cursor-account-mcp</code> (trusted boundary only; for example an SSO proxy or the hosted alias token). Prefer <code>--bearer-token</code> on shared hosts.</p></div><h2 id="peer-mcp-connection" tabindex="-1">Peer MCP connection <a class="header-anchor" href="#peer-mcp-connection" aria-label="Permalink to &quot;Peer MCP connection {#peer-mcp-connection}&quot;">​</a></h2><p><code>{ agent: &quot;&lt;slug&gt;&quot; }</code> addresses another agent mounted on the same serve host. The model gets the peer&#39;s <code>ask</code> and <code>check</code> tools, plus <code>call_tool</code> when the peer has server tools, and can delegate work to it:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineConnection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
53
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Name the file <code>account.ts</code>. <code>cursor.ts</code> collides with the IDE <code>cursor</code> MCP namespace. <code>advertiseTools: true</code> puts connector tools on local turns by name.</p><p>The host must be signed in (<code>bdk login</code>, <code>CURSOR_API_KEY</code>, or <code>CURSOR_SERVICE_ACCOUNT_KEY</code>). <code>serve</code> fails at startup otherwise.</p><p>Use a <code>{ command }</code> connection for stdio servers.</p><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p>Whoever can talk to the agent can drive these connectors, because they are ordinary agent tools. <code>serve</code> refuses to start when <code>--allow-anonymous</code> is combined with account MCP connections unless you also pass <code>--allow-anonymous-cursor-account-mcp</code> (trusted boundary only; for example an SSO proxy or the hosted alias token). Prefer <code>--bearer-token</code> on shared hosts.</p></div><h2 id="peer-mcp-connection" tabindex="-1">Peer MCP connection <a class="header-anchor" href="#peer-mcp-connection" aria-label="Permalink to &quot;Peer MCP connection {#peer-mcp-connection}&quot;">​</a></h2><p><code>{ agent: &quot;&lt;slug&gt;&quot; }</code> addresses another agent without configuring a URL, headers, or secrets. On a local multi-agent serve, the target is another mount slug. On Cursor-managed hosting, it is the lowercase deployment slug of another agent on the same team.</p><p>On a local multi-agent serve, the model gets the peer&#39;s <code>ask</code> and <code>check</code> tools, plus <code>call_tool</code> when the peer has server tools, and can delegate work to it:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineConnection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
54
54
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> agent: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;weather-agent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
55
55
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> description: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Delegate weather questions to the weather agent.&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
56
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Unknown slugs and self-references fail <code>serve</code> at startup. Walkthrough: <a href="./../guides/agent-to-agent.html#delegate-a-question-to-a-specialist">Peer agents</a>.</p><h2 id="call-mcp-from-host-code" tabindex="-1">Call MCP from host code <a class="header-anchor" href="#call-mcp-from-host-code" aria-label="Permalink to &quot;Call MCP from host code&quot;">​</a></h2><p>A file under <code>bot/mcp-connections/</code> is available to the Cursor agent, to server tools through <code>ctx.host.mcp</code>, and to channel and schedule handlers through <code>args.host.mcp</code>. Host connections skip the model.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/tools/search_linear.ts</span></span>
56
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Declare the connection only on the caller. The specialist needs no matching configuration.</p><p>In a local multi-agent serve, unknown slugs and self-references fail at startup. A single-agent serve omits peers with a warning unless its hosting platform sets <code>--peers-url</code>. Walkthrough: <a href="./../guides/agent-to-agent.html#delegate-a-question-to-a-specialist">Peer agents</a>.</p><h2 id="call-mcp-from-host-code" tabindex="-1">Call MCP from host code <a class="header-anchor" href="#call-mcp-from-host-code" aria-label="Permalink to &quot;Call MCP from host code&quot;">​</a></h2><p>A file under <code>bot/mcp-connections/</code> is available to the Cursor agent, to server tools through <code>ctx.host.mcp</code>, and to channel and schedule handlers through <code>args.host.mcp</code>. Host connections skip the model.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/tools/search_linear.ts</span></span>
57
57
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineTool } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/tools&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
58
58
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { z } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;zod&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
59
59
  <span class="line"></span>
@@ -63,4 +63,4 @@ import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
63
63
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> execute</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">query</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">ctx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
64
64
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.host.mcp.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">callTool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;linear&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;list_issues&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { query });</span></span>
65
65
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
66
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>host.mcp.names()</code> lists connection names. <code>listTools(name)</code> / <code>callTool(name, tool, args)</code> call into a named connection.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./../guides/mcp-oauth.html">Host MCP OAuth</a>: <code>mcp oauth</code>, Connect, and hosted agents</li><li><a href="./tools.html">Tools</a>: authored tools that wrap MCP connections</li><li><a href="./../guides/webhooks.html">Webhooks</a>: calling MCP connections from handlers</li><li><a href="./../guides/agent-to-agent.html">Peer agents</a>: when a specialist is its own agent</li></ul>`,58)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
66
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>host.mcp.names()</code> lists connection names. <code>listTools(name)</code> / <code>callTool(name, tool, args)</code> call into a named connection.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./../guides/mcp-oauth.html">Host MCP OAuth</a>: <code>mcp oauth</code>, Connect, and hosted agents</li><li><a href="./tools.html">Tools</a>: authored tools that wrap MCP connections</li><li><a href="./../guides/webhooks.html">Webhooks</a>: calling MCP connections from handlers</li><li><a href="./../guides/agent-to-agent.html">Peer agents</a>: when a specialist is its own agent</li></ul>`,60)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
@@ -1 +1 @@
1
- import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse(`{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents.","frontmatter":{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents."},"headers":[],"relativePath":"reference/connections.md","filePath":"reference/connections.md"}`),n={name:"reference/connections.md"};function h(l,s,o,p,r,k){return e(),a("div",null,[...s[0]||(s[0]=[t("",58)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
1
+ import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse(`{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents.","frontmatter":{"title":"MCP connections","description":"Pull in tools from MCP servers: remote, stdio, the signed-in Cursor account's connectors, and peer agents."},"headers":[],"relativePath":"reference/connections.md","filePath":"reference/connections.md"}`),n={name:"reference/connections.md"};function h(l,s,o,p,r,k){return e(),a("div",null,[...s[0]||(s[0]=[t("",60)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
@@ -15,7 +15,7 @@ import{_ as e,c as t,o as a,a3 as i}from"./chunks/framework.BNw1pucY.js";const k
15
15
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">increment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;acme.turn.failed&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { channel: ctx.channel.id });</span></span>
16
16
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
17
17
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
18
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Any module under <code>bot/hooks/</code>, subfolders included, is a hook named by its path without the extension: <code>bot/hooks/audit/usage.ts</code> is <code>audit/usage</code>. <code>*.test.ts</code> and <code>*.spec.ts</code> files are skipped. The default export must be <code>defineHook(...)</code>, names can&#39;t contain <code>__</code>, and an empty <code>events</code> map skips the hook with a warning; <code>bdk validate</code> reports all three. An extension mounts its hooks as <code>&lt;ns&gt;__&lt;name&gt;</code>, and <code>disableHook()</code> removes one (<a href="./extensions.html#adjust-a-mounted-extension">Adjust a mounted extension</a>).</p><p><code>bdk init</code> scaffolds <code>bot/hooks/memory.ts</code>, which exports <code>memoryHook()</code> from <code>@cursor/bdk/memory</code> and journals every turn for later sessions to read. Delete the file to opt out.</p><h2 id="events-and-payloads" tabindex="-1">Events and payloads <a class="header-anchor" href="#events-and-payloads" aria-label="Permalink to &quot;Events and payloads&quot;">​</a></h2><p>Keys are event types from the <a href="./sessions.html#stream-events">event vocabulary</a>, or <code>&quot;*&quot;</code> for every event. A typed key narrows <code>event.data</code>; a <code>&quot;*&quot;</code> handler receives the union, so switch on <code>event.type</code>. Every event carries the stream envelope <code>{ type, index, sessionId, turnId?, at, data }</code>, with <code>turnId</code> set on turn-scoped events. Skip <code>*.appended</code> deltas when you want the final text; <code>message.completed</code> already has it.</p><table tabindex="0"><thead><tr><th>Event</th><th><code>event.data</code></th></tr></thead><tbody><tr><td><code>message.received</code></td><td><code>{ text }</code></td></tr><tr><td><code>turn.completed</code></td><td><code>{ result?, usage?, cost? }</code>. <code>usage</code> has <code>inputTokens</code>, <code>outputTokens</code>, <code>cacheReadTokens</code>, <code>cacheWriteTokens</code>, and optional <code>reasoningTokens</code>. <code>cost</code> has <code>totalUsd</code> and the <code>model</code> it was priced against</td></tr><tr><td><code>turn.failed</code></td><td><code>{ message, status? }</code>. <code>status</code> is <code>&quot;error&quot;</code> or <code>&quot;cancelled&quot;</code> when present</td></tr><tr><td><code>actions.requested</code></td><td><code>{ calls: [{ callId, toolName, args?, parentCallId? }], parentCallId? }</code>. One envelope per model step once that step has listed its tools. A single tool is a batch of one. <code>parentCallId</code> marks subagent work</td></tr><tr><td><code>actions.completed</code></td><td><code>{ results: [{ callId, toolName, output?, isError, stubbed?, parentCallId? }], parentCallId? }</code>. Pair with <code>actions.requested</code>; emitted when every call in that batch has a result</td></tr><tr><td><code>action.result</code></td><td><code>{ callId, toolName, output?, isError, stubbed?, parentCallId? }</code>. Live per-call envelope for chips and spans. <code>stubbed</code> means a dry-run session answered a write without running it</td></tr><tr><td><code>action.tool_retry</code></td><td><code>{ callId, toolName, attempt, reason, connection? }</code>. A read is running again after a transient failure. <code>attempt</code> is the try about to run. <code>reason</code> is a class such as <code>transport</code> or <code>http_503</code></td></tr></tbody></table><p>The types are <code>SessionEvent</code>, <code>SessionEventType</code>, and <code>HookContext</code>, exported from <code>@cursor/bdk</code>.</p><h2 id="handler-context" tabindex="-1">Handler context <a class="header-anchor" href="#handler-context" aria-label="Permalink to &quot;Handler context&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Member</th><th>What it is</th></tr></thead><tbody><tr><td><code>ctx.session</code></td><td>Read-only session info: <code>id</code>, <code>channelId</code>, <code>mode</code> (<code>chat</code> or <code>task</code>), <code>purpose</code> (<code>live</code> or <code>eval</code>), <code>auth</code>, plus <code>title</code> and <code>sdkAgentId</code> when set</td></tr><tr><td><code>ctx.agent</code></td><td><code>{ name }</code> of the agent the event belongs to</td></tr><tr><td><code>ctx.channel</code></td><td><code>{ id, continuationToken }</code>. The token is <code>null</code> when the session can&#39;t take follow-ups</td></tr><tr><td><code>ctx.host.kv</code></td><td>Durable JSON, shared by every session of the agent. Prefix keys with <code>ctx.session.id</code> for per-session state</td></tr><tr><td><code>ctx.host.files</code></td><td>Durable files, bound to this session. Pass <code>{ scope: &quot;deployment&quot; }</code> for agent-wide files</td></tr><tr><td><code>ctx.host.otel</code></td><td>Counters, histograms, and tags, attributed to this session</td></tr><tr><td><code>ctx.host.mcp</code>, <code>ctx.host.github</code>, <code>ctx.host.slack</code></td><td>The same shared clients tools get</td></tr><tr><td><code>ctx.host.reminders</code></td><td>Per-session <a href="./schedules.html#reminders">reminders</a>, the same API tools get</td></tr><tr><td><code>ctx.artifacts</code></td><td>Session-bound <a href="./artifacts.html">artifacts</a> facade: <code>tag</code> fills in <code>sessionId</code> and <code>turnId</code></td></tr><tr><td><code>ctx.stateRoot</code></td><td>Absolute path of the local state root. It resets when a hosted deployment is replaced; keep derived state in <code>kv</code> or <code>files</code></td></tr></tbody></table><h2 id="hook-dispatch" tabindex="-1">Hook dispatch <a class="header-anchor" href="#hook-dispatch" aria-label="Permalink to &quot;Hook dispatch&quot;">​</a></h2><p>A hook runs after the event is recorded. It never delays the model and never sees an event that wasn&#39;t recorded.</p><table tabindex="0"><thead><tr><th>Rule</th><th>What happens</th></tr></thead><tbody><tr><td>Same session</td><td>Events dispatch one at a time</td></tr><tr><td>Eval sessions</td><td>The same stream fires; skip metering or paging when <code>ctx.session.purpose === &quot;eval&quot;</code></td></tr><tr><td>Host restart</td><td>Recorded events are not replayed into hooks, so a mirror needs no dedupe</td></tr><tr><td>Slow handler</td><td>Holds the next event&#39;s handlers on that session, not the model. Keep handlers short and queue anything slow</td></tr></tbody></table><p>Read hosted secrets inside the handler, not at module scope. Give outbound calls a timeout; a stalled request holds later handlers on that session. Skip cancelled turns when paging; they record interrupted work.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/hooks/page-on-failure.ts</span></span>
18
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Any module under <code>bot/hooks/</code>, subfolders included, is a hook named by its path without the extension: <code>bot/hooks/audit/usage.ts</code> is <code>audit/usage</code>. <code>*.test.ts</code> and <code>*.spec.ts</code> files are skipped. The default export must be <code>defineHook(...)</code>, names can&#39;t contain <code>__</code>, and an empty <code>events</code> map skips the hook with a warning; <code>bdk validate</code> reports all three. An extension mounts its hooks as <code>&lt;ns&gt;__&lt;name&gt;</code>, and <code>disableHook()</code> removes one (<a href="./extensions.html#adjust-a-mounted-extension">Adjust a mounted extension</a>).</p><p><code>bdk init</code> scaffolds <code>bot/hooks/memory.ts</code>, which exports <code>memoryHook()</code> from <code>@cursor/bdk/memory</code> and journals every turn for later sessions to read. Delete the file to opt out. See <a href="./memory.html">Memory</a>.</p><h2 id="events-and-payloads" tabindex="-1">Events and payloads <a class="header-anchor" href="#events-and-payloads" aria-label="Permalink to &quot;Events and payloads&quot;">​</a></h2><p>Keys are event types from the <a href="./sessions.html#stream-events">event vocabulary</a>, or <code>&quot;*&quot;</code> for every event. A typed key narrows <code>event.data</code>; a <code>&quot;*&quot;</code> handler receives the union, so switch on <code>event.type</code>. Every event carries the stream envelope <code>{ type, index, sessionId, turnId?, at, data }</code>, with <code>turnId</code> set on turn-scoped events. Skip <code>*.appended</code> deltas when you want the final text; <code>message.completed</code> already has it.</p><table tabindex="0"><thead><tr><th>Event</th><th><code>event.data</code></th></tr></thead><tbody><tr><td><code>message.received</code></td><td><code>{ text }</code></td></tr><tr><td><code>turn.completed</code></td><td><code>{ result?, usage?, cost? }</code>. <code>usage</code> has <code>inputTokens</code>, <code>outputTokens</code>, <code>cacheReadTokens</code>, <code>cacheWriteTokens</code>, and optional <code>reasoningTokens</code>. <code>cost</code> has <code>totalUsd</code> and the <code>model</code> it was priced against</td></tr><tr><td><code>turn.failed</code></td><td><code>{ message, status? }</code>. <code>status</code> is <code>&quot;error&quot;</code> or <code>&quot;cancelled&quot;</code> when present</td></tr><tr><td><code>actions.requested</code></td><td><code>{ calls: [{ callId, toolName, args?, parentCallId? }], parentCallId? }</code>. One envelope per model step once that step has listed its tools. A single tool is a batch of one. <code>parentCallId</code> marks subagent work</td></tr><tr><td><code>actions.completed</code></td><td><code>{ results: [{ callId, toolName, output?, isError, stubbed?, parentCallId? }], parentCallId? }</code>. Pair with <code>actions.requested</code>; emitted when every call in that batch has a result</td></tr><tr><td><code>action.result</code></td><td><code>{ callId, toolName, output?, isError, stubbed?, parentCallId? }</code>. Live per-call envelope for chips and spans. <code>stubbed</code> means a dry-run session answered a write without running it</td></tr><tr><td><code>action.tool_retry</code></td><td><code>{ callId, toolName, attempt, reason, connection? }</code>. A read is running again after a transient failure. <code>attempt</code> is the try about to run. <code>reason</code> is a class such as <code>transport</code> or <code>http_503</code></td></tr></tbody></table><p>The types are <code>SessionEvent</code>, <code>SessionEventType</code>, and <code>HookContext</code>, exported from <code>@cursor/bdk</code>.</p><h2 id="handler-context" tabindex="-1">Handler context <a class="header-anchor" href="#handler-context" aria-label="Permalink to &quot;Handler context&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Member</th><th>What it is</th></tr></thead><tbody><tr><td><code>ctx.session</code></td><td>Read-only session info: <code>id</code>, <code>channelId</code>, <code>mode</code> (<code>chat</code> or <code>task</code>), <code>purpose</code> (<code>live</code> or <code>eval</code>), <code>auth</code>, plus <code>title</code> and <code>sdkAgentId</code> when set</td></tr><tr><td><code>ctx.agent</code></td><td><code>{ name }</code> of the agent the event belongs to</td></tr><tr><td><code>ctx.channel</code></td><td><code>{ id, continuationToken }</code>. The token is <code>null</code> when the session can&#39;t take follow-ups</td></tr><tr><td><code>ctx.host.kv</code></td><td>Durable JSON, shared by every session of the agent. Prefix keys with <code>ctx.session.id</code> for per-session state</td></tr><tr><td><code>ctx.host.files</code></td><td>Durable files, bound to this session. Pass <code>{ scope: &quot;deployment&quot; }</code> for agent-wide files</td></tr><tr><td><code>ctx.host.otel</code></td><td>Counters, histograms, and tags, attributed to this session</td></tr><tr><td><code>ctx.host.mcp</code>, <code>ctx.host.github</code>, <code>ctx.host.slack</code></td><td>The same shared clients tools get</td></tr><tr><td><code>ctx.host.reminders</code></td><td>Per-session <a href="./schedules.html#reminders">reminders</a>, the same API tools get</td></tr><tr><td><code>ctx.artifacts</code></td><td>Session-bound <a href="./artifacts.html">artifacts</a> facade: <code>tag</code> fills in <code>sessionId</code> and <code>turnId</code></td></tr><tr><td><code>ctx.stateRoot</code></td><td>Absolute path of the local state root. It resets when a hosted deployment is replaced; keep derived state in <code>kv</code> or <code>files</code></td></tr></tbody></table><h2 id="hook-dispatch" tabindex="-1">Hook dispatch <a class="header-anchor" href="#hook-dispatch" aria-label="Permalink to &quot;Hook dispatch&quot;">​</a></h2><p>A hook runs after the event is recorded. It never delays the model and never sees an event that wasn&#39;t recorded.</p><table tabindex="0"><thead><tr><th>Rule</th><th>What happens</th></tr></thead><tbody><tr><td>Same session</td><td>Events dispatch one at a time</td></tr><tr><td>Eval sessions</td><td>The same stream fires; skip metering or paging when <code>ctx.session.purpose === &quot;eval&quot;</code></td></tr><tr><td>Host restart</td><td>Recorded events are not replayed into hooks, so a mirror needs no dedupe</td></tr><tr><td>Slow handler</td><td>Holds the next event&#39;s handlers on that session, not the model. Keep handlers short and queue anything slow</td></tr></tbody></table><p>Read hosted secrets inside the handler, not at module scope. Give outbound calls a timeout; a stalled request holds later handlers on that session. Skip cancelled turns when paging; they record interrupted work.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/hooks/page-on-failure.ts</span></span>
19
19
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineHook } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/hooks&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
20
20
  <span class="line"></span>
21
21
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineHook</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
@@ -0,0 +1,4 @@
1
+ import{_ as s,c as t,o as a,a3 as o}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Memory","description":"Journal every turn so later sessions can read what earlier ones did.","frontmatter":{"title":"Memory","description":"Journal every turn so later sessions can read what earlier ones did."},"headers":[],"relativePath":"reference/memory.md","filePath":"reference/memory.md"}'),i={name:"reference/memory.md"};function r(n,e,d,h,l,c){return a(),t("div",null,[...e[0]||(e[0]=[o(`<h1 id="memory" tabindex="-1">Memory <a class="header-anchor" href="#memory" aria-label="Permalink to &quot;Memory&quot;">​</a></h1><p>Memory lets an agent recall work from earlier sessions. A memory hook appends one record per turn to a shared journal, and the model reads that journal with its normal file tools when its instructions send it there. Every session and every user of the agent shares one journal.</p><h2 id="memory-is-on-by-default" tabindex="-1">Memory is on by default <a class="header-anchor" href="#memory-is-on-by-default" aria-label="Permalink to &quot;Memory is on by default&quot;">​</a></h2><p><code>bdk init</code> scaffolds <code>bot/hooks/memory.ts</code>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/hooks/memory.ts</span></span>
2
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { memoryHook } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/bdk/memory&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
3
+ <span class="line"></span>
4
+ <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoryHook</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span></code></pre></div><p>It also adds a <code>## Memory</code> section to <code>bot/instructions.md</code>. The model has no recall tool, so that section is what sends it to the journal: it says when to read <code>memory/</code>, and it tells the model to treat records as untrusted history. To add memory to an existing project, create the hook file and copy the <code>## Memory</code> section from a fresh <code>bdk init</code> project into your instructions. To turn memory off, delete the hook file and the <code>## Memory</code> section.</p><h2 id="journal-records" tabindex="-1">Journal records <a class="header-anchor" href="#journal-records" aria-label="Permalink to &quot;Journal records&quot;">​</a></h2><p>The hook appends one JSON line to <code>memory/journal.jsonl</code> after each turn completes or fails:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;at&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;2026-10-01T16:42:09.118Z&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;sessionId&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;5f0c2a9e-7d1b-4c43-9a6e-2b8f1e0d7c35&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;channelId&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;slack&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;status&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;completed&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;title&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Checkout flaky test&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;userMessage&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Why does acme/checkout fail on main?&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;result&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;The cart test races the price service mock...&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;usage&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:{</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;inputTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">18234</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;outputTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">912</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;cacheReadTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">15002</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">&quot;cacheWriteTokens&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}}</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Field</th><th>Contract</th></tr></thead><tbody><tr><td><code>at</code></td><td>ISO-8601 time the turn finished</td></tr><tr><td><code>sessionId</code></td><td>Session that ran the turn</td></tr><tr><td><code>channelId</code></td><td>Channel that started the session, such as <code>http</code> for the session API</td></tr><tr><td><code>status</code></td><td><code>&quot;completed&quot;</code> or <code>&quot;failed&quot;</code></td></tr><tr><td><code>title</code></td><td>Session title, when the channel set one</td></tr><tr><td><code>userMessage</code></td><td>The message that started the turn, truncated to <code>maxTextLength</code></td></tr><tr><td><code>result</code></td><td>Final assistant text, or the failure message, truncated to <code>maxTextLength</code></td></tr><tr><td><code>usage</code></td><td>Token usage for completed turns; see <a href="./hooks.html#events-and-payloads">Events and payloads</a></td></tr></tbody></table><p>As the journal grows, older records move to <code>journal-*.jsonl</code> files beside it. Point the model at the whole <code>memory/</code> directory when it needs history beyond the latest segment.</p><h2 id="read-memory" tabindex="-1">Read memory <a class="header-anchor" href="#read-memory" aria-label="Permalink to &quot;Read memory&quot;">​</a></h2><p>Local turns find the journal at <code>memory/</code> in the session workspace. On a Cursor-hosted deployment, the first prompt of each session names the journal&#39;s path on that machine. A session on a server you run yourself can&#39;t reach the journal.</p><p><code>memory</code> is a reserved workspace path. BDK rejects per-send <code>workspaceFiles</code> and <code>sandbox/workspace/</code> seed files under <code>memory/</code>, so callers can&#39;t write records through the workspace.</p><p>Local servers keep the journal in the project state directory. <code>bdk run</code> and <code>bdk eval</code> start an ephemeral server with a fresh state directory unless you pass <code>--state-root</code>, so each run starts with empty memory. Use <code>bdk serve</code> or <code>bdk dev</code>, or pass the same <code>--state-root</code>, to keep memory across runs. Hosted deployments keep the journal across redeploys.</p><h2 id="who-sees-memory" tabindex="-1">Who sees memory <a class="header-anchor" href="#who-sees-memory" aria-label="Permalink to &quot;Who sees memory&quot;">​</a></h2><p>Records from every session and every user land in the same journal, so one person&#39;s messages and the agent&#39;s replies to them can surface in another person&#39;s session. Turn memory off for an agent whose users shouldn&#39;t see each other&#39;s requests. Turning it off stops new records, but the journal keeps the records it already has. On a local server, delete the <code>memory/</code> directory in the project state directory to clear them. On Cursor-managed hosting, the journal is deployment data, so <a href="./../deployment.html#privacy-mode">Privacy Mode</a> applies to it.</p><p>Anyone who can message the agent can put text in the journal. The scaffolded instructions tell the model never to follow instructions found inside records; keep that rule if you write your own section.</p><h2 id="memory-and-host-state" tabindex="-1">Memory and host state <a class="header-anchor" href="#memory-and-host-state" aria-label="Permalink to &quot;Memory and host state&quot;">​</a></h2><p>Memory is advisory. A record can be dropped, and records written by concurrent sessions can show up only in a later session. Keep state your code depends on, such as dedupe records and cursors, in <code>ctx.host.kv</code> or <code>ctx.host.files</code>; see <a href="./hooks.html#handler-context">Handler context</a>.</p><h2 id="options" tabindex="-1">Options <a class="header-anchor" href="#options" aria-label="Permalink to &quot;Options&quot;">​</a></h2><p><code>memoryHook(options?)</code> accepts:</p><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>maxTextLength</code></td><td>Truncation cap for <code>userMessage</code> and <code>result</code>. Default <code>2000</code> characters.</td></tr><tr><td><code>backend</code></td><td>A <code>MemoryBackend</code> that replaces the default journal</td></tr></tbody></table><p>A <code>MemoryBackend</code> has <code>appendTurn(record, { stateRoot, agentName })</code>, which receives each record, and an optional <code>prepareSession({ stateRoot, agentName })</code>, which runs when a session starts. Records go only where <code>appendTurn</code> sends them, but the <code>memory/</code> directory and the hosted first-prompt path still point at the default journal. Give the model a tool or file to read your records, and write instructions that send it there instead of <code>memory/</code>.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./hooks.html">Hooks</a></li><li><a href="./instructions.html">Instructions</a></li><li><a href="./sessions.html">Sessions</a></li><li><a href="./../deployment.html">Deployment</a></li></ul>`,26)])])}const u=s(i,[["render",r]]);export{k as __pageData,u as default};
@@ -0,0 +1 @@
1
+ import{_ as s,c as t,o as a,a3 as o}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Memory","description":"Journal every turn so later sessions can read what earlier ones did.","frontmatter":{"title":"Memory","description":"Journal every turn so later sessions can read what earlier ones did."},"headers":[],"relativePath":"reference/memory.md","filePath":"reference/memory.md"}'),i={name:"reference/memory.md"};function r(n,e,d,h,l,c){return a(),t("div",null,[...e[0]||(e[0]=[o("",26)])])}const u=s(i,[["render",r]]);export{k as __pageData,u as default};
@@ -1,6 +1,6 @@
1
- import{_ as i,c as e,o as t,a3 as a}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Skills","description":"On-demand procedures the model loads only when relevant, in three authoring forms.","frontmatter":{"title":"Skills","description":"On-demand procedures the model loads only when relevant, in three authoring forms."},"headers":[],"relativePath":"reference/skills.md","filePath":"reference/skills.md"}'),l={name:"reference/skills.md"};function n(h,s,r,o,d,p){return t(),e("div",null,[...s[0]||(s[0]=[a(`<h1 id="skills" tabindex="-1">Skills <a class="header-anchor" href="#skills" aria-label="Permalink to &quot;Skills&quot;">​</a></h1><p>A skill is an on-demand procedure following the <code>SKILL.md</code> convention: the harness advertises each skill by its description, and the model loads the full content only when the task calls for it. Skills are how you give an agent a multi-step workflow without carrying it in the always-on <a href="./instructions.html">instructions</a>.</p><h2 id="authoring-forms" tabindex="-1">Authoring forms <a class="header-anchor" href="#authoring-forms" aria-label="Permalink to &quot;Authoring forms&quot;">​</a></h2><p>Skills support three authoring forms.</p><table tabindex="0"><thead><tr><th>Form</th><th>Reach for it when</th></tr></thead><tbody><tr><td><code>bot/skills/&lt;name&gt;.md</code></td><td>Static Markdown. Optional <code>description</code> frontmatter; the first body line is the fallback.</td></tr><tr><td><code>bot/skills/&lt;name&gt;/SKILL.md</code> plus siblings</td><td>A packaged directory with reference files (<code>references/…</code>). Requires <code>description</code> frontmatter.</td></tr><tr><td><code>bot/skills/&lt;name&gt;.ts</code></td><td>Generated content, with <code>defineSkill</code> from <code>@cursor/bdk/skills</code>.</td></tr></tbody></table><p>Use flat Markdown for static content:</p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">---</span></span>
2
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">description: Use when a pull request needs a structured approval checklist.</span></span>
3
- <span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">---</span></span>
1
+ import{_ as i,c as e,o as t,a3 as a}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Skills","description":"On-demand procedures the model loads only when relevant, in three authoring forms.","frontmatter":{"title":"Skills","description":"On-demand procedures the model loads only when relevant, in three authoring forms."},"headers":[],"relativePath":"reference/skills.md","filePath":"reference/skills.md"}'),l={name:"reference/skills.md"};function n(h,s,r,o,d,p){return t(),e("div",null,[...s[0]||(s[0]=[a(`<h1 id="skills" tabindex="-1">Skills <a class="header-anchor" href="#skills" aria-label="Permalink to &quot;Skills&quot;">​</a></h1><p>A skill is an on-demand procedure following the <code>SKILL.md</code> convention: the harness advertises each skill by its description, and the model loads the full content only when the task calls for it. Skills are how you give an agent a multi-step workflow without carrying it in the always-on <a href="./instructions.html">instructions</a>.</p><h2 id="authoring-forms" tabindex="-1">Authoring forms <a class="header-anchor" href="#authoring-forms" aria-label="Permalink to &quot;Authoring forms&quot;">​</a></h2><p>Skills support three authoring forms.</p><table tabindex="0"><thead><tr><th>Form</th><th>Reach for it when</th></tr></thead><tbody><tr><td><code>bot/skills/&lt;name&gt;.md</code></td><td>Static Markdown. Optional <code>description</code> frontmatter; the first body line is the fallback.</td></tr><tr><td><code>bot/skills/&lt;name&gt;/SKILL.md</code> plus siblings</td><td>A packaged directory with reference files (<code>references/…</code>). Requires <code>description</code> frontmatter.</td></tr><tr><td><code>bot/skills/&lt;name&gt;.ts</code></td><td>Generated content, with <code>defineSkill</code> from <code>@cursor/bdk/skills</code>.</td></tr></tbody></table><p>Use flat Markdown for static content:</p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">---</span></span>
2
+ <span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">description</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Use when a pull request needs a structured approval checklist.</span></span>
3
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">---</span></span>
4
4
  <span class="line"></span>
5
5
  <span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;"># PR review checklist</span></span>
6
6
  <span class="line"></span>