Getting Started
Variant Worktrees manages git worktrees, database schemas, watches, environment variables, and implodes. It comes as a CLI, an MCP server, a VS Code extension, and a library.
It complements the agentic workflow, where several agents work in their own variants while you watch the progress live.
How it works
A variant is a worktree with its own database target. watch creates it and runs the project there. You, or an agent, do the work inside it. implode stops what is running and removes the worktree.
Agent
An agent names the variant and stays in its own directory:
variant watch -s feature-forty-two
# do the work
variant implode -s feature-forty-twowatch creates the worktree _v-feature-forty-two, starts the dev processes, and keeps them up so you can see the progress. implode stops them and removes the worktree.
Human
You step into the worktree and work there yourself:
variant create -s feature-forty-two
cd _v-feature-forty-two
variant watch
# browse, edit, commit, and push
variant implode # implies downcreate makes the worktree. After cd, the slug comes from the branch, so watch and implode need no -s. implode includes down: it stops the processes, drops the database and storage, and removes the worktree.
-s/--slug overrides git detection. Without it, the current worktree branch determines the slug. Every command is explained in Commands.
In another project
mise installs the tools a project asks for and puts them on your PATH when you enter that directory. Add the CLI there:
mise use github:jubr/variant-worktreesvariant is then available in that project; Installation has the full steps. A checkout of this repository builds the CLI instead: see Building.
In VS Code or Cursor, the Extension lists your variants and watches them with one click, and it registers the MCP Server so your agents can drive variants themselves.
What watch runs is set by variant.watches, which ports it picks by variant.ports, and which database it uses by the Database settings, all in variants.yaml. The Overview shows how the steps follow each other, and Configuration lists the templates. Database settings load from mise.local.toml, then environment variables.
Requirements
- the
variantCLI - PostgreSQL, MySQL, or SQLite, each optional
