A modern CLI tool to simplify Git worktree management. Create worktrees with a single command and optionally launch your favorite editor.
- ✨ Simple worktree creation:
wtm create feature-branch - 📋 List all worktrees:
wtm list- Display all worktrees with their branches - 🎯 Smart defaults: Automatically creates worktrees in
../wt-<branch>directory - 🚀 Editor integration: Auto-launch VS Code, Vim, Emacs, or IntelliJ IDEA
- 🛠️ Custom paths: Specify where to create worktrees
- 📊 Table format: Human-readable table output with Unicode box-drawing characters
- 📋 Multiple output formats: Human-readable or JSON for automation
- ✅ Cross-platform: Works on macOS, Linux, and Windows
- .NET 10.0 SDK or later
- Git 2.5 or later
macOS / Linux:
curl -fsSL https://kuju63.github.io/wt/install.sh | shWindows (PowerShell):
irm https://kuju63.github.io/wt/install.ps1 | iexThe install script automatically:
- Detects your platform and architecture
- Downloads the latest version
- Verifies the SHA256 checksum
- Installs to
~/.local/bin(Unix) or%LOCALAPPDATA%\Programs\wtm(Windows)
Download the latest release for your platform from the GitHub Releases page.
Each release includes:
- Pre-built binaries for Windows, Linux (x64, ARM), and macOS (ARM64)
- SHA256 checksums for verifying download integrity
- Individual
.sha256files for each binary - Combined
SHA256SUMSfile for batch verification
Verify your download (recommended):
# Linux/macOS
sha256sum -c wtm-v1.0.0-linux-x64.sha256
# macOS (alternative)
shasum -a 256 -c wtm-v1.0.0-macos-arm64.sha256
# Windows PowerShell
$hash = (Get-FileHash .\wtm-v1.0.0-windows-x64.exe).Hash
$expected = (Get-Content .\wtm-v1.0.0-windows-x64.exe.sha256).Split(" ")[0]
$hash -eq $expected # Should return TrueFor detailed installation and verification instructions, see the Installation Guide.
git clone https://github.com/kuju63/wt.git
cd wt
dotnet build
dotnet run --project wt.cli -- create --helpdotnet pack
dotnet tool install --global --add-source ./nupkg wtCreate a new worktree with a new branch:
wtm create feature-loginThis will:
- Create a new branch named
feature-loginfrom your current branch - Create a worktree at
../wt-feature-login - Check out the new branch in the worktree
Create a branch from a specific base branch:
wtm create feature-login --base mainCreate a worktree at a custom location:
wtm create feature-login --path ~/projects/myapp-feature-loginCreate a worktree and automatically open it in your editor:
wtm create feature-login --editor vscodeSupported editors:
vscode- Visual Studio Codevim- Vimemacs- Emacsnano- Nanoidea- IntelliJ IDEA
For automation and scripting:
wtm create feature-login --output jsonShow detailed diagnostic information:
wtm create feature-login --verboseList all worktrees with their branch information.
Display all Git worktrees in the repository with their paths, checked-out branches, and status in a table format. Missing worktrees (registered but not existing on disk) are highlighted with warnings.
Output:
┌─────────────────────────────────┬──────────────────┬─────────┐
│ Path │ Branch │ Status │
├─────────────────────────────────┼──────────────────┼─────────┤
│ /Users/dev/project/wt │ main │ active │
│ /Users/dev/project/wt-feature │ feature-branch │ active │
└─────────────────────────────────┴──────────────────┴─────────┘Exit Codes:
0- Success1- Git not found2- Not a Git repository10- Git command failed99- Unexpected error
Create a new worktree with a new branch.
Arguments:
<branch>- Name of the branch to create (required)
Options:
-b, --base <base>- Base branch to branch from (default: current branch)-p, --path <path>- Path where the worktree will be created (default:../wt-<branch>)-e, --editor <type>- Editor to launch after creating worktree (choices: vscode, vim, emacs, nano, idea)--output <format>- Output format: human or json (default: human)-v, --verbose- Show detailed diagnostic information-h, --help- Show help and usage information
wtm create feature-authOutput:
✓ Created branch: feature-auth
✓ Created worktree: /Users/username/projects/wt-feature-auth
✓ Checked out: feature-authwtm create bugfix-123 --base main --path ~/bugfixes/fix-123wtm create feature-ui --editor vscodeThis will create the worktree and automatically open VS Code in the new worktree directory.
wtm create feature-api --output json | jq '.worktree.path'Output:
{
"success": true,
"worktree": {
"path": "/Users/username/projects/wt-feature-api",
"branch": "feature-api",
"baseBranch": "main",
"createdAt": "2026-01-03T12:34:56Z"
}
}Solution: Run wtm from within a Git repository directory.
cd /path/to/your/git/repo
wtm create my-branchSolution: Use a different branch name or delete the existing branch first.
git branch -d existing-branch
wtm create existing-branchSolution: Specify a different path or remove the existing directory.
wtm create my-branch --path ~/different/pathSolution: Ensure the editor is installed and available in your PATH.
# For VS Code on macOS
code --version
# For Vim
vim --versionEvery release of wtm includes a complete Software Bill of Materials (SBOM) that provides transparency about all dependencies used in the software:
- 📄 Format: SPDX 2.3 (ISO/IEC 5962:2021 compliant)
- 🔍 Transparency: Complete list of all direct and transitive dependencies
- 🛡️ Security: Automatic vulnerability tracking via GitHub Dependabot
- ⚖️ Compliance: License information for all components
- 📦 Availability: Attached to every GitHub release
# Download SBOM from latest release
VERSION=$(curl -s https://api.github.com/repos/kuju63/wt/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
curl -L https://github.com/kuju63/wt/releases/download/${VERSION}/wtm-${VERSION}-sbom.spdx.json \
-o wtm-sbom.spdx.json
# Or download a specific version
curl -L https://github.com/kuju63/wt/releases/download/v1.0.0/wtm-v1.0.0-sbom.spdx.json \
-o wtm-sbom.spdx.json# Install SPDX validator
npm install -g @spdx/spdx-validator
# Validate SBOM format
spdx-validator wtm-sbom.spdx.json# List all dependencies with versions
jq -r '.packages[] | "\(.name)@\(.versionInfo)"' wtm-sbom.spdx.json
# Check license information
jq -r '.packages[] | "\(.name): \(.licenseDeclared)"' wtm-sbom.spdx.jsonLearn more: See the SBOM Usage Guide for detailed information.
wt/
├── wt.cli/ # CLI application
│ ├── Commands/ # Command implementations
│ ├── Models/ # Data models
│ ├── Services/ # Business logic
│ └── Utils/ # Helper utilities
├── wt.tests/ # Unit and integration tests
└── specs/ # Feature specifications
dotnet testdotnet test --collect:"XPlat Code Coverage"Contributions are welcome! Please follow the development guidelines.
Built with:
- System.CommandLine - Modern command-line parsing
- xUnit - Testing framework
- FluentAssertions - Fluent assertion library