Git worktrees CLI with GitHub integration and Claude Code support
npm install @onmax/wtGit worktrees CLI with GitHub integration and Claude Code support.
``bash`
npm install -g @onmax/wt
- GitHub CLI (gh) installed and authenticated
- Claude Code (optional, for issue investigation)
- Git repository with a GitHub remote
Run wt in any git repository to start the interactive mode:
`bash`
wt
The CLI guides you through creating worktrees from issues, PRs, or custom branches.
| Command | Description |
|---------|-------------|
| wt | Interactive mode with prompts |wt create
| | Create a worktree with a new branch |wt create
| | 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 |
When you run wt without arguments, the CLI presents an interactive menu:
1. Create from Issue - Select an open GitHub issue, auto-generates branch name
2. Create from PR - Clone an existing PR's branch as a worktree
3. Create Custom - Enter a custom branch name
When creating from an issue, the CLI:
- Creates a worktree at ../{repo}-worktrees/{branch}.env
- Copies from the main repo if present
- Pushes to your fork if you lack write access
- Launches Claude Code in plan mode to investigate the issue
Custom worktree paths can be configured per repository in ~/.config/wt/config.json:
`json`
{
"nuxt-hub/core": "~/nuxt/hub-worktrees",
"unjs/nitro": "~/nuxt/nitro-worktrees"
}
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
When you lack push access to a repository, the CLI automatically:
1. Creates or uses your existing fork
2. Adds the fork as a fork remoteuser:branch` head reference
3. Pushes to the fork instead of origin
4. Creates PRs with the correct
MIT