Commands
Complete reference for all vivarium commands
All commands must be run from the project root directory. Vivarium resolves the project name from package.json["name"] in process.cwd(), falling back to the directory basename if no package.json is found.
vivarium setup
vivarium setupFull first-time setup. Runs these steps in order:
- Check prerequisites (Docker must be on
PATH) - Load config and resolve project name
- Auto-assign a free index (0-99); if already assigned, reuse it
- Compute all ports from the index
- Generate
compose.yamland write to~/.local/share/vivarium/<name>/compose.yaml - Generate compose
.envand write to~/.local/share/vivarium/<name>/.env - Run
docker compose pullthendocker compose up -d --wait - Create S3 buckets (if configured) via the
awsCLI with endpoint override - Write package
.envfiles (only for packages withenvFileset) - Write
state.jsonto registry (index is persisted here) - Run
postSetupscripts for each package - Update
.claude/launch.jsonif it exists (patchesfrontendandapiport entries)
Prints a port summary on completion.
Idempotent. If the project already has a claimed index in the registry, that index is reused. Re-running regenerates compose and env files and restarts services.
setup is the first-time flow. For daily restarts after setup has run, use vivarium start instead. It is faster and does not regenerate files.
vivarium teardown
vivarium teardownFull cleanup. Steps:
- Attempt to load config (nullable -- teardown continues even if
vivarium.jsonwas deleted) - Run
docker compose down --remove-orphans --volumes(removes containers AND volumes) - Delete
~/.local/share/vivarium/<name>/recursively - Migrate legacy
.vivarium/directory if present (from older versions) - Remove each package
envFilefrom the project directory
If config is not found, Vivarium warns that package .env files may need manual cleanup.
teardown passes --volumes to docker compose down. Your Postgres data, Redis state, and S3 objects are permanently deleted. There is no confirmation prompt.
To stop containers without losing data, use vivarium stop instead.
vivarium start
vivarium startMinimal daily restart. Only:
- Checks that
compose.yamlexists in the registry (fails with a hint if not) - Runs
docker compose up -d --wait
Does NOT regenerate files, claim or change the index, pull images, run postSetup, or update anything. Requires a prior vivarium setup.
Use this every time you resume work on a project that is already set up.
vivarium stop
vivarium stopMinimal shutdown. Only:
- Checks that
compose.yamlexists in the registry - Runs
docker compose down
Does NOT pass --volumes. Your Postgres data, Redis state, and S3 objects are preserved. The project index is NOT released.
vivarium status
vivarium statusReads state.json from the registry and shows:
- Project name and assigned index
- All port assignments in a table
- Output of
docker compose ps --format table
If the project has not been set up, prints a hint to run vivarium setup.
vivarium compose
vivarium compose [args...]Pass-through to docker compose. Uses the registry's compose.yaml and .env automatically. Accepts any arguments that docker compose accepts.
# Tail logs for the backend container
vivarium compose logs -f backend
# Open a psql shell
vivarium compose exec postgres psql -U app myapp
# Rebuild a specific service
vivarium compose up -d --build backendYou do not need to specify -f or --env-file flags. Vivarium resolves the correct files from the registry automatically.
vivarium mcp-proxy
vivarium mcp-proxy <service>Bridges stdio to the SSE endpoint of a named service running inside the Docker network. The bridge runs via:
docker run --rm -i --network <composeName>_default \
ghcr.io/sparfenyuk/mcp-proxy:v0.11.0 \
http://<service>:8000/sseThe primary use case is exposing the postgres-mcp sidecar (which only listens on the Docker network, not on any host port) to MCP clients on the host:
vivarium mcp-proxy postgres-mcpRequirements:
- The named service must be running
- The service must expose an SSE endpoint at port
8000on the/ssepath - Docker must be able to pull
ghcr.io/sparfenyuk/mcp-proxy:v0.11.0
To wire this into an MCP client, configure the client to run vivarium mcp-proxy <service> as a stdio command.
Command Comparison
| Command | Regenerates files | Starts containers | Stops containers | Deletes volumes | Persists index |
|---|---|---|---|---|---|
setup | Yes | Yes | No | No | Yes |
start | No | Yes | No | No | No |
stop | No | No | Yes | No | No |
teardown | No | No | Yes | Yes | No (removes it) |
status | No | No | No | No | No |
compose | No | Depends on args | Depends on args | Depends on args | No |