Provisioning and image management for reef fleets on Vers infrastructure.
Three commands:
provision— Spawn a root reef VM from pre-built commits (fast onboarding)build-root— Build a root reef image and commit it (no secrets baked in)build-golden— Build a golden agent image and commit it (no secrets baked in)
- Vers account — use
--email you@example.comwith any command to shell-auth via magic link. This creates a new Vers account with starter credits if you don't have one, or logs you into your existing account. If you already have aVERS_API_KEYfrom vers.sh, set it in your environment and skip the--emailflag. - Bun — install via
curl -fsSL https://bun.sh/install | bash - Clone this repo —
git clone https://github.com/hdresearch/vers-fleets.git && cd vers-fleets && bun install
Provision a reef fleet from public pre-built images:
bun src/cli.js provision \
--root-commit 5d9c6176-2e9e-4b38-8fc2-f7e0fb3507ce \
--golden-commit d2fedfa3-a835-4745-9b50-0e94d347d26b \
--email you@example.comOr with VERS_API_KEY already set in your environment:
bun src/cli.js provision \
--root-commit 5d9c6176-2e9e-4b38-8fc2-f7e0fb3507ce \
--golden-commit d2fedfa3-a835-4745-9b50-0e94d347d26b| Image | Commit ID | Description |
|---|---|---|
| Root reef | 5d9c6176-2e9e-4b38-8fc2-f7e0fb3507ce |
Root orchestrator — reef server with all services |
| Golden agent | d2fedfa3-a835-4745-9b50-0e94d347d26b |
Agent VM runtime — punkin + pi-vers + reef extensions |
These images contain no secrets and are safe for anyone with a Vers account to use.
Provisioning prints the root reef URL and writes out/deployment.json with your auth credentials. To access the UI:
- Get a magic link — the reef UI requires authentication via a one-time magic link:
# Read the auth token from the deployment manifest AUTH=$(python3 -c "import json; d=json.load(open('out/deployment.json')); print(d['auth']['versAuthToken'])") # Generate a magic link (expires in 5 minutes) curl -s -X POST "https://<your-vm-id>.vm.vers.sh:3000/auth/magic-link" \ -H "Authorization: Bearer $AUTH" -H "Content-Type: application/json"
- Open the link in your browser — it sets a session cookie (30 days) and redirects to the reef dashboard
- Start chatting — type in the chat input or drag-and-drop files. The agent has tools to manage VMs, spawn swarms, deploy services, and more.
- Save your
VERS_API_KEY— printed during provisioning. You'll need it to SSH into VMs and manage commits.
The reef agent uses Claude via the Vers LLM proxy. Make sure your Vers account has credits — the agent won't respond without them. Lieutenants and swarm workers also consume credits when they run.
All commands require authentication via one of:
VERS_API_KEYenvironment variable (e.g. set in.zshrc)--emailflag for interactive shell-auth
Users returning to an existing reef or managing commits should use their saved VERS_API_KEY.
Spawn a root reef VM from pre-built commits and configure it with your keys.
bun src/cli.js provision --root-commit <id> --golden-commit <id> [--email you@example.com]Required flags:
--root-commit <id>— Commit ID of the root reef image--golden-commit <id>— Commit ID of the golden agent image
What happens:
- Authenticates (env key or shell-auth)
- Exchanges
VERS_API_KEYfor anLLM_PROXY_KEYviatokens.vers.sh - Restores a VM from the root commit
- Injects secrets (
VERS_API_KEY,LLM_PROXY_KEY,VERS_AUTH_TOKEN,VERS_GOLDEN_COMMIT_ID) into/opt/reef/.env - Starts reef, waits for health check
- Registers the root in reef's vm-tree and registry
- Writes
deployment.jsonwith VM ID, URL, and auth
The root reef will use the golden commit to spawn all agent VMs (lieutenants, swarm workers, single agents).
Build a root reef image and commit it. No secrets are baked in — the image contains reef, pi-vers, punkin-pi, and all dependencies pre-built.
# From GitHub main (default)
bun src/cli.js build-root --private
# From local development directories
bun src/cli.js build-root --private --reef-path ../reef --pi-vers-path ../pi-vers
# From specific branches
bun src/cli.js build-root --private --reef-ref feature/my-branch --pi-vers-ref mainRequired flags:
--publicor--private
Build a golden agent image for child VMs (lieutenants, swarm workers, all agent types). No secrets or instance-specific URLs are baked in.
# From GitHub main (default)
bun src/cli.js build-golden --private
# From local development directories
bun src/cli.js build-golden --private --reef-path ../reef --pi-vers-path ../pi-vers
# From specific branches
bun src/cli.js build-golden --private --reef-ref feature/my-branch --pi-vers-ref mainRequired flags:
--publicor--private
By default, repos are cloned from GitHub (reef and pi-vers from main, punkin from carter/punkin/v1_rc5). Override with:
| Flag | Description | Default |
|---|---|---|
--reef-path <path> |
Local reef directory (uploads working tree) | Clone from GitHub |
--pi-vers-path <path> |
Local pi-vers directory (uploads working tree) | Clone from GitHub |
--reef-ref <branch|tag> |
Branch or tag for reef from GitHub | main |
--pi-vers-ref <branch|tag> |
Branch or tag for pi-vers from GitHub | main |
--punkin-ref <branch|tag> |
Branch or tag for punkin-pi from GitHub | carter/punkin/v1_rc5 |
Local paths take priority over refs — if both are specified, the local path is used.
| Image | Built by | Used for | Contains |
|---|---|---|---|
| Root commit | build-root |
Root reef VM (orchestrator) | reef server + all services + pi-vers + punkin |
| Golden commit | build-golden |
All agent VMs (lieutenants, swarm, single agents) | Agent runtime + punkin CLI + reef extensions |
Both are Vers commits (VM snapshots), not base images. They're made public via PATCH /api/v1/commits/{id} with {"is_public": true}.
Secrets are injected at spawn time, not build time. Both images are safe to make public.
| Secret | Where injected | Cascades to children? |
|---|---|---|
VERS_API_KEY |
/opt/reef/.env (root), reef-agent.sh (children) |
Yes |
LLM_PROXY_KEY |
/opt/reef/.env (root), reef-agent.sh (children) |
Yes |
VERS_AUTH_TOKEN |
/opt/reef/.env (root), SSH env (children) |
Yes |
VERS_INFRA_URL |
/opt/reef/.env (root), reef-agent.sh (children) |
Yes |
VERS_GOLDEN_COMMIT_ID |
/opt/reef/.env (root), reef-agent.sh (children) |
Yes |
- reef —
https://github.com/hdresearch/reef.gitmain - pi-vers —
https://github.com/hdresearch/pi-vers.gitmain - punkin-pi —
https://github.com/hdresearch/punkin-pi.gitcarter/punkin/v1_rc5
Root reef VM:
- Runs the reef HTTP server with all services (lieutenant, swarm, commits, registry, vm-tree, etc.)
- Owns the SQLite-backed lineage/registry authority
- Spawns all child VMs from the golden commit
Child agent VMs (from golden commit):
- Run punkin in RPC mode (no reef server)
- Point back to root reef via
VERS_INFRA_URL - Inherit
VERS_API_KEYandVERS_GOLDEN_COMMIT_IDso they can spawn their own sub-agents
The golden image build script lives in src/boot.js (buildGoldenImageScript). If you change reef's service structure, extension setup, or punkin integration, update this script to match. The root and golden build scripts share the same source resolution system (git clone or local upload) but differ in directory layout and runtime profile.
Commits are managed via the Vers orchestrator API at https://api.vers.sh/api/v1:
GET /commits— List your own commitsGET /commits/public— List all public commitsPATCH /commits/{id}— Toggleis_public(owner only)POST /vm/from_commit— Restore a VM from a commit (public or owned)POST /vm/{id}/commit— Snapshot a VM into a commit
bun install
bun test| Flag | Commands | Default | Description |
|---|---|---|---|
--out-dir <dir> |
all | out |
Output directory for manifests |
--root-name <name> |
provision, build-root | root-reef |
Name for the root VM |
--force-shell-auth |
all | false |
Force browser-based shell auth even if VERS_API_KEY is set |