Warm your local Turborepo cache across a list of branches — in the background, without touching your working checkout.
Paste a list of branches and a turbo command; for each branch the tool:
- Creates a detached git worktree in a temp directory (your main checkout is never touched)
- Merges the latest default branch (
origin/main) into the branch, so the warmed cache matches what you'd build after updating; branches with merge conflicts are skipped and listed at the end - Mirrors loose gitignored files (
.env*,*.generated.ts, etc.) from your main checkout into the worktree — these are often turbo hash inputs (globalDependencies, taskinputs), and without them every task hash would differ from your real checkout, making the warmed cache useless - Installs dependencies (auto-detects
pnpm/yarn/npm/bunfrom the lockfile) - Runs your turbo command (e.g.
npx turbo run build) - Ensures the cache lands in your primary repo: turbo 2.x shares its cache across worktrees automatically (via the git common dir); any cache left in the worktree itself (turbo 1.x) is merged back by copying entries you don't already have
- Removes the worktree
Turbo's local cache is content-addressed (entries are keyed by task hash), so merging is safe — only entries you don't already have get copied. Afterwards, checking out any of those branches gives you FULL TURBO cache hits.
Supports both cache locations: .turbo/cache (turbo ≥ 2) and node_modules/.cache/turbo (turbo 1.x).
npm install -g . # from this directory
# or run directly:
node index.jsInteractive (paste branches, then the command):
cd ~/work/my-monorepo
turbo-hot-cacheNon-interactive:
turbo-hot-cache --command "npx turbo run build" main feat/login feat/billing
turbo-hot-cache --repo ~/work/my-monorepo --command "npx turbo run build lint" --branches "main, develop"Run it in a spare terminal (or with &) and it warms each branch sequentially while you keep working.
| Flag | Description |
|---|---|
--repo <path> |
Path to the git repo (default: current directory) |
--command "<cmd>" |
Turbo command to run in each worktree |
--branches "<list>" |
Comma/space separated branches (also accepted as positional args) |
--skip-install |
Skip dependency installation in each worktree |
--skip-merge |
Don't merge the default branch into each branch first |
--skip-sync |
Don't mirror gitignored files into each worktree |
--keep-worktrees |
Leave worktrees on disk for debugging |
- Always warms the latest version of each branch: the tool runs
git fetch --allfirst and prefersorigin/<branch>over any (possibly stale) local branch. Local-only branches still work. - Branches are checked out detached, so a branch currently checked out in your main repo can still be warmed.
- If the turbo command fails partway, whatever cache entries were produced are still copied.
- Requires Node ≥ 18 and git ≥ 2.30.