Skip to content

Commands

wt v0.0.23 · captured 2026-07-16

-h/--help work on every command; -v/--version at the tool root.

wtGit worktree management — create, list, open, delete worktrees

Git worktree management — create, list, open, delete worktrees. Shell wrapper (recommended): To enable the "Open here" menu option (cd into a worktree in the current shell), add this to your shell profile (~/.bashrc or ~/.zshrc): eval "$(wt shell-init)"

usage
  • wt [command]
flags
flagtypedescriptioncopy
-v, --versionversion for wt
show raw -h output
Git worktree management — create, list, open, delete worktrees.

Shell wrapper (recommended):
  To enable the "Open here" menu option (cd into a worktree in the current
  shell), add this to your shell profile (~/.bashrc or ~/.zshrc):

    eval "$(wt shell-init)"

Usage:
  wt [command]

Available Commands:
  create      Create a git worktree
  delete      Delete a git worktree
  go          Select a worktree of the current repo and navigate there
  init        Run worktree init script
  list        List all git worktrees
  open        Open a directory or worktree in an application
  shell-init  Output shell wrapper function for eval
  update      Self-update the wt binary via Homebrew

Flags:
  -h, --help      help for wt
  -v, --version   version for wt

Use "wt [command] --help" for more information about a command.
wt createCreate a git worktree

Create a git worktree for parallel development. When BRANCH is omitted, creates an exploratory worktree with a random name. When BRANCH is provided, checks out that branch (fetching from remote if needed) or creates a new branch.

usage
  • wt create [branch] [flags]
flags
flagtypedescriptioncopy
--basestringGit ref (branch, tag, SHA) to use as start-point for new branch
--non-interactiveNo prompts; use defaults and skip menus
--reuseReuse existing worktree if name collides (requires --worktree-name)
--worktree-initstringRun worktree init script: true (default) or false
--worktree-namestringSet worktree name (skips name prompt)
--worktree-openstringAfter creation: prompt (menu), default (auto-detect app), skip, or an app name (e.g. code, cursor)
show raw -h output
Create a git worktree for parallel development.

When BRANCH is omitted, creates an exploratory worktree with a random name.
When BRANCH is provided, checks out that branch (fetching from remote if needed)
or creates a new branch.

Usage:
  wt create [branch] [flags]

Flags:
      --base string            Git ref (branch, tag, SHA) to use as start-point for new branch
  -h, --help                   help for create
      --non-interactive        No prompts; use defaults and skip menus
      --reuse                  Reuse existing worktree if name collides (requires --worktree-name)
      --worktree-init string   Run worktree init script: true (default) or false
      --worktree-name string   Set worktree name (skips name prompt)
      --worktree-open string   After creation: prompt (menu), default (auto-detect app), skip, or an app name (e.g. code, cursor)
wt deleteDelete a git worktree

Delete one or more git worktrees with optional branch cleanup. Positional arguments are interpreted as worktree names to delete. Resolution order: --stale, --delete-all, positional args, --worktree-name (deprecated), current worktree, interactive selection.

usage
  • wt delete [worktree-names...] [flags]
flags
flagtypedescriptioncopy
--delete-allDelete all worktrees
--delete-branchstringDelete the associated branch: true (always), false (never), auto (default — only if branch name matches worktree name)
--delete-remotestringDelete the branch on the origin remote (via git push origin --delete) when the local branch is deleted (true by default)
--non-interactiveNo prompts, use defaults
--stalestring[="7d"]Select idle worktrees (filesystem mtime older than the threshold) for deletion. Bare --stale uses the 7d default; --stale=Nd overrides (e.g. --stale=30d). The '=' is required.
-s, --stashStash uncommitted changes before deleting
show raw -h output
Delete one or more git worktrees with optional branch cleanup.

Positional arguments are interpreted as worktree names to delete.
Resolution order: --stale, --delete-all, positional args, --worktree-name (deprecated), current worktree, interactive selection.

Usage:
  wt delete [worktree-names...] [flags]

Flags:
      --delete-all             Delete all worktrees
      --delete-branch string   Delete the associated branch: true (always), false (never), auto (default — only if branch name matches worktree name)
      --delete-remote string   Delete the branch on the origin remote (via git push origin --delete) when the local branch is deleted (true by default)
  -h, --help                   help for delete
      --non-interactive        No prompts, use defaults
      --stale string[="7d"]    Select idle worktrees (filesystem mtime older than the threshold) for deletion. Bare --stale uses the 7d default; --stale=Nd overrides (e.g. --stale=30d). The '=' is required.
  -s, --stash                  Stash uncommitted changes before deleting
wt goSelect a worktree of the current repo and navigate there

Select a worktree of the current repository and navigate there. Unlike "wt open", "wt go" does not launch any application — it only changes the shell's working directory to the selected worktree (open=launcher, go=selector). When called without arguments, shows a worktree-selection menu for the current repo (newest-first, branch shown per entry). The menu is reachable from anywhere in the repository — the main repo or inside another worktree. When called with a name, resolves it as a worktree (case-insensitive) and navigates there directly, with no menu. Navigation reuses the same shell-cd plumbing as the "Open here" launcher option: the resolved absolute path is written to WT_CD_FILE (when set) and also printed to stdout as the last line, so both the shell wrapper (eval "$(wt shell-init)") and the scripting form (cd "$(command wt go some-name)") work. Requires a git repository — worktree resolution walks the repo's worktree list.

usage
  • wt go [name] [flags]
flags
flagtypedescriptioncopy
--non-interactiveNo prompts; require a worktree name
show raw -h output
Select a worktree of the current repository and navigate there.

Unlike "wt open", "wt go" does not launch any application — it only changes the
shell's working directory to the selected worktree (open=launcher, go=selector).

When called without arguments, shows a worktree-selection menu for the current
repo (newest-first, branch shown per entry). The menu is reachable from anywhere
in the repository — the main repo or inside another worktree.

When called with a name, resolves it as a worktree (case-insensitive) and
navigates there directly, with no menu.

Navigation reuses the same shell-cd plumbing as the "Open here" launcher option:
the resolved absolute path is written to WT_CD_FILE (when set) and also printed
to stdout as the last line, so both the shell wrapper (eval "$(wt shell-init)")
and the scripting form (cd "$(command wt go some-name)") work.

Requires a git repository — worktree resolution walks the repo's worktree list.

Usage:
  wt go [name] [flags]

Flags:
  -h, --help              help for go
      --non-interactive   No prompts; require a worktree name
wt initRun worktree init script

Run the worktree init script for the current repository. If the init script doesn't exist, exits with guidance.

usage
  • wt init [flags]
show raw -h output
Run the worktree init script for the current repository.
If the init script doesn't exist, exits with guidance.

Usage:
  wt init [flags]

Flags:
  -h, --help   help for init
wt listList all git worktrees

List all git worktrees for the current repository. The current worktree is marked with a green asterisk (*). By default, output shows Name, Branch, and Path only — no per-worktree git invocations occur, so the command is O(1) regardless of worktree count. Pass --status to enable dirty/unpushed enrichment; this is the slower mode because it forks 2 git subprocesses per worktree (parallelized).

usage
  • wt list [flags]
flags
flagtypedescriptioncopy
--jsonOutput worktree data as a JSON array
--non-interactiveUse stable (name) default ordering for scripts
--pathstringOutput just the absolute path for a named worktree
--sortstringOrder non-main worktrees by: recent, name, or branch
--statusShow dirty/unpushed status for each worktree (slower)
show raw -h output
List all git worktrees for the current repository.

The current worktree is marked with a green asterisk (*).

By default, output shows Name, Branch, and Path only — no per-worktree git
invocations occur, so the command is O(1) regardless of worktree count. Pass
--status to enable dirty/unpushed enrichment; this is the slower mode because
it forks 2 git subprocesses per worktree (parallelized).

Usage:
  wt list [flags]

Flags:
  -h, --help              help for list
      --json              Output worktree data as a JSON array
      --non-interactive   Use stable (name) default ordering for scripts
      --path string       Output just the absolute path for a named worktree
      --sort string       Order non-main worktrees by: recent, name, or branch
      --status            Show dirty/unpushed status for each worktree (slower)
wt openOpen a directory or worktree in an application

Open a directory in a detected application (editor, terminal, file manager). When called without arguments from a worktree, opens the current worktree. When called without arguments from the main repo, shows a worktree-selection menu. When called without arguments from a non-git directory, opens the current working directory. Path arguments are accepted regardless of git context. Worktree-name resolution requires a git repository. With --go, "wt open" first performs "wt go"'s worktree selection (a menu when no name is given, or resolve-by-name when a name is given) and then launches the selected worktree — composing the selector and the launcher. --go requires a git repository and composes with --app.

usage
  • wt open [name|path] [flags]
flags
flagtypedescriptioncopy
--appstringOpen in specified app, skipping the menu
--goSelect a worktree (menu or by name) first, then launch it
show raw -h output
Open a directory in a detected application (editor, terminal, file manager).

When called without arguments from a worktree, opens the current worktree.
When called without arguments from the main repo, shows a worktree-selection menu.
When called without arguments from a non-git directory, opens the current working directory.

Path arguments are accepted regardless of git context. Worktree-name resolution
requires a git repository.

With --go, "wt open" first performs "wt go"'s worktree selection (a menu when no
name is given, or resolve-by-name when a name is given) and then launches the
selected worktree — composing the selector and the launcher. --go requires a git
repository and composes with --app.

Usage:
  wt open [name|path] [flags]

Flags:
      --app string   Open in specified app, skipping the menu
      --go           Select a worktree (menu or by name) first, then launch it
  -h, --help         help for open
wt shell-initOutput shell wrapper function for eval

Output a shell wrapper function suitable for eval in your shell profile.

usage
  • eval "$(wt shell-init)" # infer shell from $SHELL
  • eval "$(wt shell-init zsh)" # explicit shell name
  • Add the above line to your ~/.bashrc or ~/.zshrc to enable the "Open here"
  • menu option, which changes the current shell's working directory to the
  • selected worktree.
  • wt shell-init [shell] [flags]
show raw -h output
Output a shell wrapper function suitable for eval in your shell profile.

Usage:
  eval "$(wt shell-init)"        # infer shell from $SHELL
  eval "$(wt shell-init zsh)"    # explicit shell name

Add the above line to your ~/.bashrc or ~/.zshrc to enable the "Open here"
menu option, which changes the current shell's working directory to the
selected worktree.

Usage:
  wt shell-init [shell] [flags]

Flags:
  -h, --help   help for shell-init
wt updateSelf-update the wt binary via Homebrew

Self-update the wt binary via Homebrew

usage
  • wt update [flags]
flags
flagtypedescriptioncopy
--skip-brew-updatebrew updateskip the internal brew update tap-metadata refresh (version check and upgrade still run)
show raw -h output
Self-update the wt binary via Homebrew

Usage:
  wt update [flags]

Flags:
  -h, --help                           help for update
      --skip-brew-update brew update   skip the internal brew update tap-metadata refresh (version check and upgrade still run)