Git worktrees that are
ready to work.
A fresh git worktree is never actually ready — your .env files are missing and dependencies aren't installed. mycadre creates the worktree, copies your local config, runs your setup, and tracks it so cleanup is one command.
$ npm install -g mycadre # then, in any git repo: $ mycadre create my-feature
Why it exists
Worktrees are great for working several branches at once — reviewing a PR while your feature branch builds, or running a fleet of AI coding agents in parallel, each in its own checkout. But every fresh checkout starts broken.
Env files are gone
Gitignored files like .env never make it into a new worktree. mycadre copies the ones you name.
Nothing is installed
No node_modules, no build. mycadre runs your setup command right after creating the checkout.
Orphans pile up
It's easy to forget which directories you made. mycadre tracks every worktree so listing and cleanup are trivial.
Zero config to start
One init writes a small mycadre.json you commit and share with your team. No global setup.
Quick start
Requires Node.js ≥ 18 and git on your PATH.
# in your project's git repo $ mycadre init # writes mycadre.json (edit to taste) $ mycadre create feature/login # new branch + worktree, env copied, setup run $ mycadre list # see your tracked worktrees $ mycadre remove feature/login # delete the worktree and its branch $ mycadre clean # prune worktrees git already dropped
Commands
Six commands, that's the whole surface.
| Command | What it does |
|---|---|
mycadre init | Create a mycadre.json config at the repo root. |
mycadre create <branch> [--from <base>] | Create a worktree for <branch> (new branch off <base> or the current branch, unless it already exists), copy configured files into it, and run the setup command. |
mycadre list | List tracked worktrees and flag any that have gone missing. |
mycadre remove <branch> [--keep-branch] [--force] | Remove the worktree and (unless --keep-branch) delete the branch. |
mycadre clean | Prune git worktrees and drop stale tracking entries. |
mycadre doctor [--json] | Check that git, your repo, mycadre.json, worktreeDir, and tracked worktrees are all in a healthy state. Exits 1 if anything's wrong. |
Configuration
mycadre init writes a mycadre.json at your repo root:
{
"worktreeDir": "../mycadre-worktrees",
"copy": [".env", ".env.local"],
"setup": "npm install"
}
worktreeDir — where worktrees are created, relative to the repo root.
copy — files/directories copied from the repo root into each new worktree (typically gitignored local config). Missing entries are skipped silently.
setup — a shell command run inside the new worktree after creation, or null to skip.
Commit mycadre.json so your team shares the same setup. mycadre stores tracking data in .mycadre-state.json — add that to your .gitignore.