Skip to content

hoangbits/wt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Worktree Manager (wt)

A Rust CLI tool that makes working with git worktrees easier and more intuitive.

Features

  • 🔍 List all worktrees with colorful, easy-to-read output
  • Create new worktrees with interactive prompts
  • 🔄 Switch between worktrees with a simple selection menu
  • 🗑️ Remove worktrees safely with confirmation
  • ℹ️ Info about current worktree status

Installation

Quick Install (Recommended)

Install the latest release with one command:

curl -sSL https://github.com/hoangbits/wt/raw/main/install.sh | sh

This script:

  • Detects your platform (Linux, macOS, Windows)
  • Downloads the correct prebuilt binary
  • Installs to ~/.local/bin/wt
  • Shows instructions for adding to PATH if needed

Manual Download

Download prebuilt binaries from GitHub Releases:

  • Linux (x86_64): wt-x86_64-unknown-linux-gnu.tar.gz
  • macOS Intel: wt-x86_64-apple-darwin.tar.gz
  • macOS Apple Silicon: wt-aarch64-apple-darwin.tar.gz
  • Windows: wt-x86_64-pc-windows-msvc.zip

Extract and place the wt binary somewhere in your PATH.

Install from Source

For Rust developers:

# From crates.io (when published)
cargo install wt

# From GitHub
cargo install --git https://github.com/hoangbits/wt.git

# Local build
git clone https://github.com/hoangbits/wt.git
cd wt
cargo build --release
cp target/release/wt /usr/local/bin/

Usage

List all worktrees

wt list

Create a new worktree

# Interactive mode
wt new

# With specific branch and directory
wt new -b feature/new-feature -d ../project-feature

# Create new branch
wt new -b new-feature-branch

Switch to another worktree

wt switch

Remove a worktree

wt remove

Show current worktree info

wt info

Why use wt instead of git worktree?

Better UX

# git worktree: remember syntax, paths, and options
git worktree add -b feature-login ../project-login
cd ../project-login

# wt: interactive prompts guide you
wt new

Visual feedback

The default git worktree list output is hard to parse. wt list shows:

  • Which worktree you're currently in
  • Color-coded branches and paths
  • Shortened commit hashes
  • Clean, numbered format

Safety

  • Prevents removing the current worktree
  • Confirms before deletion
  • Validates branch names
  • Shows exactly what will happen

Less typing

  • wt switch vs cd /long/path/to/worktree
  • wt new vs remembering all the git worktree flags
  • wt remove vs git worktree remove /path

Example Workflow

# See what you have
wt list

# Start new feature
wt new
# Prompts guide you through branch/directory setup

# Switch between features  
wt switch
# Pick from a menu instead of remembering paths

# Clean up when done
wt remove
# Select from list, confirm deletion

Dependencies

  • clap - Command line argument parsing
  • dialoguer - Interactive prompts and menus
  • colored - Colorful terminal output
  • anyhow - Error handling
  • serde & serde_json - Data serialization

Building

cargo build --release

Testing

cargo test

About

Git worktree manager with better UX

Resources

Stars

Watchers

Forks

Packages

No packages published