Quick start
If envctl is not installed yet, see Install. Then, from the root of a repository that has a compose file:
envctl init --project mg --file app/docker-compose.ymlThis writes envctl.yaml. The project prefix becomes the first part of every compose project name, so keep it short. Add .envctl/ to .gitignore; that is where rendered files go.
Start the environment
Section titled “Start the environment”envctl upenvctl derives a feature name from your branch, renders an isolated copy of the stack, starts it, and waits for health checks. The output ends with the services, their endpoints, and the env file for host tooling:
env fix-metergraph-capitalizationbranch fix/metergraph-capitalizationproject mg-fix-metergraph-capitalizationbackend localrendered .envctl/fix-metergraph-capitalization/compose.yamlservices postgres running healthyenv source .envctl/fix-metergraph-capitalization/envRun envctl up again any time. It converges the environment instead of failing because it already exists.
Reach a service
Section titled “Reach a service”On OrbStack, every service has a DNS name and no host port is published:
psql -h postgres.mg-fix-metergraph-capitalization.orb.local -U metergraphElsewhere, envctl allocates a stable loopback port per service and records it in the env file:
set -a; . .envctl/fix-metergraph-capitalization/env; set +apsql -h 127.0.0.1 -p "$ENVCTL_PORT_POSTGRES_5432" -U metergraphenvctl status prints both forms, and envctl status --json prints them for scripts.
Start a second one
Section titled “Start a second one”Check out another branch in a second worktree and run envctl up there. You now have two complete stacks with separate networks, volumes, and names:
envctl listmg-fix-metergraph-capitalization running(1)mg-main running(1)Stop, keep, or remove
Section titled “Stop, keep, or remove”| Goal | Command |
|---|---|
| Pause, keep data | envctl stop then envctl start |
| Remove containers, keep data | envctl down |
| Remove everything including volumes and ports | envctl down -v |
Where next
Section titled “Where next”- Concepts explains features, environments, and port modes.
- How to work with envctl covers Makefiles, native test runners, and several branches at once.
- Agents wires Claude Code worktrees to environments.
Where next
Section titled “Where next”- Your first workflow runs a feature end to end with agents in an isolated VM.