Skip to content

Latest commit

 

History

History
140 lines (104 loc) · 3.22 KB

File metadata and controls

140 lines (104 loc) · 3.22 KB

Installation

Homebrew (macOS and Linux)

brew install timvw/tap/wt
wt init  # Configure shell integration

Scoop (Windows)

scoop bucket add timvw https://github.com/timvw/scoop-bucket
scoop install wt
wt init  # Configure shell integration

WinGet (Windows)

winget install timvw.wt
wt init  # Configure shell integration

Nix

# Run without installing
nix run github:timvw/wt -- version

# Install to your profile
nix profile install github:timvw/wt
wt init  # Configure shell integration

The installed wt binary bundles git in its runtime path. The shell integration (wt init) runs in your interactive shell, however, and calls git (completions) and script(1) (PTY for interactive commands) directly, so make sure both are on your PATH: git, plus util-linux for script(1) on Linux (on macOS script ships with the base system).

For NixOS or home-manager, add wt as a flake input and reference its package in your modules (it is not part of nixpkgs, so pkgs.wt will not resolve):

# flake.nix
{
  inputs.wt.url = "github:timvw/wt";

  outputs = { self, nixpkgs, wt, ... }: {
    nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ({ pkgs, ... }: {
          # NixOS
          environment.systemPackages = [ wt.packages.${pkgs.system}.default ];
          # home-manager equivalent:
          # home.packages = [ wt.packages.${pkgs.system}.default ];
        })
      ];
    };
  };
}

Linux Packages

Download .deb, .rpm, or .pkg.tar.zst packages from the releases page.

# Debian/Ubuntu
sudo dpkg -i wt_*.deb

# Fedora/RHEL
sudo rpm -i wt_*.rpm

# Arch Linux (AUR)
yay -S wt-bin

Shell integration is automatically configured during package installation.

From Source

go install github.com/timvw/wt@latest
wt init  # Configure shell integration

Or clone and build:

git clone https://github.com/timvw/wt.git
cd wt

# Using just (recommended)
just build            # builds to bin/wt
just install          # installs to /usr/local/bin (requires sudo)
just install-user     # installs to ~/bin (no sudo)

# Or build directly with go
mkdir -p bin
go build -o bin/wt .
sudo cp bin/wt /usr/local/bin/

# Configure shell integration
wt init

Shell Integration

The wt init command automatically configures shell integration for your shell:

wt init              # Auto-detect shell and configure
wt init bash         # Configure for bash specifically
wt init zsh          # Configure for zsh specifically
wt init --dry-run    # Preview changes without modifying files
wt init --uninstall  # Remove wt configuration from shell

After running wt init, restart your shell or run:

source ~/.bashrc   # for bash
source "${ZDOTDIR:-$HOME}/.zshrc"    # for zsh

Shell integration enables:

  • Automatic cd to worktree after checkout/create/pr/mr commands
  • Tab completion for commands and branch names

Manual setup (alternative to wt init): Add this to the END of your shell config:

eval "$(wt shellenv)"

Note for zsh users: Place this after compinit in your config file.