Git isolates files.
fed isolates the stack.
Run your app natively and its dependencies in Docker from one fed.yaml.
Give every Git worktree and coding agent its own ports, containers, and volumes—and
stop copy-pasting .env files across checkouts and teammates.
MIT-licensed CLI · runs locally with no account required.
fed.yaml, two live stacks — each checkout gets its own Postgres container, volume, and allocated ports without colliding.
One full stack per Git worktree.
Run parallel branches and coding agents without port, container, or database
collisions. fed uses the checkout directory as the isolation boundary,
so no editor plugin or agent wrapper is required.
- Auto-allocated ports
- Every
type: portparameter gets a conflict-free port in an isolated worktree, and every service, URL, and script receives it automatically. - Scoped containers, volumes, and state
- Docker container names, named volumes, generated secrets, and
.fed/state stay bound to the checkout. Nothing leaks across branches. - Main checkout stays untouched
- Enabling isolation in a worktree never disturbs your primary checkout’s ports or database.
Run `fed isolate enable` before any other fed command in a new worktree. Run project tasks through fed so they receive this worktree's ports and credentials. Run `fed clean` before removing the worktree.
Stop copy-pasting .env files.
A missing API key shouldn’t stall a new worktree or a new teammate. Generate local
secrets automatically, or link the repo with fed link org/project so
fed start injects shared dev credentials into every checkout.
- Out of Git and shell history. Values stay out of repositories, logs, and list responses; admins update values via
fed secrets set NAMEfrom stdin or a hidden prompt. - Memory-only by default, offline when you want it. Vault values stay in
fedand its child processes unless you opt intosecret_cache: file(mode0600, Git-ignored). - Dev keys and private registries. Share Google Maps, Stripe, or OAuth dev keys—plus read-only pull tokens so teammates skip manual
docker login.
Built for development credentials, not production secrets. The open-source CLI and
local type: secret generation work completely offline without an account.
Your local setup, executable in fed.yaml.
Define Docker dependencies, native host processes, installs, migrations, and health
checks in one dependency graph. Every checkout runs the same setup with
fed start.
- Install once, migrate on every start
installhandles one-time dependency setup.migrateruns repeatable schema or seed steps before your app boots.- Wait for readiness, not
sleep 5 depends_onwaits for the healthcheck to pass, not just for the container to exist. Your API starts only after Postgres reports ready.- Declare typed values once
{{API_PORT}}and{{DB_PASSWORD}}flow into environments, healthchecks, and scripts—so every worktree gets fresh values automatically.
parameters: API_PORT: { type: port, default: 8080 } DB_PORT: { type: port, default: 5432 } DB_PASSWORD: { type: secret } DATABASE_URL: type: string default: "postgres://app:{{DB_PASSWORD}}@localhost:{{DB_PORT}}/app" services: database: image: postgres:16-alpine ports: ["{{DB_PORT}}:5432"] volumes: ["app-data:/var/lib/postgresql/data"] environment: POSTGRES_USER: app POSTGRES_PASSWORD: "{{DB_PASSWORD}}" POSTGRES_DB: app healthcheck: command: pg_isready -U app -d app api: process: npm run dev depends_on: [database] install: npm install migrate: npm run db:migrate startup_message: "API running on http://localhost:{{API_PORT}}" environment: PORT: "{{API_PORT}}" DATABASE_URL: "{{DATABASE_URL}}" healthcheck: http_get: "http://localhost:{{API_PORT}}/health" scripts: db:studio: depends_on: [database] environment: DATABASE_URL: "{{DATABASE_URL}}" script: npm run db:studio entrypoint: api
Run tests against throwaway stacks.
Put database tools, seeds, and integration tests under scripts. A task
reuses running services—or spins up a fresh, isolated database with
isolated: true and cleans it up when done.
scripts: test:integration: isolated: true depends_on: [database] environment: DATABASE_URL: "{{DATABASE_URL}}" script: npm run test:integration
- Starts what’s missing, stops what it started
- Run
fed run db:studioorfed run test:integrationon a cold checkout andfedboots dependencies, passes the right ports and secrets, and cleans up after. - Leaves your dev database alone
isolated: trueallocates a fresh container and port for the test run so integration tests never wipe your working data.
Use fed when
- You run multiple checkouts at once—Git worktrees, parallel branches, or coding agents.
- You’re tired of pasting
.envfiles and API keys into every new worktree or teammate’s laptop. - Your app runs natively on the host while Postgres, Redis, or queues run in Docker.
- Integration tests and local scripts need real dependencies started in health-checked order.
fed runs local development environments. It does not deploy applications.
Why I built fed
I built fed because I kept fighting port collisions across Git worktrees
and copy-pasting .env files for API keys every time I spun up a fresh
checkout or brought a teammate onto a repo.
I hope it saves you the same friction. If something gets in your way, open an issue or fork it. The CLI is MIT licensed.