A sleek CLI tool for quickly switching between git worktrees.
- Bun runtime
git clone <repo-url>
cd lazyworktrees
bun install
bun linkAfter linking, the lazyworktrees command is available globally.
Then add this shell function to your ~/.zshrc (or ~/.bashrc):
wt() { cd "$(lazyworktrees)" }Reload your shell:
source ~/.zshrcRun wt inside any git repository to interactively select and switch to a worktree:
wtThe CLI prints the selected worktree path to stdout while rendering the UI to stderr, so the wt shell function can cd into it.
You can also run it directly without the alias:
lazyworktreesOr without installing globally:
bun run dev