Quickstart
1. Initialize a project
Section titled “1. Initialize a project”cd ~/my-projectdevflow initThe interactive wizard:
- detects your VCS (Git or Jujutsu) and primary/default workspace,
- configures the worktree path and copy policy (every workspace gets its own directory),
- detects Copy-on-Write support on your filesystem,
- optionally adds a first service (PostgreSQL, ClickHouse, MySQL, Redis, …),
- installs the VCS hooks and offers shell integration.
Pass a path (devflow init myapp) to create and initialize a new directory. Git worktrees (or jj workspaces) are always used for additional workspaces in interactive and non-interactive modes.
This writes a .devflow.yml you commit with the repo:
services: - name: app-db type: local service_type: postgres default: true local: image: postgres:17
worktree: path_template: "../{repo}.{workspace}"2. Create an isolated workspace
Section titled “2. Create an isolated workspace”devflow switch -c feature/authOne command does all of it:
- creates the Git ref and linked worktree (or jj workspace) from the current context or
--from <parent>, - creates a worktree at
../my-project.feature_auth_fc659bd73585and copies configured files into it, - clones the parent’s database into a new isolated service workspace (CoW — near-instant),
- runs your
post-create/post-switchhooks (write.env.local, run migrations, …), cds your shell into the worktree (with shell integration installed).
3. Inspect the environment
Section titled “3. Inspect the environment”devflow status # current workspace, services, connection infodevflow list # parent tree with paths, services, processes, and healthdevflow --json list # stable versioned tree document for automation4. Use the connection info
Section titled “4. Use the connection info”devflow connection feature/auth # URIdevflow connection feature/auth --format env # KEY=value linesdevflow connection feature/auth --format json # machine-readableMost projects don’t call this manually — a hook writes .env.local on every switch:
hooks: post-switch: env: action: type: write-env path: .env.local vars: DATABASE_URL: "{{ service['app-db'].url }}"5. Clean up
Section titled “5. Clean up”devflow switch --template # move back to the configured default workspacedevflow remove feature/authPreflight always protects the default/current workspace, so move to another workspace before removing the one you finished; --force does not override that protection. A dirty worktree is also refused unless explicitly forced. Removal hooks run while the directory exists; processes and services are cleaned up before the worktree and VCS ref are deleted.
Where to go next
Section titled “Where to go next”- Workspaces & isolation models — how local CoW containers and shared engines differ
- Worktrees — what gets copied into a worktree and why
- Hooks — automate env files, migrations, and setup
- Project processes — run app servers and workers per workspace
- Adding devflow to an existing project — migrate from Docker Compose incrementally
- AI agents — give every agent task its own environment