Local export
Some work happens better on your machine — heavier debugging, IDE integrations, plugging into local tools. Local export is withvibe's escape hatch: take any env you have access to and run it locally with one command.
The flow at a glance
- Open any env in the web app.
- Click Export in the env panel.
- Copy the suggested command:
withvibe env <envId>. - Paste it into your terminal. The CLI does the rest.
What the CLI does
- Authenticates you (one-time
withvibe login, device-flow). - Calls
GET /envs/:envId/local-bundleon your withvibe API to fetch everything it needs:- Env metadata (id, title, description, workspace).
- Repo list with URLs and base branches.
- The compose file — either rendered from the env's template or a custom one.
- Any template assets (with
$${VAR}placeholders pre-resolved). - The list of
system-portvariable keys, so the CLI knows which ports to allocate locally.
- Clones each repo into
./envs/<title-slug>/<repo>/, checking out the env branch. - Allocates free localhost ports for every
system-portvariable. Allocation happens entirely on your machine — the server's port assignments aren't relevant locally. - Forces
PUBLIC_HOST=localhostin the rendered env, so service-url variables point athttp://localhost:<port>regardless of how the server is configured. - Writes the rendered
docker-compose.yml+ assets, then runsdocker compose up -d. - Opens the worktree in VS Code (or your configured editor).
What moves and what doesn't
The export bundle includes the things needed to reproduce the env shape locally:
- ✅ Repo URLs + branches (cloned fresh on your disk)
- ✅ The rendered docker-compose, with secrets resolved from the workspace vault
- ✅ Template assets like
.envfiles, fixtures, init scripts - ✅ The full list of variable keys so the CLI can re-render in port mode
It does not include:
- ❌ Container disk state (Postgres data, uploaded files, caches) — fresh volumes
- ❌ The Claude session — local exports run without a withvibe agent attached by default
- ❌ The runner container — exports are about getting the stack running, not the AI
Routing
Local exports always run in port mode, regardless of how the server-side env was routed. Subdomain-mode envs are silently re-rendered for ports when exported, with PUBLIC_HOST=localhost. This matches the spirit of “run it on my laptop”: no DNS, no Traefik, no certs.
Authentication
withvibe login
# Browser opens; approve the device.
# Token is stored at ~/.withvibe/credentialsThe CLI uses a short-lived bridge JWT minted by the web edge after validating a CLI device token. The bundle endpoint is auth-required and scoped to your workspace membership.
Coming back online
When you're done locally, you have the usual git options:
- Push the env branch to the remote and have the server-side env pull from it.
- Open a PR directly from your local branch — the env's server-side copy stays as a snapshot.
- Cherry-pick commits back into the server-side env via the Git tab.