@mazli/pi-worktree
v0.1.0
Published
A Pi package extension that simplifies creating and managing git worktrees.
Maintainers
Readme
Pi Worktree
A small Pi extension that makes Git worktrees easy to open from inside Pi.
If you already use worktrees, this removes the setup ceremony: no manual folder creation, no separate git worktree add, no reopening Pi in another directory.
The shortcut
Inside any Git repository, run:
/worktree Feature/AuthPi Worktree creates or reuses the matching worktree and switches Pi into it.
What it handles for you
The command takes care of the repetitive setup:
- creates
.worktrees/when needed - creates or reuses the Git branch
- creates or reuses the matching worktree
- adds
.worktreesto an existing.gitignorewhen needed - opens a fresh Pi session rooted in the worktree
- works from both brand-new and already-persisted Pi sessions
You stay inside Pi. The extension handles the ceremony.
Usage
Run the command with the branch name you want:
/worktree my-featurePi will move you into:
.worktrees/my-featureFrom there, just keep prompting or coding as usual. The command switches sessions without automatically triggering an agent response.
Naming
The name you pass is used as the Git branch name.
If the name contains path separators, the folder name is cleaned up:
/worktree Feature/AuthBranch:
Feature/AuthFolder:
.worktrees/Feature-AuthInstallation
Install the package with Pi:
pi install npm:@mazli/pi-worktreeOr try it for a single Pi run without installing it permanently:
pi -e npm:@mazli/pi-worktreeDevelopment
From this repository:
npm install
npm run check
pi -e .The package entry point is declared in package.json and loads the extension from extensions/.
License
MIT
