@michalkvasnicak/pi-worktrees0.1.0
Create Git worktrees and switch Pi's built-in tools to them.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-worktrees
Create a Git worktree and switch Pi's built-in tools to it without leaving the current conversation.
Install from this checkout with pi install /absolute/path/to/pi-worktrees, or try it for one invocation with pi -e /absolute/path/to/pi-worktrees/extension.ts.
From a Pi session in a Git repository, run:
/worktree-create update docs
This creates the update-docs branch from the current HEAD and checks it out under ~/.pi/worktrees/. Uncommitted changes stay in the original checkout. Pi records the new tool directory in the conversation without starting a model turn.
Run /worktree-exit to switch back to the previous checkout without removing the worktree or starting a model turn. If you created several worktrees in succession, each exit goes back one checkout.
Run /worktree-rebase to rebase the active worktree onto the local branch it was created from. It does not fetch. If Git stops on a conflict, resolve it with git rebase --continue or cancel with git rebase --abort in the worktree.
Run /worktree-cleanup to remove the active worktree and its branch, then return to the previous checkout. Run it instead of /worktree-exit when you want to remove the worktree. Cleanup does not force removal or branch deletion, and it refuses to remove a worktree with commits missing from its source branch. Worktrees created before Pi recorded branch information still support /worktree-exit, but must be rebased or removed with Git directly.
Pi's built-in tools and ! shell commands use the selected checkout. The session's original directory still controls project settings, @path references, and third-party tools.