Commands
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: eval "$(wt shell-init zsh)" # in ~/.zshrc eval "$(wt shell-init bash)" # in ~/.bashrc
wt [command]
| flag | type | description | copy |
|---|---|---|---|
-v, --version | version for wt |
No flags match that filter.
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:
eval "$(wt shell-init zsh)" # in ~/.zshrc
eval "$(wt shell-init bash)" # in ~/.bashrc
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 the init script in the current worktree
list List all git worktrees
open Open a directory or worktree in an application
shell-init Output shell wrapper function for eval
skill Print the agent usage bundle (static markdown)
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 (or the value of --name, if given) on a new branch of the same name. When BRANCH is provided, it names a NEW branch to create (off --base, else HEAD). If that branch already exists locally or remotely, the command fails — use --checkout to put a worktree on an existing branch. --checkout <branch> checks out an EXISTING branch (local as-is, or remote-only fetched then checked out). --checkout cannot be combined with a positional branch argument or with --base.
wt create [branch] [flags]
| flag | type | description | copy |
|---|---|---|---|
--base | string | Git ref (branch, tag, SHA) to use as start-point for new branch | |
--checkout | string | Check out an EXISTING branch (local or remote) into the worktree instead of creating a new one | |
-n, --name | string | Set worktree name (skips name prompt) | |
--no-init | Skip the worktree init script (init runs by default) | ||
--non-interactive | No prompts; use defaults and skip menus | ||
-o, --open | string | After creation: prompt (menu), default (auto-detect app), skip, or an app name (e.g. code, cursor) | |
--reuse | Reuse existing worktree if name collides (requires --name) |
No flags match that filter.
show raw -h output
Create a git worktree for parallel development.
When BRANCH is omitted, creates an exploratory worktree with a random name (or
the value of --name, if given) on a new branch of the same name.
When BRANCH is provided, it names a NEW branch to create (off --base, else
HEAD). If that branch already exists locally or remotely, the command fails —
use --checkout to put a worktree on an existing branch.
--checkout <branch> checks out an EXISTING branch (local as-is, or remote-only
fetched then checked out). --checkout cannot be combined with a positional
branch argument or with --base.
Usage:
wt create [branch] [flags]
Aliases:
create, new
Flags:
--base string Git ref (branch, tag, SHA) to use as start-point for new branch
--checkout string Check out an EXISTING branch (local or remote) into the worktree instead of creating a new one
-h, --help help for create
-n, --name string Set worktree name (skips name prompt)
--no-init Skip the worktree init script (init runs by default)
--non-interactive No prompts; use defaults and skip menus
-o, --open string After creation: prompt (menu), default (auto-detect app), skip, or an app name (e.g. code, cursor)
--reuse Reuse existing worktree if name collides (requires --name)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, --all, positional args, --worktree-name (deprecated), current worktree, interactive selection. Pass --dry-run to preview what a real invocation would do — the exact worktrees, branches, and stash/discard actions — without making any change and without confirmation prompts. The preview shares the live decision path; only the mutations are suppressed.
wt delete [worktree-names...] [flags]
| flag | type | description | copy |
|---|---|---|---|
-a, --all | Delete all worktrees | ||
--branch | string | Delete the associated branch: true (always), false (never), auto (default — only if branch name matches worktree name) | |
--dry-run | Preview what would be deleted without making any change (no confirmation prompts) | ||
--no-remote | Do not delete the branch on the origin remote when the local branch is deleted (the remote branch is deleted by default) | ||
--non-interactive | No 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, --stash | Stash uncommitted changes before deleting |
No flags match that filter.
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, --all, positional args, --worktree-name (deprecated), current worktree, interactive selection.
Pass --dry-run to preview what a real invocation would do — the exact
worktrees, branches, and stash/discard actions — without making any change
and without confirmation prompts. The preview shares the live decision path;
only the mutations are suppressed.
Usage:
wt delete [worktree-names...] [flags]
Aliases:
delete, rm
Flags:
-a, --all Delete all worktrees
--branch string Delete the associated branch: true (always), false (never), auto (default — only if branch name matches worktree name)
--dry-run Preview what would be deleted without making any change (no confirmation prompts)
-h, --help help for delete
--no-remote Do not delete the branch on the origin remote when the local branch is deleted (the remote branch is deleted by default)
--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 deletingwt goSelect a worktree of the current repo and navigate there
Select a worktree of the current repository and navigate there. "wt go" and "wt open" split along two axes — selection (which directory) and action (navigate vs. launch). Each menu lives in exactly one verb: go owns the "which worktree?" menu, open owns the "which app?" menu. Compose the two with "wt go --open". When called without arguments, shows the worktree-selection menu for the current repo (main pinned to row 1, non-main 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; the name "main" resolves to the main worktree) and acts on it directly, with no worktree menu. By default the selection is navigated to: 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 zsh)") and the scripting form (cd "$(command wt go some-name)") work. With --open, the selection is launched instead of navigated to (mirroring "wt create --open"): --open prompt shows the "Open in:" app menu, --open default launches the auto-detected default app, --open <app> launches the named app (e.g. code, cursor, tmux_window), and --open skip is equivalent to a bare "wt go". A value is always required (no bare --open). Requires a git repository — worktree resolution walks the repo's worktree list.
wt go [name] [flags]
| flag | type | description | copy |
|---|---|---|---|
--non-interactive | No prompts; require a worktree name | ||
--open | string | After selection: prompt (app menu), default (auto-detect app), skip (navigate, the default), or an app name (e.g. code, cursor) |
No flags match that filter.
show raw -h output
Select a worktree of the current repository and navigate there.
"wt go" and "wt open" split along two axes — selection (which directory) and
action (navigate vs. launch). Each menu lives in exactly one verb: go owns the
"which worktree?" menu, open owns the "which app?" menu. Compose the two with
"wt go --open".
When called without arguments, shows the worktree-selection menu for the current
repo (main pinned to row 1, non-main 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; the name
"main" resolves to the main worktree) and acts on it directly, with no
worktree menu.
By default the selection is navigated to: 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 zsh)") and the scripting form
(cd "$(command wt go some-name)") work.
With --open, the selection is launched instead of navigated to (mirroring
"wt create --open"): --open prompt shows the "Open in:" app menu, --open default
launches the auto-detected default app, --open <app> launches the named app
(e.g. code, cursor, tmux_window), and --open skip is equivalent to a bare
"wt go". A value is always required (no bare --open).
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
--open string After selection: prompt (app menu), default (auto-detect app), skip (navigate, the default), or an app name (e.g. code, cursor)wt initRun the init script in the current worktree
Run the worktree init script for the current repository. If the init script doesn't exist, exits with guidance.
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).
wt list [flags]
| flag | type | description | copy |
|---|---|---|---|
--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) |
No flags match that filter.
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]
Aliases:
list, ls
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). "wt open" is the pure launcher half of the go/open split: go owns the "which worktree?" menu, open owns the "which app?" menu. To pick a worktree and then launch it, compose the two with "wt go --open". When called without arguments, opens the current context: the current worktree (inside a worktree), the repo root (in the main repo), or the current working directory (outside git). Path arguments are accepted regardless of git context. Worktree-name resolution requires a git repository. --app works with every form and skips the app menu. With --list, "wt open" prints the detected launchable host applications (editors, terminals, file managers) and exits — no menu, no launch, no git repository required. Add --json for a machine-readable JSON array of {id, label, kind} records; each id is accepted by "wt open <path> -a <id>".
wt open [name|path] [flags]
| flag | type | description | copy |
|---|---|---|---|
-a, --app | string | Open in specified app, skipping the menu | |
--json | With --list, output the app registry as a JSON array | ||
--list | List detected launchable apps instead of opening anything |
No flags match that filter.
show raw -h output
Open a directory in a detected application (editor, terminal, file manager).
"wt open" is the pure launcher half of the go/open split: go owns the "which
worktree?" menu, open owns the "which app?" menu. To pick a worktree and then
launch it, compose the two with "wt go --open".
When called without arguments, opens the current context: the current worktree
(inside a worktree), the repo root (in the main repo), or the current working
directory (outside git).
Path arguments are accepted regardless of git context. Worktree-name resolution
requires a git repository. --app works with every form and skips the app menu.
With --list, "wt open" prints the detected launchable host applications
(editors, terminals, file managers) and exits — no menu, no launch, no git
repository required. Add --json for a machine-readable JSON array of
{id, label, kind} records; each id is accepted by "wt open <path> -a <id>".
Usage:
wt open [name|path] [flags]
Flags:
-a, --app string Open in specified app, skipping the menu
-h, --help help for open
--json With --list, output the app registry as a JSON array
--list List detected launchable apps instead of opening anythingwt shell-initOutput shell wrapper function for eval
Output a shell wrapper function suitable for eval in your shell profile.
eval "$(wt shell-init zsh)" # in ~/.zshrceval "$(wt shell-init bash)" # in ~/.bashrcAdd the matching line to your shell profile to enable the "Open here"menu option, which changes the current shell's working directory to theselected worktree.The shell argument is required (zsh or bash). Everything on stdout iseval-safe shell source; a missing or unsupported shell is a usage error(exit 2, message on stderr, nothing on stdout).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 zsh)" # in ~/.zshrc eval "$(wt shell-init bash)" # in ~/.bashrc Add the matching line to your shell profile to enable the "Open here" menu option, which changes the current shell's working directory to the selected worktree. The shell argument is required (zsh or bash). Everything on stdout is eval-safe shell source; a missing or unsupported shell is a usage error (exit 2, message on stderr, nothing on stdout). Usage: wt shell-init <shell> [flags] Flags: -h, --help help for shell-init
wt skillPrint the agent usage bundle (static markdown)
Print the agent usage bundle (static markdown)
wt skill [flags]
show raw -h output
Print the agent usage bundle (static markdown) Usage: wt skill [flags] Flags: -h, --help help for skill
wt updateSelf-update the wt binary via Homebrew
Self-update the wt binary via Homebrew
wt update [flags]
| flag | type | description | copy |
|---|---|---|---|
--no-brew-update | alias for --skip-brew-update | ||
--skip-brew-updatebrew update | skip the internal brew update tap-metadata refresh (toolkit contract flag; version check and upgrade still run) |
No flags match that filter.
show raw -h output
Self-update the wt binary via Homebrew
Usage:
wt update [flags]
Flags:
-h, --help help for update
--no-brew-update alias for --skip-brew-update
--skip-brew-update brew update skip the internal brew update tap-metadata refresh (toolkit contract flag; version check and upgrade still run)