# Worktree Jump An Oh My Zsh plugin that lists Git worktrees in a compact table and lets you jump to one by typing its number at the next shell prompt. ## Features - Lists every worktree with its branch and path. - Returns immediately instead of keeping an interactive menu open. - Reuses Oh My Zsh's `1` through `9` directory-stack shortcuts. - Adds numeric shortcuts automatically when a repository has more than nine worktrees. - Handles detached worktrees and paths containing spaces. - Requires only Zsh, Git, and Oh My Zsh. - Optionally shows open pull requests as compact terminal hyperlinks when GitHub CLI is available. ## Installation Clone the repository into the Oh My Zsh custom plugins directory: ```zsh git clone https://github.com/Jermic/worktree-jump.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/worktree-jump" ``` Add `worktree-jump` to the plugins array in `~/.zshrc`: ```zsh plugins=( git worktree-jump ) ``` Reload the shell configuration: ```zsh source ~/.zshrc ``` ## Usage Run `wt` anywhere inside a Git repository: ```text # BRANCH WORKTREE 1 main ~/Projects/example 2 feature/search ~/.codex/worktrees/example-feature-search ``` After `wt` returns, type the displayed number as a command: ```zsh 2 ``` Running `wt` replaces the current Zsh directory stack with the repository's worktrees, so `d` will show the same directories afterward. To include each branch's open pull request, use either `-p` or `--pr`: ```zsh wt --pr ``` ```text # PR BRANCH WORKTREE 1 — main ~/Projects/example 2 #311 feature/search ~/.codex/worktrees/example-feature-search ``` The PR number is an OSC 8 terminal hyperlink. Clicking it opens the pull request in terminals that support hyperlinks. This mode requires an authenticated [GitHub CLI](https://cli.github.com/) installation; plain `wt` remains local and does not require `gh`. ## Updating ```zsh git -C "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/worktree-jump" pull --ff-only ``` ## Development Run the smoke test with: ```zsh zsh tests/smoke.zsh ``` ## License MIT