https://github.com/sulthonzh/worktree-manager
Zero-config CLI for git worktree management with intelligent automation
https://github.com/sulthonzh/worktree-manager
branch-management cli developer-tools git git-branch git-worktree git-worktrees workflow worktree
Last synced: 6 days ago
JSON representation
Zero-config CLI for git worktree management with intelligent automation
- Host: GitHub
- URL: https://github.com/sulthonzh/worktree-manager
- Owner: sulthonzh
- License: mit
- Created: 2026-05-24T17:43:22.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-06-23T01:22:55.000Z (8 days ago)
- Last Synced: 2026-06-23T03:13:23.360Z (8 days ago)
- Topics: branch-management, cli, developer-tools, git, git-branch, git-worktree, git-worktrees, workflow, worktree
- Language: TypeScript
- Size: 47.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# worktree-manager
Zero-config CLI for git worktree management with intelligent automation.
## Features
- **Zero-config**: Works out of the box, no setup required
- **Intelligent automation**: Automatically copies dependencies and environment files
- **Interactive commands**: User-friendly prompts for common operations
- **Smart path generation**: Automatically generates worktree paths based on branch names
- **Worktree cleanup**: Detects and removes stale worktrees
- **Branch management**: Create, list, remove worktrees with branch awareness
## Installation
```bash
npm install -g worktree-manager
```
## Usage
### Add a new worktree
```bash
wtm add
```
Options:
- `-d, --detach`: Create a detached worktree
- `-f, --force`: Force creation even if worktree exists
- `-s, --skip-setup`: Skip automatic dependency copying
### List all worktrees
```bash
wtm list
```
Options:
- `-v, --verbose`: Show detailed information
### Remove a worktree
```bash
wtm remove
```
Options:
- `-b, --with-branch`: Also delete the associated branch
- `-f, --force`: Force removal
### Change directory to a worktree
```bash
wtm cd
```
### Clean stale worktrees
```bash
wtm clean
```
### Configure worktree-manager
```bash
wtm config
```
## Examples
```bash
# Add a worktree for a feature branch
wtm add feature/new-ui
# Add with detached HEAD
wtm add --detach hotfix/bug-123
# List all worktrees with details
wtm list --verbose
# Remove a worktree and its branch
wtm remove --with-branch feature/old-feature
# Clean up stale worktrees
wtm clean
# Change to a worktree directory
wtm cd develop
```
## How It Works
worktree-manager wraps `git worktree` commands with additional automation:
1. **Automatic dependency detection**: Detects Node.js, Python, and other project types
2. **Smart file copying**: Copies package.json, requirements.txt, .env files, etc.
3. **Environment setup**: Runs project-specific setup commands
4. **Path generation**: Creates organized worktree directories (e.g., `../worktrees/branch-name`)
## Requirements
- Node.js >= 18.0.0
- Git 2.5+ (with worktree support)
## License
MIT