{"_id":"@anandamw/worktree","name":"@anandamw/worktree","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.2":{"name":"@anandamw/worktree","version":"0.1.2","description":"Safe Git worktree management commands for Pi","type":"module","private":false,"publishConfig":{"access":"public"},"keywords":["pi-package","pi-coding-agent","extension","git","worktree"],"pi":{"extensions":["./extensions"]},"engines":{"node":">=20"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/4nndmw/pi-rakit.git","directory":"packages/worktree"},"homepage":"https://github.com/4nndmw/pi-rakit#readme","bugs":{"url":"https://github.com/4nndmw/pi-rakit/issues"},"gitHead":"be71fa6037687c2ab40122347f538a8be81987d6","_id":"@anandamw/worktree@0.1.2","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-wWF4Pbej4eOwjluF61dCkSLxYC3Lga3L6Sf37B8Ws4ep/Ki39CDJsBJl2UCE4wVJMY8lewd2vgD+FtKTHcWUJw==","shasum":"2945af27c64615cfbff2a28a19aa626f2aa4c27c","tarball":"https://registry.npmjs.org/@anandamw/worktree/-/worktree-0.1.2.tgz","fileCount":4,"unpackedSize":10169,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDChU9D+nrjS2HNAwIkv3esMqSwOUfqEwnT21BvbRetLwIgG95CTQHqKbWyIEmnWxg5byWWUljjnlO9da12osYitN8="}]},"_npmUser":{"name":"anandamw","email":"anandamw.dev@gmail.com"},"directories":{},"maintainers":[{"name":"anandamw","email":"anandamw.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/worktree_0.1.2_1789113091708_0.25684189558603676"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-11T07:51:31.523Z","0.1.2":"2026-09-11T07:51:31.816Z","modified":"2026-09-11T07:51:32.000Z"},"maintainers":[{"name":"anandamw","email":"anandamw.dev@gmail.com"}],"description":"Safe Git worktree management commands for Pi","homepage":"https://github.com/4nndmw/pi-rakit#readme","keywords":["pi-package","pi-coding-agent","extension","git","worktree"],"repository":{"type":"git","url":"git+https://github.com/4nndmw/pi-rakit.git","directory":"packages/worktree"},"bugs":{"url":"https://github.com/4nndmw/pi-rakit/issues"},"license":"MIT","readme":"# Pi Rakit Worktree\r\n\r\nA Pi extension for safely listing, creating, and removing Git worktrees without leaving your coding session.\r\n\r\n## Requirements\r\n\r\n- Node.js 20+\r\n- Git\r\n- Pi\r\n- A Git repository\r\n\r\n## Install\r\n\r\nInstall directly:\r\n\r\n```bash\r\npi install npm:@anandamw/worktree\r\n```\r\n\r\nOr run the Pi Rakit installer and select **Worktree**:\r\n\r\n```bash\r\nnpx @anandamw/pi-rakit@latest --install\r\n```\r\n\r\nStart or reload Pi after installation.\r\n\r\n## Commands\r\n\r\n### List worktrees\r\n\r\n```text\r\n/worktree list\r\n```\r\n\r\nThe result includes each branch and its absolute directory:\r\n\r\n```text\r\nmain\r\n  /home/user/projects/my-app\r\nworktree/issue-123\r\n  /home/user/projects/my-app-issue-123\r\n```\r\n\r\n### Create a worktree\r\n\r\n```text\r\n/worktree create issue-123\r\n```\r\n\r\nWhen the current repository is `/home/user/projects/my-app`, the command creates:\r\n\r\n- Branch: `worktree/issue-123`\r\n- Directory: `/home/user/projects/my-app-issue-123`\r\n- Starting point: the current `HEAD`\r\n\r\nOpen the generated sibling directory in another terminal or Pi session:\r\n\r\n```bash\r\ncd ../my-app-issue-123\r\npi\r\n```\r\n\r\nNames may contain letters, numbers, dots, underscores, and hyphens, and must start with a letter or number. Spaces and slashes are not accepted.\r\n\r\n### Remove a worktree\r\n\r\n```text\r\n/worktree remove issue-123\r\n```\r\n\r\nSelect **Remove** in the confirmation dialog. This removes the additional working directory but preserves branch `worktree/issue-123`. Delete the branch separately only after reviewing or merging it:\r\n\r\n```bash\r\ngit branch -d worktree/issue-123\r\n```\r\n\r\n## Example Workflow\r\n\r\n1. Make sure the current repository is clean with `git status --short`.\r\n2. Run `/worktree create issue-123` in Pi.\r\n3. Work and commit in the generated `<repository>-issue-123` directory.\r\n4. Return to the original repository and run `/worktree remove issue-123`.\r\n5. Merge or delete `worktree/issue-123` with your normal Git workflow.\r\n\r\n## Safety\r\n\r\n- `main` and `master` are protected names.\r\n- Creation requires the current worktree to have no tracked or untracked changes.\r\n- Creation refuses to reuse an existing `worktree/<name>` branch.\r\n- Removal requires explicit confirmation and a clean target worktree.\r\n- The current worktree cannot remove itself.\r\n- Removal never uses `--force` and preserves the Git branch.\r\n\r\n## Troubleshooting\r\n\r\n- **`Current worktree has uncommitted changes.`** Commit, stash, or remove changes in the current repository before creating a worktree.\r\n- **`Target worktree has uncommitted changes.`** Commit, stash, or remove changes in the target directory before removing it.\r\n- **`Branch already exists: worktree/<name>`** Choose another name; existing branches are not reused.\r\n- **`Worktree not found for branch worktree/<name>.`** Run `/worktree list` and pass only the part after `worktree/`.\r\n\r\nSee the full [Worktree guide](https://github.com/4nndmw/pi-rakit/blob/main/docs/rakit/Worktree.md) for detailed behavior and examples.\r\n","readmeFilename":"README.md","_rev":"1-430a66f3c9baca40e0d9203a901315c2"}