@secretstartups/workshop 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.md +246 -2
  3. package/dist/agent/agent-session.d.ts +60 -0
  4. package/dist/agent/agent-session.js +262 -0
  5. package/dist/agent/agent-session.js.map +1 -0
  6. package/dist/agent/agent.module.d.ts +2 -0
  7. package/dist/agent/agent.module.js +46 -0
  8. package/dist/agent/agent.module.js.map +1 -0
  9. package/dist/agent/build-api.service.d.ts +141 -0
  10. package/dist/agent/build-api.service.js +100 -0
  11. package/dist/agent/build-api.service.js.map +1 -0
  12. package/dist/agent/build-events.types.d.ts +172 -0
  13. package/dist/agent/build-events.types.js +11 -0
  14. package/dist/agent/build-events.types.js.map +1 -0
  15. package/dist/agent/commands/agent-diff.command.d.ts +17 -0
  16. package/dist/agent/commands/agent-diff.command.js +84 -0
  17. package/dist/agent/commands/agent-diff.command.js.map +1 -0
  18. package/dist/agent/commands/agent-files.command.d.ts +19 -0
  19. package/dist/agent/commands/agent-files.command.js +93 -0
  20. package/dist/agent/commands/agent-files.command.js.map +1 -0
  21. package/dist/agent/commands/agent-merge.command.d.ts +17 -0
  22. package/dist/agent/commands/agent-merge.command.js +101 -0
  23. package/dist/agent/commands/agent-merge.command.js.map +1 -0
  24. package/dist/agent/commands/agent-models.command.d.ts +14 -0
  25. package/dist/agent/commands/agent-models.command.js +49 -0
  26. package/dist/agent/commands/agent-models.command.js.map +1 -0
  27. package/dist/agent/commands/agent-resume.command.d.ts +14 -0
  28. package/dist/agent/commands/agent-resume.command.js +72 -0
  29. package/dist/agent/commands/agent-resume.command.js.map +1 -0
  30. package/dist/agent/commands/agent-rm.command.d.ts +16 -0
  31. package/dist/agent/commands/agent-rm.command.js +71 -0
  32. package/dist/agent/commands/agent-rm.command.js.map +1 -0
  33. package/dist/agent/commands/agent-sessions.command.d.ts +22 -0
  34. package/dist/agent/commands/agent-sessions.command.js +92 -0
  35. package/dist/agent/commands/agent-sessions.command.js.map +1 -0
  36. package/dist/agent/commands/agent.command.d.ts +65 -0
  37. package/dist/agent/commands/agent.command.js +819 -0
  38. package/dist/agent/commands/agent.command.js.map +1 -0
  39. package/dist/agent/executor/allowlist.d.ts +11 -0
  40. package/dist/agent/executor/allowlist.js +56 -0
  41. package/dist/agent/executor/allowlist.js.map +1 -0
  42. package/dist/agent/executor/approval.d.ts +24 -0
  43. package/dist/agent/executor/approval.js +90 -0
  44. package/dist/agent/executor/approval.js.map +1 -0
  45. package/dist/agent/executor/atomic-write.d.ts +9 -0
  46. package/dist/agent/executor/atomic-write.js +89 -0
  47. package/dist/agent/executor/atomic-write.js.map +1 -0
  48. package/dist/agent/executor/executor-client.d.ts +39 -0
  49. package/dist/agent/executor/executor-client.js +197 -0
  50. package/dist/agent/executor/executor-client.js.map +1 -0
  51. package/dist/agent/executor/executor.types.d.ts +97 -0
  52. package/dist/agent/executor/executor.types.js +10 -0
  53. package/dist/agent/executor/executor.types.js.map +1 -0
  54. package/dist/agent/executor/ops/file-ops.d.ts +8 -0
  55. package/dist/agent/executor/ops/file-ops.js +290 -0
  56. package/dist/agent/executor/ops/file-ops.js.map +1 -0
  57. package/dist/agent/executor/ops/run-command.d.ts +2 -0
  58. package/dist/agent/executor/ops/run-command.js +67 -0
  59. package/dist/agent/executor/ops/run-command.js.map +1 -0
  60. package/dist/agent/executor/roots.d.ts +9 -0
  61. package/dist/agent/executor/roots.js +140 -0
  62. package/dist/agent/executor/roots.js.map +1 -0
  63. package/dist/agent/executor/safe-path.d.ts +3 -0
  64. package/dist/agent/executor/safe-path.js +102 -0
  65. package/dist/agent/executor/safe-path.js.map +1 -0
  66. package/dist/agent/gates/gate-prompter.d.ts +21 -0
  67. package/dist/agent/gates/gate-prompter.js +189 -0
  68. package/dist/agent/gates/gate-prompter.js.map +1 -0
  69. package/dist/agent/prompt/cancellable.d.ts +5 -0
  70. package/dist/agent/prompt/cancellable.js +49 -0
  71. package/dist/agent/prompt/cancellable.js.map +1 -0
  72. package/dist/agent/prompt/mode-prompt.d.ts +14 -0
  73. package/dist/agent/prompt/mode-prompt.js +61 -0
  74. package/dist/agent/prompt/mode-prompt.js.map +1 -0
  75. package/dist/agent/render/diff-renderer.d.ts +14 -0
  76. package/dist/agent/render/diff-renderer.js +57 -0
  77. package/dist/agent/render/diff-renderer.js.map +1 -0
  78. package/dist/agent/render/event-renderer.d.ts +35 -0
  79. package/dist/agent/render/event-renderer.js +226 -0
  80. package/dist/agent/render/event-renderer.js.map +1 -0
  81. package/dist/agent/render/live-console.d.ts +17 -0
  82. package/dist/agent/render/live-console.js +84 -0
  83. package/dist/agent/render/live-console.js.map +1 -0
  84. package/dist/agent/render/plan-renderer.d.ts +2 -0
  85. package/dist/agent/render/plan-renderer.js +51 -0
  86. package/dist/agent/render/plan-renderer.js.map +1 -0
  87. package/dist/agent/render/run-summary.d.ts +13 -0
  88. package/dist/agent/render/run-summary.js +103 -0
  89. package/dist/agent/render/run-summary.js.map +1 -0
  90. package/dist/agent/render/sandbox-log.grouper.d.ts +10 -0
  91. package/dist/agent/render/sandbox-log.grouper.js +76 -0
  92. package/dist/agent/render/sandbox-log.grouper.js.map +1 -0
  93. package/dist/agent/slash-commands.d.ts +11 -0
  94. package/dist/agent/slash-commands.js +43 -0
  95. package/dist/agent/slash-commands.js.map +1 -0
  96. package/dist/agent/sse/build-stream.client.d.ts +20 -0
  97. package/dist/agent/sse/build-stream.client.js +206 -0
  98. package/dist/agent/sse/build-stream.client.js.map +1 -0
  99. package/dist/agent/sse/sse-parser.d.ts +11 -0
  100. package/dist/agent/sse/sse-parser.js +55 -0
  101. package/dist/agent/sse/sse-parser.js.map +1 -0
  102. package/dist/agent/target-resolver.d.ts +35 -0
  103. package/dist/agent/target-resolver.js +223 -0
  104. package/dist/agent/target-resolver.js.map +1 -0
  105. package/dist/app.module.js +10 -0
  106. package/dist/app.module.js.map +1 -1
  107. package/dist/auth/commands/login.command.d.ts +8 -0
  108. package/dist/auth/commands/login.command.js +115 -2
  109. package/dist/auth/commands/login.command.js.map +1 -1
  110. package/dist/auth/commands/logout.command.js +5 -0
  111. package/dist/auth/commands/logout.command.js.map +1 -1
  112. package/dist/auth/commands/status.command.js +6 -0
  113. package/dist/auth/commands/status.command.js.map +1 -1
  114. package/dist/auth/commands/token/token-create.command.d.ts +4 -0
  115. package/dist/auth/commands/token/token-create.command.js +91 -26
  116. package/dist/auth/commands/token/token-create.command.js.map +1 -1
  117. package/dist/clone/clone-runner.d.ts +26 -0
  118. package/dist/clone/clone-runner.js +108 -0
  119. package/dist/clone/clone-runner.js.map +1 -0
  120. package/dist/clone/clone.command.d.ts +30 -0
  121. package/dist/clone/clone.command.js +262 -0
  122. package/dist/clone/clone.command.js.map +1 -0
  123. package/dist/cluster/commands/cluster-create.command.d.ts +4 -0
  124. package/dist/cluster/commands/cluster-create.command.js +26 -1
  125. package/dist/cluster/commands/cluster-create.command.js.map +1 -1
  126. package/dist/cluster/commands/cluster-delete.command.js +11 -11
  127. package/dist/cluster/commands/cluster-delete.command.js.map +1 -1
  128. package/dist/cluster/commands/cluster-install-local.command.d.ts +15 -0
  129. package/dist/cluster/commands/cluster-install-local.command.js +292 -22
  130. package/dist/cluster/commands/cluster-install-local.command.js.map +1 -1
  131. package/dist/cluster/commands/cluster.command.js +1 -1
  132. package/dist/cluster/commands/cluster.command.js.map +1 -1
  133. package/dist/cluster/kind-manager.d.ts +12 -1
  134. package/dist/cluster/kind-manager.js +55 -12
  135. package/dist/cluster/kind-manager.js.map +1 -1
  136. package/dist/common/api/api.service.d.ts +3 -1
  137. package/dist/common/api/api.service.js +13 -3
  138. package/dist/common/api/api.service.js.map +1 -1
  139. package/dist/common/config/cli-config.service.d.ts +30 -2
  140. package/dist/common/config/cli-config.service.js +52 -6
  141. package/dist/common/config/cli-config.service.js.map +1 -1
  142. package/dist/common/output/output.service.d.ts +1 -0
  143. package/dist/common/output/output.service.js +3 -0
  144. package/dist/common/output/output.service.js.map +1 -1
  145. package/dist/drift/drift-api.d.ts +70 -0
  146. package/dist/drift/drift-api.js +67 -0
  147. package/dist/drift/drift-api.js.map +1 -0
  148. package/dist/drift/drift.commands.d.ts +43 -0
  149. package/dist/drift/drift.commands.js +294 -0
  150. package/dist/drift/drift.commands.js.map +1 -0
  151. package/dist/drift/drift.module.d.ts +2 -0
  152. package/dist/drift/drift.module.js +20 -0
  153. package/dist/drift/drift.module.js.map +1 -0
  154. package/dist/project/commands/project-use.command.d.ts +16 -0
  155. package/dist/project/commands/project-use.command.js +65 -0
  156. package/dist/project/commands/project-use.command.js.map +1 -0
  157. package/dist/project/commands/project.command.js +9 -1
  158. package/dist/project/commands/project.command.js.map +1 -1
  159. package/dist/project/project.module.js +2 -1
  160. package/dist/project/project.module.js.map +1 -1
  161. package/dist/runbooks/runbooks.commands.d.ts +69 -0
  162. package/dist/runbooks/runbooks.commands.js +272 -0
  163. package/dist/runbooks/runbooks.commands.js.map +1 -0
  164. package/dist/runners/commands/groups.commands.d.ts +55 -0
  165. package/dist/runners/commands/groups.commands.js +260 -0
  166. package/dist/runners/commands/groups.commands.js.map +1 -0
  167. package/dist/runners/commands/install.commands.d.ts +36 -0
  168. package/dist/runners/commands/install.commands.js +192 -0
  169. package/dist/runners/commands/install.commands.js.map +1 -0
  170. package/dist/runners/commands/jobs.commands.d.ts +38 -0
  171. package/dist/runners/commands/jobs.commands.js +206 -0
  172. package/dist/runners/commands/jobs.commands.js.map +1 -0
  173. package/dist/runners/runners-api.d.ts +94 -0
  174. package/dist/runners/runners-api.js +110 -0
  175. package/dist/runners/runners-api.js.map +1 -0
  176. package/dist/runners/runners.module.d.ts +6 -0
  177. package/dist/runners/runners.module.js +58 -0
  178. package/dist/runners/runners.module.js.map +1 -0
  179. package/dist/service/commands/service-build.command.d.ts +29 -0
  180. package/dist/service/commands/service-build.command.js +148 -0
  181. package/dist/service/commands/service-build.command.js.map +1 -0
  182. package/dist/service/commands/service-stop.command.js +12 -5
  183. package/dist/service/commands/service-stop.command.js.map +1 -1
  184. package/dist/service/commands/service.command.js +5 -0
  185. package/dist/service/commands/service.command.js.map +1 -1
  186. package/dist/service/service.module.js +3 -0
  187. package/dist/service/service.module.js.map +1 -1
  188. package/dist/tsconfig.build.tsbuildinfo +1 -1
  189. package/dist/vpn/commands/vpn-connect.command.d.ts +28 -0
  190. package/dist/vpn/commands/vpn-connect.command.js +213 -0
  191. package/dist/vpn/commands/vpn-connect.command.js.map +1 -0
  192. package/dist/vpn/commands/vpn-disconnect.command.d.ts +24 -0
  193. package/dist/vpn/commands/vpn-disconnect.command.js +149 -0
  194. package/dist/vpn/commands/vpn-disconnect.command.js.map +1 -0
  195. package/dist/vpn/commands/vpn-status.command.d.ts +18 -0
  196. package/dist/vpn/commands/vpn-status.command.js +94 -0
  197. package/dist/vpn/commands/vpn-status.command.js.map +1 -0
  198. package/dist/vpn/commands/vpn.command.d.ts +4 -0
  199. package/dist/vpn/commands/vpn.command.js +30 -0
  200. package/dist/vpn/commands/vpn.command.js.map +1 -0
  201. package/dist/vpn/kubectl-manager.d.ts +31 -0
  202. package/dist/vpn/kubectl-manager.js +276 -0
  203. package/dist/vpn/kubectl-manager.js.map +1 -0
  204. package/dist/vpn/vpn-api.d.ts +45 -0
  205. package/dist/vpn/vpn-api.js +51 -0
  206. package/dist/vpn/vpn-api.js.map +1 -0
  207. package/dist/vpn/vpn-connect.flow.d.ts +41 -0
  208. package/dist/vpn/vpn-connect.flow.js +172 -0
  209. package/dist/vpn/vpn-connect.flow.js.map +1 -0
  210. package/dist/vpn/vpn.module.d.ts +2 -0
  211. package/dist/vpn/vpn.module.js +23 -0
  212. package/dist/vpn/vpn.module.js.map +1 -0
  213. package/dist/vpn/wireguard-keys.d.ts +5 -0
  214. package/dist/vpn/wireguard-keys.js +12 -0
  215. package/dist/vpn/wireguard-keys.js.map +1 -0
  216. package/package.json +10 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,125 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@secretstartups/workshop` are recorded here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ Each release's section becomes the notes on its GitHub release, so write entries for people
8
+ who use the CLI, not for people reading the diff.
9
+
10
+ ## [Unreleased]
11
+
12
+ ## [0.3.0] - 2026-11-10
13
+
14
+ ### Added
15
+
16
+ - **Signed in inside workspace editors.** The editor's terminal has the CLI installed and signed
17
+ in to its workspace, so `workshop agent --local` works with no login or flags. The CLI reads
18
+ the token from `WORKSHOP_TOKEN_FILE` on every call, so a long session keeps working while the
19
+ editor renews it. `workshop auth status` says when the editor signed you in.
20
+ - **`workshop runners`**: runner groups, installing a runner and jobs.
21
+ - `runners groups list | create | delete | set-default | update`. `update` takes `--hosted` or
22
+ `--no-hosted`, `--name` and `--max-concurrency`.
23
+ - `runners install` creates a single-use token and runs Helm against your current kubectl
24
+ context, at the chart version Workshop pins (`--print` shows the command instead).
25
+ - `runners jobs list | run | logs | cancel`. `jobs run --follow` and `jobs logs` stream the log
26
+ and exit 0 or 1 with the job's result.
27
+ - **`workshop drift`**: drift detection and plan review for clusters and VMs, with each plan's
28
+ estimated monthly cost.
29
+ - **`workshop runbooks`**: `list`, `run`, `runs`, `approve` and `reject`. `run --follow` streams
30
+ the log and exits 0 or 1 with the result; required secret inputs you don't pass are prompted
31
+ for, so they stay out of shell history.
32
+ - **`workshop service build <id>`** queues a build on the service's runner group (`--ref`,
33
+ `--follow`), and `workshop service builds <id>` lists recent builds.
34
+
35
+ ### Changed
36
+
37
+ - **Breaking:** `workshop runners pools` is now `workshop runners groups`, and `--pool` is now
38
+ `--group`.
39
+ - `cluster create --group` is optional and defaults to the organization's default group.
40
+ `--review-plan` no longer needs a group.
41
+ - `workshop auth logout` inside a workspace editor says that the editor's sign-in stays until
42
+ the editor stops.
43
+
44
+ ## [0.2.0] - 2026-09-30
45
+
46
+ ### Added
47
+
48
+ - **`workshop agent`**: an interactive agent session against a workspace or a single service.
49
+ - Plan, auto and discuss modes. Switch with `--mode`, `/mode` or shift+tab.
50
+ - Sessions are kept and can be resumed with `--resume`, `/resume` or `/sessions`. On exit,
51
+ the CLI prints a recap of the session.
52
+ - Slash commands: `/target`, `/diff`, `/files`, `/pr`, `/merge [--all]`, `/model`, `/new`,
53
+ `/status`, `/editor`, `/clear` and `/help`.
54
+ - `--print <prompt>` runs a single turn without the interactive session.
55
+ - `workshop agent sessions` lists recent sessions, and `workshop agent models` lists the models
56
+ the agent can use.
57
+ - **Local mode (`workshop agent --local`)**: the agent edits files and runs commands on your
58
+ machine, so each turn leaves the change in your working tree instead of opening a pull request.
59
+ - Every command needs your approval unless it is on the allowlist. Manage the allowlist with
60
+ `--allow <command>`, `/allow` and `/allowed`.
61
+ - `/roots` shows which working trees the agent can change, and `--root` sets them.
62
+ - The agent cannot write outside the declared roots, write through symlinks or write inside
63
+ `.git`.
64
+ - Local mode works with a single service as well as a whole workspace.
65
+ - **`workshop clone [destination]`**: clones every repository in a workspace into the layout
66
+ that `agent --local` expects. You can run it again at any time: it fetches only the
67
+ repositories you don't have yet and leaves existing checkouts untouched.
68
+ - **`workshop vpn`**: `connect`, `disconnect` and `status` for reaching private and on-prem
69
+ clusters over WireGuard.
70
+ - **`workshop cluster install-local`**: creates a local kind cluster and connects it over the
71
+ VPN. Use `--node-image` to override the pinned Kubernetes version and `--skip-ingress-ports`
72
+ to skip the port 80/443 mapping.
73
+ - **`workshop auth token create | list | revoke`**: manage API tokens. You choose scopes
74
+ interactively or with `--scopes`.
75
+ - `workshop auth login --token` signs in with an API token instead of email and password.
76
+ - `workshop project use` remembers your active project for later commands.
77
+
78
+ ### Changed
79
+
80
+ - `workshop service stop` now pauses the service (scales it to zero and keeps its config and
81
+ URL) instead of undeploying it.
82
+ - Repository slugs now come from the server instead of being derived by the CLI, which fixes
83
+ cases where two services with similar names were mapped to the same checkout.
84
+
85
+ ### Fixed
86
+
87
+ - `cluster install-local` now pins Kubernetes to v1.32.2. Newer kind defaults break ArgoCD DNS.
88
+ - `cluster install-local` now loads locally built connector images into kind.
89
+ - `cluster install-local` now queues add-ons when the tunnel is already up, so they are
90
+ installed.
91
+ - `cluster install-local` no longer registers the same cluster twice.
92
+ - `cluster install-local` now fails early when ports 80/443 are already taken.
93
+ - `vpn connect` now reports when the connector pod has no WireGuard handshake.
94
+
95
+ ## [0.1.3] - 2026-07-16
96
+
97
+ ### Added
98
+
99
+ - `-v` works as an alias for `--version`.
100
+
101
+ ## [0.1.2] - 2026-07-16
102
+
103
+ ### Added
104
+
105
+ - `--version` flag.
106
+ - Update notifications when a newer version is published to npm.
107
+
108
+ ## [0.1.1] - 2026-07-16
109
+
110
+ ### Changed
111
+
112
+ - Release housekeeping.
113
+
114
+ ## [0.1.0] - 2026-06-23
115
+
116
+ ### Added
117
+
118
+ - First public release on npm.
119
+
120
+ [Unreleased]: https://github.com/secretstartups/workshop-cli/compare/v0.2.0...HEAD
121
+ [0.2.0]: https://github.com/secretstartups/workshop-cli/compare/v0.1.3...v0.2.0
122
+ [0.1.3]: https://github.com/secretstartups/workshop-cli/compare/v0.1.2...v0.1.3
123
+ [0.1.2]: https://github.com/secretstartups/workshop-cli/compare/v0.1.1...v0.1.2
124
+ [0.1.1]: https://github.com/secretstartups/workshop-cli/compare/v0.1.0...v0.1.1
125
+ [0.1.0]: https://github.com/secretstartups/workshop-cli/releases/tag/v0.1.0
package/README.md CHANGED
@@ -69,14 +69,160 @@ workshop service list --env <envId>
69
69
 
70
70
  ```bash
71
71
  workshop auth login # Log in with email and password
72
+ workshop auth login --token # Log in by pasting an access token (prompts; stays out of shell history)
72
73
  workshop auth logout # Clear stored credentials
73
74
  workshop auth status # Show the currently authenticated user
74
75
 
75
76
  workshop auth token list # List your API tokens
76
- workshop auth token create # Create a new API token (interactive scope selection)
77
+ workshop auth token create # Create a new API token (pick areas, then drill down if you want)
78
+ workshop auth token create --scopes ai --expires 30 # Non-interactive; 'ai' expands to the whole group
77
79
  workshop auth token revoke <id> # Revoke an API token
78
80
  ```
79
81
 
82
+ ### Agent
83
+
84
+ An interactive session with the Workshop AI agent, in your terminal. It streams
85
+ the same builds the web UI shows, prompts for the same clarifications and plan
86
+ approvals, and opens the same pull requests.
87
+
88
+ ```bash
89
+ workshop agent # Open the REPL on the remembered target
90
+ workshop agent -w <workspaceId> # ...on a workspace (multi-repo)
91
+ workshop agent -s <serviceId> # ...on a single service
92
+ workshop agent --resume # Continue the most recent session
93
+ workshop agent --print "add /health" # One prompt, no REPL (add --yes to auto-approve)
94
+
95
+ workshop agent sessions # Recent sessions for the current target
96
+ workshop agent resume <buildId> # Show a session's turns
97
+ workshop agent diff <buildId> # Show what a build changed
98
+ workshop agent files <buildId> # List files on the build's branch
99
+ workshop agent merge <buildId> --all # Merge the pull requests it opened
100
+ workshop agent models # Models available to the agent
101
+ workshop agent rm <sessionId> # Delete a session
102
+ ```
103
+
104
+ ### Local mode
105
+
106
+ By default the agent edits a copy of your code and opens a pull request. With
107
+ `--local` it works on the checkout you actually have:
108
+
109
+ ```bash
110
+ workshop agent --local # find the repos automatically
111
+ workshop agent --local --root api=~/code/api --root web=~/code/web
112
+ workshop agent -s <serviceId> --local --root ~/code/api # one service, one path
113
+ ```
114
+
115
+ It looks for each repository in three places, in order: a `--root` you stated,
116
+ `$HOME/<slug>` (where the browser editor checks repos out), then `<cwd>/<slug>`
117
+ or a directory beside this one whose git remote matches. Directories are matched
118
+ by their remote, never by their name, so a renamed checkout is still found and a
119
+ coincidentally-named one is not used. `workshop clone` writes exactly the layout
120
+ this expects.
121
+
122
+ The agent then reads and writes those working trees and runs commands there, and
123
+ **stops** — nothing is committed and no pull request is opened. Review what it
124
+ did with `git diff` and commit it yourself.
125
+
126
+ Every command it proposes asks first:
127
+
128
+ ```
129
+ ⚙ npm test
130
+ in ~/code/api
131
+ ? Run this?
132
+ ❯ Yes, once
133
+ Yes, and always allow `npm test`
134
+ Yes, and always allow `npm test …`
135
+ No
136
+ No — and tell it why
137
+ ```
138
+
139
+ `/allow <command>` pre-approves one for good, `/allowed` lists what may run
140
+ without asking, and `/roots` shows which trees the agent can reach. Rules match
141
+ an exact command or a first-token prefix and nothing else — `npm test` will
142
+ never quietly authorise `npm test && rm -rf ~`.
143
+
144
+ File edits are not prompted; that is the point of the mode. They are written
145
+ atomically, keep the file's existing mode, and can never land outside a declared
146
+ root or inside `.git`.
147
+
148
+ Non-interactively (`--print`, a pipe, CI) commands are **refused by default**
149
+ with a reason the agent can read, while file edits still proceed. Pre-approve
150
+ specific ones with `--allow`, or use `--dangerously-allow-all` if you genuinely
151
+ want a CI job running whatever the model writes.
152
+
153
+ Local mode needs a terminal attached for the whole turn:
154
+ if it disconnects the agent waits a couple of minutes for you to come back and
155
+ then fails the turn rather than leaving your tree half-edited.
156
+
157
+ The agent needs these scopes on its token: `ai.view`, `ai.execute` (start and
158
+ continue builds, merge their PRs), `ai.update` (approve, revise or answer a
159
+ plan), `workspaces.view`, and `projects.view` + `services.view` for the
160
+ interactive pickers. Add `ai.delete` if you want `workshop agent rm`.
161
+
162
+ The prompt shows the mode it will submit under, and **shift+tab** cycles it in
163
+ place — `plan` (plans first, asks before changing anything) → `auto` (makes the
164
+ change and opens a PR) → `discuss` (answers questions, never edits):
165
+
166
+ ```
167
+ [plan] › add a health endpoint to the API
168
+ plans first, asks before changing anything · shift+tab to change
169
+ ```
170
+
171
+ **Esc** backs out of any picker and returns you to the prompt, with nothing
172
+ changed.
173
+
174
+ `/help` lists the slash commands. `/sessions` and `/resume` both open a
175
+ scrollable list of past sessions to continue, `/target` switches to another
176
+ workspace or service, `/mode` and `/model` open pickers when given no argument,
177
+ and Ctrl+C detaches without stopping the build — it runs server-side, so
178
+ `workshop agent --resume` picks it back up.
179
+
180
+ The target is remembered between runs, so `workshop agent` on its own reopens
181
+ whatever you last worked on; `/target` (or `-w` / `-s`) moves somewhere else.
182
+
183
+ A workspace target needs to know its project, so run `workshop project use <id>`
184
+ once (or pass `--project`).
185
+
186
+ **Running it inside a workspace editor.** The editor comes with the CLI installed
187
+ and already signed in, as you, to that workspace. Open its terminal and run:
188
+
189
+ ```bash
190
+ workshop agent --local # edits the files open in the editor; review with git diff
191
+ ```
192
+
193
+ The editor's sign-in (`WORKSHOP_TOKEN_FILE`, renewed while the editor runs) can use
194
+ Workshop AI on that workspace, read, and deploy, restart, scale or roll back the
195
+ project's services. It can't touch secrets, infrastructure or settings, and it ends
196
+ when the editor stops. For anything beyond that, set `WORKSHOP_TOKEN` to a personal
197
+ API token: the CLI uses `WORKSHOP_TOKEN` first, then the editor's file, then a
198
+ stored login.
199
+
200
+ Editors that aren't signed in (an API on a private address, or an older editor
201
+ image) work as before: set `WORKSHOP_API_URL` and run `workshop auth login --token`.
202
+
203
+ ### Clone
204
+
205
+ Put a workspace's repositories on this machine, laid out the way `--local`
206
+ expects:
207
+
208
+ ```bash
209
+ workshop clone # every repo of the remembered workspace, here
210
+ workshop clone ~/code # ...into a directory you name
211
+ workshop clone --service <serviceId> # just one service
212
+ workshop clone --branch next # override the branch each service pins
213
+ ```
214
+
215
+ It behaves like `git clone`: one directory per repository in the directory you
216
+ are standing in, named by the slug the platform addresses that repository by —
217
+ which is what lets `workshop agent --local` find them afterwards with no flags.
218
+
219
+ Repositories already present are left alone, so running it again after a service
220
+ joins the workspace fetches only the new one. If a repository fails the rest
221
+ still land, and the exact `git clone` to retry is printed.
222
+
223
+ It uses your own git credentials — the CLI holds no GitHub token and the
224
+ platform does not issue one for this.
225
+
80
226
  ### Organizations
81
227
 
82
228
  ```bash
@@ -97,6 +243,7 @@ workshop org members remove <id> # Remove a member
97
243
  workshop project list # List projects in the active org
98
244
  workshop project create # Create a project
99
245
  workshop project get <projectId> # Get project details
246
+ workshop project use <projectId> # Set the active project (remembered for later commands)
100
247
  workshop project delete <projectId> # Delete a project
101
248
  ```
102
249
 
@@ -129,12 +276,96 @@ workshop service stop <serviceId> # Stop (undeploy) a service
129
276
  ```bash
130
277
  workshop cluster list # List Kubernetes clusters
131
278
  workshop cluster create # Create a cluster (interactive wizard)
279
+ workshop cluster install-local # Create a local kind cluster and connect it
132
280
  workshop cluster get <clusterId> # Get cluster details
133
281
  workshop cluster delete <clusterId> # Delete a cluster
134
282
  workshop cluster nodes <clusterId> # List cluster nodes
135
283
  workshop cluster workloads <clusterId> # List cluster workloads
136
284
  ```
137
285
 
286
+ #### Local clusters
287
+
288
+ `install-local` installs kind if needed, creates a cluster, and attaches it to
289
+ Workshop in one step.
290
+
291
+ How it connects depends on whether Workshop can reach the cluster:
292
+
293
+ | Your Workshop API | What happens |
294
+ |---|---|
295
+ | `localhost` | Connects directly over loopback. Nothing else needed. |
296
+ | anywhere else | Connects over the VPN — the cluster dials out to Workshop, so no inbound ports are opened. |
297
+
298
+ If Workshop is remote and its VPN gateway is not configured, the command stops
299
+ before creating anything and tells you which settings are missing. It will not
300
+ silently fall back to registering by certificate, which would store a client key
301
+ server-side and disable TLS verification.
302
+
303
+ ```bash
304
+ workshop cluster install-local --name dev # auto-detect
305
+ workshop cluster install-local --vpn # force the VPN
306
+ workshop cluster install-local --direct # register by certificate (less secure)
307
+ workshop cluster install-local --skip-bootstrap # skip add-on installation
308
+ ```
309
+
310
+ If any step fails, the kind cluster this command created is removed again — you
311
+ are not left with an orphan to clean up by hand.
312
+
313
+ ### VPN (private clusters)
314
+
315
+ Lets Workshop manage a cluster it cannot reach directly — on a laptop, or behind
316
+ a firewall — over an outbound-only WireGuard tunnel. `install-local` uses this
317
+ automatically; these commands are for clusters that already exist.
318
+
319
+ ```bash
320
+ workshop vpn connect --context <ctx> # Install the connector and attach the cluster
321
+ workshop vpn status # Connection status, handshakes and traffic
322
+ workshop vpn disconnect # Revoke access and remove the connector
323
+ ```
324
+
325
+ The WireGuard private key is generated on your machine and never sent to
326
+ Workshop; only the public half leaves the host.
327
+
328
+ ### Runners
329
+
330
+ Runners run Workshop jobs (OpenTofu for clusters and VMs, image builds, deploys, scripts): one pod
331
+ per job, connecting out to Workshop only. Every organization has a **Default** group that runs on
332
+ Workshop-hosted runners, so nothing needs installing to get started. Install runners of your own to
333
+ reach private networks or use your own capacity.
334
+
335
+ ```bash
336
+ workshop runners groups list # Groups; which is the default, which use hosted runners
337
+ workshop runners groups create prod-eu # Create a group
338
+ workshop runners groups set-default <groupId> # Run work here when no group is chosen
339
+ workshop runners groups update <groupId> --no-hosted # Only your own runners take this group's jobs
340
+ workshop runners install <groupId> # helm install a runner into the current kubectl context
341
+ workshop runners install <groupId> --print # …or just print the helm command
342
+ workshop runners token create <groupId> # A registration token for installing by hand
343
+ workshop runners list <groupId> # Runners and their status
344
+ workshop runners jobs run <groupId> --image alpine --run 'echo hi' --follow
345
+ workshop runners jobs list <groupId> --status running
346
+ workshop runners jobs logs <groupId> <jobId> # Stream a log until the job ends
347
+ workshop runners jobs cancel <groupId> <jobId>
348
+ ```
349
+
350
+ `jobs run --follow` and `jobs logs` exit 0 if the job succeeded and 1 otherwise. The job's
351
+ stdout goes to stdout and everything else to stderr, so they work as CI steps and in pipes.
352
+
353
+ ### Drift & plan review
354
+
355
+ For clusters and VMs on a runner group. Pass `--vm` when the id is a VM.
356
+
357
+ ```bash
358
+ workshop drift show <id> # Drift status and the latest plan
359
+ workshop drift check <id> --wait # Plan now; exit 0 in sync, 2 drifted, 1 failed (CI-friendly)
360
+ workshop drift apply <id> # Apply the latest plan after confirming (reverts drift)
361
+
362
+ # Review the plan before anything is built
363
+ workshop cluster create --group <groupId> --review-plan
364
+ workshop drift show <id> --wait # The creation plan
365
+ workshop drift apply <id> # Approve: builds exactly that plan
366
+ workshop cluster delete <id> # …or discard it (nothing was built)
367
+ ```
368
+
138
369
  ### Virtual Machines
139
370
 
140
371
  ```bash
@@ -187,10 +418,23 @@ The CLI stores its config at `~/.workshop/config.json`:
187
418
  "apiUrl": "http://localhost:3000/api/v1",
188
419
  "token": "eyJ...",
189
420
  "currentOrgId": "uuid",
190
- "currentOrgName": "My Org"
421
+ "currentOrgName": "My Org",
422
+ "currentProjectId": "uuid",
423
+ "agentTarget": { "kind": "workspace", "id": "uuid", "label": "Checkout", "projectId": "uuid" }
191
424
  }
192
425
  ```
193
426
 
427
+ Environment variables override the stored file, so no interactive setup is
428
+ needed in CI or inside a workspace pod:
429
+
430
+ | Variable | Overrides |
431
+ |---|---|
432
+ | `WORKSHOP_API_URL` | `apiUrl` |
433
+ | `WORKSHOP_TOKEN` | `token` |
434
+ | `WORKSHOP_ORG_ID` | `currentOrgId` |
435
+ | `WORKSHOP_PROJECT_ID` | `currentProjectId` |
436
+ | `WORKSHOP_WORKSPACE_ID` / `WORKSHOP_SERVICE_ID` | the agent's target |
437
+
194
438
  You can also authenticate using a long-lived API token (useful for CI/CD):
195
439
 
196
440
  ```bash
@@ -0,0 +1,60 @@
1
+ import { AgentTarget } from '../common/config/cli-config.service';
2
+ import { BuildApiService, BuildMode, BuildResponse } from './build-api.service';
3
+ import { GateOptions, GatePrompter } from './gates/gate-prompter';
4
+ import { LiveConsole } from './render/live-console';
5
+ import { BuildStreamClient } from './sse/build-stream.client';
6
+ import { ExecutorClient } from './executor/executor-client';
7
+ import { ExecutorDeclaration } from './executor/executor.types';
8
+ import { CommandAllowlist } from './executor/allowlist';
9
+ export interface TurnRecord {
10
+ prompt: string;
11
+ buildId: string;
12
+ status: string;
13
+ summary?: string;
14
+ prUrls: string[];
15
+ kind?: string;
16
+ }
17
+ export interface ExecutorRuntimeContext {
18
+ client: ExecutorClient;
19
+ declaration: ExecutorDeclaration;
20
+ allowlist: CommandAllowlist;
21
+ }
22
+ export declare function prUrlsOf(build: BuildResponse): string[];
23
+ export declare function settledPrUrlsOf(build: BuildResponse): string[];
24
+ export interface SessionOptions {
25
+ mode: BuildMode;
26
+ executor?: ExecutorRuntimeContext;
27
+ modelId?: string;
28
+ verbosity: number;
29
+ gates: GateOptions;
30
+ }
31
+ export declare class AgentSession {
32
+ private _target;
33
+ private readonly api;
34
+ private readonly stream;
35
+ private readonly gates;
36
+ private readonly console;
37
+ private readonly opts;
38
+ sessionId?: string;
39
+ lastBuildId?: string;
40
+ readonly turns: TurnRecord[];
41
+ readonly settledPrs: Set<string>;
42
+ constructor(_target: AgentTarget, api: BuildApiService, stream: BuildStreamClient, gates: GatePrompter, console: LiveConsole, opts: SessionOptions);
43
+ get target(): AgentTarget;
44
+ setTarget(target: AgentTarget): void;
45
+ get mode(): BuildMode;
46
+ get modelId(): string | undefined;
47
+ setMode(mode: BuildMode): void;
48
+ setModel(modelId: string): void;
49
+ get executorContext(): ExecutorRuntimeContext | undefined;
50
+ detachExecutor(reason: string): Promise<void>;
51
+ reset(): void;
52
+ attach(buildId: string): Promise<TurnRecord[]>;
53
+ markPrsSettled(urls: string[]): void;
54
+ openPrUrls(): string[];
55
+ lastTurnWithPrs(): TurnRecord | undefined;
56
+ runTurn(prompt: string, signal?: AbortSignal): Promise<TurnRecord | null>;
57
+ private maybeGate;
58
+ private finishTurn;
59
+ private printSummary;
60
+ }