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 (~/.bashrc or ~/.zshrc): eval "$(wt shell-init)"
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 (~/.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.
wt create [branch] [flags]
| flag | type | description | copy |
|---|---|---|---|
--base | string | Git ref (branch, tag, SHA) to use as start-point for new branch | |
--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' |
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.
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.
wt delete [worktree-names...] [flags]
| flag | type | description | copy |
|---|---|---|---|
--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 | |
--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, --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 deletingwt initRun worktree init script
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]
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.
wt open [name|path] [flags]
| flag | type | description | copy |
|---|---|---|---|
--app | string | Open in specified app, skipping the menu |
No flags match that filter.
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 openwt shell-initOutput shell wrapper function for eval
Output a shell wrapper function suitable for eval in your shell profile.
eval "$(wt shell-init)" # infer shell from $SHELLeval "$(wt shell-init zsh)" # explicit shell nameAdd the above line to your ~/.bashrc or ~/.zshrc to enable the "Open here"menu option, which changes the current shell's working directory to theselected 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
wt update [flags]
| flag | type | description | copy |
|---|---|---|---|
--skip-brew-updatebrew update | skip the internal brew update tap-metadata refresh (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
--skip-brew-update brew update skip the internal brew update tap-metadata refresh (version check and upgrade still run)