Workroot is the machine-wide switchboard for git worktrees.
Use it when you work across multiple repos or many git worktree checkouts and want one small CLI for finding, creating, entering, running, pushing, and pruning them.
Install Workroot:
curl -fsSL https://raw.githubusercontent.com/fridiculous/workroot/main/install.sh | bashDiscover a repo, inspect status, and create a target:
workroot discover /path/to/repo
workroot status
cd "$(workroot new my-repo my-target)"Optional shorthand:
wris supported as a short alias forworkroot
All examples use workroot for clarity; use wr anywhere you want the shorter command.
workroot discover ~/projects/workroot
workroot status
cd "$(workroot new workroot public-launch)"
workroot run workroot public-launch -- cargo test
workroot push workroot public-launch
# After the branch is merged:
workroot prune workroot public-launch- Discover a repo once.
- Check your machine-wide worktree status.
- Create or enter a named target worktree.
- Run commands in that target.
- Push the target branch.
- Prune it after Workroot proves it was merged.
A target is one unit of work: one branch, one worktree path, one status row, and one optional managed session.
| Need | Command |
|---|---|
| Index repos | workroot discover [path] |
| See known worktrees | workroot status [-o json] [repo] [target] |
| Create a target worktree | workroot new [-o json] <repo> <target> |
| Print a target path | workroot path [-o json] <repo> [target] |
| Change directory through shell integration | workroot cd <repo> [target] |
| Run a command in a target | workroot run <repo> <target> -- <cmd...> |
| Push a target branch | workroot push [-o json] <repo> <target> |
| Remove merged targets safely | workroot prune [repo] [target] |
| Install shell integration | workroot shell-init <shell> |
Today:
curl -fsSL https://raw.githubusercontent.com/fridiculous/workroot/main/install.sh | bashCargo:
cargo install workroot-cliHomebrew tap support is planned but not live yet.
eval "$(workroot shell-init zsh)"
eval "$(workroot shell-init bash)"
workroot shell-init fish | sourceShell integration also defines wr as a shorthand for workroot.
workroot cd needs shell integration because a child process cannot change the parent shell directory.
cd "$(workroot path workroot public-launch)"
cd "$(workroot new workroot docs)"workroot path and direct workroot new print path-only stdout.
For scripts that want structured output, use -o json or --output json:
workroot status -o json
workroot path -o json workroot public-launch | jq -r .path
workroot new -o json workroot docs | jq -r .path
workroot push -o json workroot docsworkroot status --json remains supported as a compatibility alias for workroot status -o json.
Workroot is not:
- a Git hosting tool
- a project management tool
- a replacement for Git
- a general tmux or session manager
It wraps local Git workflows. tmux support exists for managed command sessions, but terminal management is not the main product.
MIT