Skip to content

Commands

-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
  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, porcelain output
--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-openstringOpen in app after creation, or 'skip'
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, porcelain output
      --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   Open in app after creation, or 'skip'
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 associated branch: true, false, or auto (default: auto — deletes only when branch matches worktree name)
--delete-remotestringDelete remote branch: true (default) or false
--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 associated branch: true, false, or auto (default: auto — deletes only when branch matches worktree name)
      --delete-remote string   Delete remote branch: true (default) or false
  -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 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.

usage
  • wt open [name|path] [flags]
flags
flagtypedescriptioncopy
--appstringOpen in specified app, skipping the menu
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.

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

Flags:
      --app string   Open in specified app, skipping the menu
  -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)