work manages git worktrees with multi-project management, an interactive picker, and GitHub PR status.
~/workspace/web $ work mz-auth-redesign
Fetching origin/main...
Creating new branch from origin/main...
~/workspace/worktrees/web/mz-auth-redesign $
Bash / Zsh (requires fzf and jq):
# In your .bashrc or .zshrc
source /path/to/work.shNushell:
# In your config.nu
source ~/.config/nushell/work.nuBoth implementations require git and gh (GitHub CLI).
| Command | What it does |
|---|---|
work |
Interactive fuzzy picker: project -> worktree -> cd |
work <branch> |
Create a worktree (or cd into an existing one) |
work ls |
List worktrees with PR status and CI results |
work rm [branch] |
Delete a worktree and its local branch |
work prune |
Clean up merged worktrees across all projects |
work add [path] |
Register a git repo as a project |
Fuzzy-select a project, then a worktree. ESC goes back.
Select project:
> web 3 worktrees ~/workspace/web
zenpayroll 1 worktree ~/workspace/zenpayroll
api no worktrees ~/workspace/api
PR state, CI status, and links — all inline.
web worktrees:
mz-feature-auth (2 days ago) #142 open ✓ 12/12 https://github.com/org/web/pull/142
mz-fix-login (5 days ago) #138 merged
mz-refactor-api (1 week ago) #135 open ✗ 8/12 https://github.com/org/web/pull/135
mz-add-tests (3 days ago) <- current
Cleans up across every registered project in one shot.
$ work prune
web - fetching...
mz-old-feature removed
mz-shipped removed
zenpayroll - fetching...
mz-done removed
Pruned 3 worktree(s) across 2 project(s)
Projects are registered in ~/.config/work/ and worktrees live under ~/workspace/worktrees/:
~/workspace/worktrees/
├── web/
│ ├── mz-feature-auth/ # full git checkout
│ └── mz-fix-login/
└── api/
└── mz-experiment/
Bash/Zsh (work.sh) |
Nushell (work.nu) |
|
|---|---|---|
| Fuzzy picker | fzf |
input list --fuzzy |
| Config format | plain text | .nuon |
| JSON parsing | jq |
native from json |
| Parallelism | background jobs | par-each |
Both use the same worktree directory layout, so worktrees are cross-visible.