@secretstartups/workshop
v0.8.0
Published
Workshop platform CLI
Readme
workshop-cli
Command-line interface for the Workshop platform. Manage organizations, projects, services, deployments, infrastructure, secrets, and observability from your terminal.
Installation
From npm (recommended)
@secretstartups/workshop is published to the public npm registry — no setup required:
npm install -g @secretstartups/workshop
# workshop <command> now works from anywhereUpdating
Global installs are pinned and do not auto-update. Check your version and update to the latest release:
workshop --version # also -v / -V
npm install -g @secretstartups/workshop@latest # update to the newest releaseFrom 0.1.2 onward the CLI nudges you (once a day) when a newer version is available, so you only need to run the update command when prompted.
From source (for contributors)
cd workshop-cli
npm install
npm run buildLink the binary globally (optional):
npm link
# workshop <command> now works from anywhereOr run directly from the project directory:
./dist/main.js <command>Quick Start
# 1. Point at your API (defaults to http://localhost:3000/api/v1)
workshop config set-url https://api.yourworkshop.com
# 2. Log in
workshop auth login
# 3. List and select your active organization
workshop org list
workshop org use <orgId>
# 4. Start managing resources
workshop project list
workshop service list --env <envId>Commands
Auth
workshop auth login # Log in with email and password
workshop auth login --token # Log in by pasting an access token (prompts; stays out of shell history)
workshop auth logout # Clear stored credentials
workshop auth status # Show the currently authenticated user
workshop auth token list # List your API tokens
workshop auth token create # Create a new API token (pick areas, then drill down if you want)
workshop auth token create --scopes ai --expires 30 # Non-interactive; 'ai' expands to the whole group
workshop auth token revoke <id> # Revoke an API tokenAgent
An interactive session with the Workshop AI agent, in your terminal. It streams the same builds the web UI shows, prompts for the same clarifications and plan approvals, and opens the same pull requests.
workshop agent # Open the REPL on the remembered target
workshop agent -w <workspaceId> # ...on a workspace (multi-repo)
workshop agent -s <serviceId> # ...on a single service
workshop agent --resume # Continue the most recent session
workshop agent --print "add /health" # One prompt, no REPL (add --yes to auto-approve)
workshop agent sessions # Recent sessions for the current target
workshop agent resume <buildId> # Show a session's turns
workshop agent diff <buildId> # Show what a build changed
workshop agent files <buildId> # List files on the build's branch
workshop agent merge <buildId> --all # Merge the pull requests it opened
workshop agent models # Models available to the agent
workshop agent rm <sessionId> # Delete a sessionLocal mode
By default the agent edits a copy of your code and opens a pull request. With
--local it works on the checkout you actually have:
workshop agent --local # find the repos automatically
workshop agent --local --root api=~/code/api --root web=~/code/web
workshop agent -s <serviceId> --local --root ~/code/api # one service, one pathIt looks for each repository in three places, in order: a --root you stated,
$HOME/<slug> (where the browser editor checks repos out), then <cwd>/<slug>
or a directory beside this one whose git remote matches. Directories are matched
by their remote, never by their name, so a renamed checkout is still found and a
coincidentally-named one is not used. workshop clone writes exactly the layout
this expects.
The agent then reads and writes those working trees and runs commands there, and
stops — nothing is committed and no pull request is opened. Review what it
did with git diff and commit it yourself.
Every command it proposes asks first:
⚙ npm test
in ~/code/api
? Run this?
❯ Yes, once
Yes, and always allow `npm test`
Yes, and always allow `npm test …`
No
No — and tell it why/allow <command> pre-approves one for good, /allowed lists what may run
without asking, and /roots shows which trees the agent can reach. Rules match
an exact command or a first-token prefix and nothing else — npm test will
never quietly authorise npm test && rm -rf ~.
File edits are not prompted; that is the point of the mode. They are written
atomically, keep the file's existing mode, and can never land outside a declared
root or inside .git.
Non-interactively (--print, a pipe, CI) commands are refused by default
with a reason the agent can read, while file edits still proceed. Pre-approve
specific ones with --allow, or use --dangerously-allow-all if you genuinely
want a CI job running whatever the model writes.
Local mode needs a terminal attached for the whole turn: if it disconnects the agent waits a couple of minutes for you to come back and then fails the turn rather than leaving your tree half-edited.
The agent needs these scopes on its token: ai.view, ai.execute (start and
continue builds, merge their PRs), ai.update (approve, revise or answer a
plan), workspaces.view, and projects.view + services.view for the
interactive pickers. Add ai.delete if you want workshop agent rm.
The prompt shows the mode it will submit under, and shift+tab cycles it in
place — plan (plans first, asks before changing anything) → auto (makes the
change and opens a PR) → discuss (answers questions, never edits):
[plan] › add a health endpoint to the API
plans first, asks before changing anything · shift+tab to changeEsc backs out of any picker and returns you to the prompt, with nothing changed.
/help lists the slash commands. /sessions and /resume both open a
scrollable list of past sessions to continue, /target switches to another
workspace or service, /mode and /model open pickers when given no argument,
and Ctrl+C detaches without stopping the build — it runs server-side, so
workshop agent --resume picks it back up.
The target is remembered between runs, so workshop agent on its own reopens
whatever you last worked on; /target (or -w / -s) moves somewhere else.
A workspace target needs to know its project, so run workshop project use <id>
once (or pass --project).
Running it inside a workspace editor. The editor comes with the CLI installed and already signed in, as you, to that workspace. Open its terminal and run:
workshop agent --local # edits the files open in the editor; review with git diffThe editor's sign-in (WORKSHOP_TOKEN_FILE, renewed while the editor runs) can use
Workshop AI on that workspace, read, and deploy, restart, scale or roll back the
project's services. It can't touch secrets, infrastructure or settings, and it ends
when the editor stops. For anything beyond that, set WORKSHOP_TOKEN to a personal
API token: the CLI uses WORKSHOP_TOKEN first, then the editor's file, then a
stored login.
Editors that aren't signed in (an API on a private address, or an older editor
image) work as before: set WORKSHOP_API_URL and run workshop auth login --token.
Clone
Put a workspace's repositories on this machine, laid out the way --local
expects:
workshop clone # every repo of the remembered workspace, here
workshop clone ~/code # ...into a directory you name
workshop clone --service <serviceId> # just one service
workshop clone --branch next # override the branch each service pinsIt behaves like git clone: one directory per repository in the directory you
are standing in, named by the slug the platform addresses that repository by —
which is what lets workshop agent --local find them afterwards with no flags.
Repositories already present are left alone, so running it again after a service
joins the workspace fetches only the new one. If a repository fails the rest
still land, and the exact git clone to retry is printed.
It uses your own git credentials — the CLI holds no GitHub token and the platform does not issue one for this.
Organizations
workshop org list # List your organizations
workshop org create # Create an organization
workshop org get [orgId] # Get organization details (uses active org if omitted)
workshop org delete <orgId> # Delete an organization
workshop org use <orgId> # Set the active organization
workshop org members list # List members
workshop org members invite # Invite a member
workshop org members remove <id> # Remove a memberProjects
workshop project list # List projects in the active org
workshop project create # Create a project
workshop project get <projectId> # Get project details
workshop project use <projectId> # Set the active project (remembered for later commands)
workshop project delete <projectId> # Delete a projectEnvironments
workshop env list --project <id> # List environments for a project
workshop env create # Create an environment
workshop env delete <envId> # Delete an environmentServices
workshop service list --env <id> # List services in an environment
workshop service create # Create a service
workshop service get <serviceId> # Get service details
workshop service delete <serviceId> # Delete a service
workshop service deploy <serviceId> # Deploy a service to Kubernetes
workshop service status <serviceId> # Get deployment status
workshop service logs <serviceId> # Get pod logs
workshop service restart <serviceId> # Restart a service
workshop service rollback <serviceId> # Rollback to the previous deployment
workshop service stop <serviceId> # Stop (undeploy) a servicePreviews
Put a branch at an address of its own to try it before merging. It builds on Workshop's runners, runs with throwaway data, and only members of the organization can open it. Coding agents can drive it with --json.
workshop preview up # Preview the current branch (it must be pushed)
workshop preview up --snapshot --wait # Include uncommitted work, wait until it's up
workshop preview up -b feat/x -s <serviceId> --open
workshop preview ls [--mine] [--here] # Live previews (--here: this branch's)
workshop preview status <previewId> [--wait]
workshop preview logs <previewId> # Why a service failed: build and run logs
workshop preview extend <previewId> --hours 24
workshop preview share <previewId> # A link for someone outside the organization (24h)
workshop preview down <previewId> # Delete it (and its --snapshot branch)By default it previews every service built from git remote get-url origin. The branch gets a workspace of its own on the project's preview environment, deleted with its last preview; --workspace previews in one of yours instead. A change across repositories whose branches are named differently adds the others with --also <repository>=<branch> (repeatable); the preview warns about any service asked for whose repository lacks its branch. --snapshot pushes your working tree to workshop-preview/cli-<hash>; your branch, index and HEAD stay untouched.
Sandboxes (ephemeral environments)
A short-lived copy of a project's services, with no pull request or branch behind it: each service at its base image, a branch, a commit or an image tag, with throwaway databases and addresses of its own. Start from scratch, clone what an environment runs, or use a saved template. Services are named or given by id; --project defaults to workshop project use.
workshop sandbox up demo -s api=feat/checkout -s web=image:v1.4.2 --wait
workshop sandbox up staging-copy --from-env staging -s api=commit:main@abc1234
workshop sandbox up demo2 --template "checkout demo" --ttl 72
workshop sandbox up try-it --base dev --dry-run # what it would run (its own image, copied or built) and what would stop it; makes nothing
workshop sandbox up as-dev --base dev --images base # copy what dev runs instead of each service's latest image
workshop sandbox ls [--mine]
workshop sandbox set <sandboxId> -s api=held:main --remove worker
workshop sandbox var <sandboxId> api FEATURE_X=on # its own value (FEATURE_X= removes it); never a credential
workshop sandbox pin <sandboxId> # keep it alive (no expiry); unpin to let it go
workshop sandbox save <sandboxId> "checkout demo" # save it as a template
workshop sandbox templates
workshop sandbox down <sandboxId>
workshop sandbox deploy staging -s api=v2.3.0 -s web # several services to an environment, each after what it requiresA source is base, <branch> (or branch:<branch>, rebuilt on pushes), held:<branch> (built once, not rebuilt), commit:<branch>@<sha> or image:<tag>. Once up, a sandbox is a preview: workshop preview status|logs|extend|share <id> work on it. sandbox deploy takes images only (a production environment needs --confirm <its name>); unmerged branches go to sandboxes.
Clusters
workshop cluster list # List Kubernetes clusters
workshop cluster create # Create a cluster (interactive wizard)
workshop cluster install-local # Create a local kind cluster and connect it
workshop cluster get <clusterId> # Get cluster details
workshop cluster delete <clusterId> # Delete a cluster
workshop cluster nodes <clusterId> # List cluster nodes
workshop cluster workloads <clusterId> # List cluster workloadsLocal clusters
install-local installs kind if needed, creates a cluster, and attaches it to
Workshop in one step.
How it connects depends on whether Workshop can reach the cluster:
| Your Workshop API | What happens |
|---|---|
| localhost | Connects directly over loopback. Nothing else needed. |
| anywhere else | Connects over the VPN — the cluster dials out to Workshop, so no inbound ports are opened. |
If Workshop is remote and its VPN gateway is not configured, the command stops before creating anything and tells you which settings are missing. It will not silently fall back to registering by certificate, which would store a client key server-side and disable TLS verification.
workshop cluster install-local --name dev # auto-detect
workshop cluster install-local --vpn # force the VPN
workshop cluster install-local --direct # register by certificate (less secure)
workshop cluster install-local --skip-bootstrap # skip add-on installationIf any step fails, the kind cluster this command created is removed again — you are not left with an orphan to clean up by hand.
VPN (private clusters)
Lets Workshop manage a cluster it cannot reach directly — on a laptop, or behind
a firewall — over an outbound-only WireGuard tunnel. install-local uses this
automatically; these commands are for clusters that already exist.
workshop vpn connect --context <ctx> # Install the connector and attach the cluster
workshop vpn status # Connection status, handshakes and traffic
workshop vpn disconnect # Revoke access and remove the connectorThe WireGuard private key is generated on your machine and never sent to Workshop; only the public half leaves the host.
Runners
Runners run Workshop jobs (OpenTofu for clusters and VMs, image builds, deploys, scripts): one pod per job, connecting out to Workshop only. Every organization has a Default group that runs on Workshop-hosted runners, so nothing needs installing to get started. Install runners of your own to reach private networks or use your own capacity.
workshop runners groups list # Groups; which is the default, which use hosted runners
workshop runners groups create prod-eu # Create a group
workshop runners groups set-default <groupId> # Run work here when no group is chosen
workshop runners groups update <groupId> --no-hosted # Only your own runners take this group's jobs
workshop runners install <groupId> # helm install a runner into the current kubectl context
workshop runners install <groupId> --print # …or just print the helm command
workshop runners token create <groupId> # A registration token for installing by hand
workshop runners list <groupId> # Runners and their status
workshop runners jobs run <groupId> --image alpine --run 'echo hi' --follow
workshop runners jobs list <groupId> --status running
workshop runners jobs logs <groupId> <jobId> # Stream a log until the job ends
workshop runners jobs cancel <groupId> <jobId>jobs run --follow and jobs logs exit 0 if the job succeeded and 1 otherwise. The job's
stdout goes to stdout and everything else to stderr, so they work as CI steps and in pipes.
Drift & plan review
For clusters and VMs on a runner group. Pass --vm when the id is a VM.
workshop drift show <id> # Drift status and the latest plan
workshop drift check <id> --wait # Plan now; exit 0 in sync, 2 drifted, 1 failed (CI-friendly)
workshop drift apply <id> # Apply the latest plan after confirming (reverts drift)
# Review the plan before anything is built
workshop cluster create --group <groupId> --review-plan
workshop drift show <id> --wait # The creation plan
workshop drift apply <id> # Approve: builds exactly that plan
workshop cluster delete <id> # …or discard it (nothing was built)Virtual Machines
workshop vm list # List VMs
workshop vm create # Create a VM
workshop vm get <vmId> # Get VM details
workshop vm delete <vmId> # Delete a VMSecrets
workshop secret list # List secrets
workshop secret create # Create a secret (value prompted securely)
workshop secret get <name> # Get a secret (value masked by default)
workshop secret get <name> --reveal # Show the secret value in plaintext
workshop secret delete <name> # Delete a secretObservability
workshop observability status <infraId> # Get observability stack status
workshop observability enable <infraId> # Enable and provision the stack
workshop observability disable <infraId> # Disable the stack
workshop observability alerts list <infraId> # List alert rules
workshop observability alerts create <infraId> # Create an alert rule
workshop observability alerts delete <infraId> <alertId> # Delete an alert rule
workshop observability alerts toggle <infraId> <alertId> # Toggle an alert on/offGlobal Options
Every command supports these flags:
| Flag | Description |
|---|---|
| --json | Output raw JSON instead of formatted tables |
| --org <orgId> | Override the active organization for this command |
| --help | Show help for any command |
| --version, -v, -V | Print the installed CLI version |
Configuration
The CLI stores its config at ~/.workshop/config.json:
{
"apiUrl": "http://localhost:3000/api/v1",
"token": "eyJ...",
"currentOrgId": "uuid",
"currentOrgName": "My Org",
"currentProjectId": "uuid",
"agentTarget": { "kind": "workspace", "id": "uuid", "label": "Checkout", "projectId": "uuid" }
}Environment variables override the stored file, so no interactive setup is needed in CI or inside a workspace pod:
| Variable | Overrides |
|---|---|
| WORKSHOP_API_URL | apiUrl |
| WORKSHOP_TOKEN | token |
| WORKSHOP_ORG_ID | currentOrgId |
| WORKSHOP_PROJECT_ID | currentProjectId |
| WORKSHOP_WORKSPACE_ID / WORKSHOP_SERVICE_ID | the agent's target |
You can also authenticate using a long-lived API token (useful for CI/CD):
# Generate a scoped token
workshop auth token create --name "ci-deploy" --scopes "services.update,projects.view"
# Use it in CI by writing it to config before running commands
workshop auth token create # copy the printed token
# In CI pipeline:
node dist/main.js config set-token $WORKSHOP_TOKEN
node dist/main.js service deploy $SERVICE_ID --jsonDevelopment
npm run dev -- <command> # Run without building (ts-node)
npm run build # Compile to dist/
npm run lint # ESLint
npm run format # PrettierTech Stack
- nest-commander — NestJS-powered CLI framework
- axios — HTTP client
- chalk — Terminal colours
- cli-table3 — Table output
- ora — Spinners
- @inquirer/prompts — Interactive prompts
- conf — Persistent config storage
