preamble is a small workspace helper for git worktrees.
It is designed around a project prefix (default: project) and a workspace root (default: ~/local/work).
- List numbered worktrees like
project-08with their current branch. - Resolve a suffix (e.g.
pre 08) to a workspace path. - Create the next worktree with
pre newfromorigin/main. - Create from another base ref with
pre new <branch>(resolved asorigin/<branch>). - Print/install a zsh wrapper so suffix commands can
cdin your shell.
pre # interactive picker in a TTY
pre list
pre 08
pre new
pre new other-branch
pre remove 08 --yes
pre remove 08 --yes --force
pre rm 08 --yes
pre setup
pre setup --install
pre initThe Go binary cannot change the parent shell directory directly.
Use the wrapper installer:
pre setup --install
source ~/.functions.shThis installs a pre() shell wrapper in ~/.functions.sh so commands like pre 08 navigate correctly.
Environment variables:
PRE_BASE(default:$HOME/local/work/project)
Example:
export PRE_BASE="${HOME}/local/work/project"Build and link the binary into ~/go/bin:
just binRun locally:
go run ./cmd/pre list