@onmax/wt
v0.1.0
Published
Git worktrees CLI with GitHub integration and Claude Code support
Downloads
205
Maintainers
Readme
wt
Git worktrees CLI with GitHub integration and Claude Code support.
Installation
npm install -g @onmax/wtPrerequisites
- GitHub CLI (
gh) installed and authenticated - Claude Code (optional, for issue investigation)
- Git repository with a GitHub remote
Usage
Run wt in any git repository to start the interactive mode:
wtThe CLI guides you through creating worktrees from issues, PRs, or custom branches.
Commands
| Command | Description |
|---------|-------------|
| wt | Interactive mode with prompts |
| wt create <branch> | Create a worktree with a new branch |
| wt create <branch> --pr | Create worktree and open a draft PR |
| wt clone | Clone an existing PR as a worktree |
| wt list | Show all worktrees with PR status |
| wt sync | Pull latest changes from the base branch |
| wt clean [pr] | Verify CI and prepare for merge |
Interactive Mode
When you run wt without arguments, the CLI presents an interactive menu:
- Create from Issue - Select an open GitHub issue, auto-generates branch name
- Create from PR - Clone an existing PR's branch as a worktree
- Create Custom - Enter a custom branch name
When creating from an issue, the CLI:
- Creates a worktree at
../{repo}-worktrees/{branch} - Copies
.envfrom the main repo if present - Pushes to your fork if you lack write access
- Launches Claude Code in plan mode to investigate the issue
Configuration
Custom worktree paths can be configured per repository in ~/.config/wt/config.json:
{
"nuxt-hub/core": "~/nuxt/hub-worktrees",
"unjs/nitro": "~/nuxt/nitro-worktrees"
}How It Works
The CLI uses git worktrees to maintain multiple working directories linked to a single repository. This approach:
- Eliminates the need to re-clone repositories
- Allows instant switching between branches via
cd - Shares fetched objects across all worktrees
- Enables working on multiple branches simultaneously
Fork Workflow
When you lack push access to a repository, the CLI automatically:
- Creates or uses your existing fork
- Adds the fork as a
forkremote - Pushes to the fork instead of origin
- Creates PRs with the correct
user:branchhead reference
License
MIT
