Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat(switch): integrate interactive picker into `wt switch` (#894)

Maximilian Roos0c9e0205a3b7
diff --git a/.claude-plugin/skills/worktrunk/reference/config.md b/.claude-plugin/skills/worktrunk/reference/config.md
index bb7f6ab5f..6c2cd0a43 100644
--- a/.claude-plugin/skills/worktrunk/reference/config.md
+++ b/.claude-plugin/skills/worktrunk/reference/config.md
@@ -139,7 +139,7 @@ verify = true # Run project hooks (--no-verify to skip)
### Select
-Pager behavior for `wt select` diff previews.
+Pager behavior for `wt switch` interactive picker diff previews.
```toml
[select]
diff --git a/.claude-plugin/skills/worktrunk/reference/select.md b/.claude-plugin/skills/worktrunk/reference/select.md
deleted file mode 100644
index e635c855a..000000000
--- a/.claude-plugin/skills/worktrunk/reference/select.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# wt select
-
-Interactive worktree selector. Browse and switch worktrees with live preview.
-
-## Examples
-
-Open the selector:
-
-```bash
-wt select
-```
-
-## Preview tabs
-
-Toggle between views with number keys:
-
-1. **HEAD±** — Diff of uncommitted changes
-2. **log** — Recent commits; commits already on the default branch have dimmed hashes
-3. **main…±** — Diff of changes since the merge-base with the default branch
-4. **remote⇅** — Diff vs upstream tracking branch (ahead/behind)
-
-## Keybindings
-
-| Key | Action |
-|-----|--------|
-| `↑`/`↓` | Navigate worktree list |
-| `Enter` | Switch to selected worktree |
-| `Esc` | Cancel |
-| (type) | Filter worktrees |
-| `1`/`2`/`3`/`4` | Switch preview tab |
-| `Alt-p` | Toggle preview panel |
-| `Ctrl-u`/`Ctrl-d` | Scroll preview up/down |
-
-With `--branches`, branches without worktrees are included — selecting one creates a worktree. This matches `wt list --branches`.
-
-## Configuration
-
-### Pager
-
-The preview panel pipes diff output through git's pager (typically `less` or `delta`). Override pager behavior in user config:
-
-```toml
-[select]
-pager = "delta --paging=never"
-```
-
-This is useful when the default pager doesn't render correctly in the embedded preview panel.
-
-## Command reference
-
-wt select - Interactive worktree selector
-
-Browse and switch worktrees with live preview.
-
-Usage: <b><span class=c>wt select</span></b> <span class=c>[OPTIONS]</span>
-
-<b><span class=g>Options:</span></b>
- <b><span class=c>--branches</span></b>
- Include branches without worktrees
-
- <b><span class=c>--remotes</span></b>
- Include remote branches
-
- <b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
- Print help (see a summary with &#39;-h&#39;)
-
-<b><span class=g>Global Options:</span></b>
- <b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
- Working directory for this command
-
- <b><span class=c>--config</span></b><span class=c> &lt;path&gt;</span>
- User config file path
-
- <b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/.claude-plugin/skills/worktrunk/reference/switch.md b/.claude-plugin/skills/worktrunk/reference/switch.md
index af005cf29..64f96cf76 100644
--- a/.claude-plugin/skills/worktrunk/reference/switch.md
+++ b/.claude-plugin/skills/worktrunk/reference/switch.md
@@ -58,6 +58,38 @@ wt switch pr:123 # PR #123's branch
wt switch mr:101 # MR !101's branch
```
+## Interactive picker
+
+When called without arguments, `wt switch` opens an interactive picker to browse and select worktrees with live preview. The picker requires a TTY.
+
+**Keybindings:**
+
+| Key | Action |
+|-----|--------|
+| `↑`/`↓` | Navigate worktree list |
+| `Enter` | Switch to selected worktree |
+| `Esc` | Cancel |
+| (type) | Filter worktrees |
+| `1`/`2`/`3`/`4` | Switch preview tab |
+| `Alt-p` | Toggle preview panel |
+| `Ctrl-u`/`Ctrl-d` | Scroll preview up/down |
+
+**Preview tabs** (toggle with number keys):
+
+1. **HEAD±** — Diff of uncommitted changes
+2. **log** — Recent commits; commits already on the default branch have dimmed hashes
+3. **main…±** — Diff of changes since the merge-base with the default branch
+4. **remote⇅** — Diff vs upstream tracking branch (ahead/behind)
+
+**Pager configuration:** The preview panel pipes diff output through git's pager. Override in user config:
+
+```toml
+[select]
+pager = "delta --paging=never"
+```
+
+Available on Unix only (macOS, Linux). On Windows, use `wt list` or `wt switch <branch>` directly.
+
## GitHub pull requests (experimental)
The `pr:<number>` syntax resolves the branch for a GitHub pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches `refs/pull/N/head` and configures `pushRemote` to the fork URL.
@@ -96,14 +128,15 @@ wt switch - Switch to a worktree
Creates one if needed.
-Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <span class=c>&lt;BRANCH&gt;</span> <b><span class=c>[--</span></b> <span class=c>&lt;EXECUTE_ARGS&gt;...</span><b><span class=c>]</span></b>
+Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <span class=c>[BRANCH]</span> <b><span class=c>[--</span></b> <span class=c>&lt;EXECUTE_ARGS&gt;...</span><b><span class=c>]</span></b>
<b><span class=g>Arguments:</span></b>
- <span class=c>&lt;BRANCH&gt;</span>
+ <span class=c>[BRANCH]</span>
Branch name or shortcut
- Shortcuts: &#39;^&#39; (default branch), &#39;-&#39; (previous), &#39;@&#39; (current),
- &#39;pr:{N}&#39; (GitHub PR), &#39;mr:{N}&#39; (GitLab MR)
+ Opens interactive picker if omitted. Shortcuts: &#39;^&#39; (default branch),
+ &#39;-&#39; (previous), &#39;@&#39; (current), &#39;pr:{N}&#39; (GitHub PR), &#39;mr:{N}&#39; (GitLab
+ MR)
<span class=c>[EXECUTE_ARGS]...</span>
Additional arguments for --execute command (after --)
@@ -112,6 +145,12 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
is expanded for templates, then POSIX shell-escaped.
<b><span class=g>Options:</span></b>
+ <b><span class=c>--branches</span></b>
+ Include branches without worktrees (interactive picker)
+
+ <b><span class=c>--remotes</span></b>
+ Include remote branches (interactive picker)
+
<b><span class=c>-c</span></b>, <b><span class=c>--create</span></b>
Create a new branch
diff --git a/.claude-plugin/skills/worktrunk/reference/worktrunk.md b/.claude-plugin/skills/worktrunk/reference/worktrunk.md
index c2500dc3a..fb3d22261 100644
--- a/.claude-plugin/skills/worktrunk/reference/worktrunk.md
+++ b/.claude-plugin/skills/worktrunk/reference/worktrunk.md
@@ -168,8 +168,8 @@ The `-x` flag runs a command after switching; arguments after `--` are passed to
- Learn the core commands: [`wt switch`](https://worktrunk.dev/switch/), [`wt list`](https://worktrunk.dev/list/), [`wt merge`](https://worktrunk.dev/merge/), [`wt remove`](https://worktrunk.dev/remove/)
- Set up [project hooks](https://worktrunk.dev/hook/) for automated setup
-- Explore [LLM commit messages](https://worktrunk.dev/llm-commits/), [fzf-like
- selector](https://worktrunk.dev/select/), [Claude Code integration](https://worktrunk.dev/claude-code/), [CI
+- Explore [LLM commit messages](https://worktrunk.dev/llm-commits/), [interactive
+ picker](https://worktrunk.dev/switch/#interactive-picker), [Claude Code integration](https://worktrunk.dev/claude-code/), [CI
status & PR links](https://worktrunk.dev/list/#ci-status)
- Run `wt --help` or `wt <command> --help` for quick CLI reference
diff --git a/README.md b/README.md
index 69b2da0ba..d34966fbd 100644
--- a/README.md
+++ b/README.md
@@ -197,8 +197,8 @@ The `-x` flag runs a command after switching; arguments after `--` are passed to
- Learn the core commands: [`wt switch`](https://worktrunk.dev/switch/), [`wt list`](https://worktrunk.dev/list/), [`wt merge`](https://worktrunk.dev/merge/), [`wt remove`](https://worktrunk.dev/remove/)
- Set up [project hooks](https://worktrunk.dev/hook/) for automated setup
-- Explore [LLM commit messages](https://worktrunk.dev/llm-commits/), [fzf-like
- selector](https://worktrunk.dev/select/), [Claude Code integration](https://worktrunk.dev/claude-code/), [CI
+- Explore [LLM commit messages](https://worktrunk.dev/llm-commits/), [interactive
+ picker](https://worktrunk.dev/switch/#interactive-picker), [Claude Code integration](https://worktrunk.dev/claude-code/), [CI
status & PR links](https://worktrunk.dev/list/#ci-status)
- Run `wt --help` or `wt <command> --help` for quick CLI reference
diff --git a/dev/config.example.toml b/dev/config.example.toml
index f72a19978..cba2fbe42 100644
--- a/dev/config.example.toml
+++ b/dev/config.example.toml
@@ -72,7 +72,7 @@
#
# ### Select
#
-# Pager behavior for `wt select` diff previews.
+# Pager behavior for `wt switch` interactive picker diff previews.
#
# [select]
# # Pager command with flags for diff preview (overrides git's core.pager)
diff --git a/docs/content/config.md b/docs/content/config.md
index 8b67163de..c9af92894 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -147,7 +147,7 @@ verify = true # Run project hooks (--no-verify to skip)
### Select
-Pager behavior for `wt select` diff previews.
+Pager behavior for `wt switch` interactive picker diff previews.
```toml
[select]
diff --git a/docs/content/list.md b/docs/content/list.md
index 4e490458d..c4d139b9f 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -274,7 +274,7 @@ Missing a field that would be generally useful? [Open an issue](https://github.c
## See also
-- [`wt select`](@/select.md) — Interactive worktree picker with live preview
+- [`wt switch`](@/switch.md) — Switch worktrees or open interactive picker
## Command reference
diff --git a/docs/content/select.md b/docs/content/select.md
deleted file mode 100644
index 71f2deede..000000000
--- a/docs/content/select.md
+++ /dev/null
@@ -1,101 +0,0 @@
-+++
-title = "wt select"
-weight = 14
-
-[extra]
-group = "Commands"
-+++
-
-<!-- ⚠️ AUTO-GENERATED from `wt select --help-page` — edit cli.rs to update -->
-
-Interactive worktree selector. Browse and switch worktrees with live preview.
-
-<figure class="demo">
-<picture>
- <source srcset="/assets/docs/dark/wt-select.gif" media="(prefers-color-scheme: dark)">
- <img src="/assets/docs/light/wt-select.gif" alt="wt select demo" width="1600" height="800">
-</picture>
-</figure>
-
-## Examples
-
-Open the selector:
-
-```bash
-wt select
-```
-
-## Preview tabs
-
-Toggle between views with number keys:
-
-1. **HEAD±** — Diff of uncommitted changes
-2. **log** — Recent commits; commits already on the default branch have dimmed hashes
-3. **main…±** — Diff of changes since the merge-base with the default branch
-4. **remote⇅** — Diff vs upstream tracking branch (ahead/behind)
-
-## Keybindings
-
-| Key | Action |
-|-----|--------|
-| `↑`/`↓` | Navigate worktree list |
-| `Enter` | Switch to selected worktree |
-| `Esc` | Cancel |
-| (type) | Filter worktrees |
-| `1`/`2`/`3`/`4` | Switch preview tab |
-| `Alt-p` | Toggle preview panel |
-| `Ctrl-u`/`Ctrl-d` | Scroll preview up/down |
-
-With `--branches`, branches without worktrees are included — selecting one creates a worktree. This matches `wt list --branches`.
-
-## Configuration
-
-### Pager
-
-The preview panel pipes diff output through git's pager (typically `less` or `delta`). Override pager behavior in user config:
-
-```toml
-[select]
-pager = "delta --paging=never"
-```
-
-This is useful when the default pager doesn't render correctly in the embedded preview panel.
-
-## See also
-
-- [`wt list`](@/list.md) — Static table view with all worktree metadata
-- [`wt switch`](@/switch.md) — Direct switching to a known target branch
-
-Available on Unix only (macOS, Linux). On Windows, use `wt list` or `wt switch` directly.
-
-## Command reference
-
-{% terminal() %}
-wt select - Interactive worktree selector
-
-Browse and switch worktrees with live preview.
-
-Usage: <b><span class=c>wt select</span></b> <span class=c>[OPTIONS]</span>
-
-<b><span class=g>Options:</span></b>
- <b><span class=c>--branches</span></b>
- Include branches without worktrees
-
- <b><span class=c>--remotes</span></b>
- Include remote branches
-
- <b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
- Print help (see a summary with &#39;-h&#39;)
-
-<b><span class=g>Global Options:</span></b>
- <b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
- Working directory for this command
-
- <b><span class=c>--config</span></b><span class=c> &lt;path&gt;</span>
- User config file path
-
- <b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: hooks, templates; -vv: debug report)
-{% end %}
-
-<!-- END AUTO-GENERATED from `wt select --help-page` -->
diff --git a/docs/content/switch.md b/docs/content/switch.md
index d1d8e2362..aeda1fd8b 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -73,6 +73,45 @@ wt switch pr:123 # PR #123's branch
wt switch mr:101 # MR !101's branch
```
+## Interactive picker
+
+When called without arguments, `wt switch` opens an interactive picker to browse and select worktrees with live preview. The picker requires a TTY.
+
+<figure class="demo">
+<picture>
+ <source srcset="/assets/docs/dark/wt-select.gif" media="(prefers-color-scheme: dark)">
+ <img src="/assets/docs/light/wt-select.gif" alt="wt select demo" width="1600" height="800">
+</picture>
+</figure>
+
+**Keybindings:**
+
+| Key | Action |
+|-----|--------|
+| `↑`/`↓` | Navigate worktree list |
+| `Enter` | Switch to selected worktree |
+| `Esc` | Cancel |
+| (type) | Filter worktrees |
+| `1`/`2`/`3`/`4` | Switch preview tab |
+| `Alt-p` | Toggle preview panel |
+| `Ctrl-u`/`Ctrl-d` | Scroll preview up/down |
+
+**Preview tabs** (toggle with number keys):
+
+1. **HEAD±** — Diff of uncommitted changes
+2. **log** — Recent commits; commits already on the default branch have dimmed hashes
+3. **main…±** — Diff of changes since the merge-base with the default branch
+4. **remote⇅** — Diff vs upstream tracking branch (ahead/behind)
+
+**Pager configuration:** The preview panel pipes diff output through git's pager. Override in user config:
+
+```toml
+[select]
+pager = "delta --paging=never"
+```
+
+Available on Unix only (macOS, Linux). On Windows, use `wt list` or `wt switch <branch>` directly.
+
## GitHub pull requests (experimental)
The `pr:<number>` syntax resolves the branch for a GitHub pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches `refs/pull/N/head` and configures `pushRemote` to the fork URL.
@@ -107,7 +146,6 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
## See also
-- [`wt select`](@/select.md) — Interactive worktree selection
- [`wt list`](@/list.md) — View all worktrees
- [`wt remove`](@/remove.md) — Delete worktrees when done
- [`wt merge`](@/merge.md) — Integrate changes back to the default branch
@@ -119,14 +157,15 @@ wt switch - Switch to a worktree
Creates one if needed.
-Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <span class=c>&lt;BRANCH&gt;</span> <b><span class=c>[--</span></b> <span class=c>&lt;EXECUTE_ARGS&gt;...</span><b><span class=c>]</span></b>
+Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <span class=c>[BRANCH]</span> <b><span class=c>[--</span></b> <span class=c>&lt;EXECUTE_ARGS&gt;...</span><b><span class=c>]</span></b>
<b><span class=g>Arguments:</span></b>
- <span class=c>&lt;BRANCH&gt;</span>
+ <span class=c>[BRANCH]</span>
Branch name or shortcut
- Shortcuts: &#39;^&#39; (default branch), &#39;-&#39; (previous), &#39;@&#39; (current),
- &#39;pr:{N}&#39; (GitHub PR), &#39;mr:{N}&#39; (GitLab MR)
+ Opens interactive picker if omitted. Shortcuts: &#39;^&#39; (default branch),
+ &#39;-&#39; (previous), &#39;@&#39; (current), &#39;pr:{N}&#39; (GitHub PR), &#39;mr:{N}&#39; (GitLab
+ MR)
<span class=c>[EXECUTE_ARGS]...</span>
Additional arguments for --execute command (after --)
@@ -135,6 +174,12 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
is expanded for templates, then POSIX shell-escaped.
<b><span class=g>Options:</span></b>
+ <b><span class=c>--branches</span></b>
+ Include branches without worktrees (interactive picker)
+
+ <b><span class=c>--remotes</span></b>
+ Include remote branches (interactive picker)
+
<b><span class=c>-c</span></b>, <b><span class=c>--create</span></b>
Create a new branch
diff --git a/docs/content/worktrunk.md b/docs/content/worktrunk.md
index 0844e569a..c0cbad602 100644
--- a/docs/content/worktrunk.md
+++ b/docs/content/worktrunk.md
@@ -205,8 +205,8 @@ The `-x` flag runs a command after switching; arguments after `--` are passed to
- Learn the core commands: [`wt switch`](@/switch.md), [`wt list`](@/list.md), [`wt merge`](@/merge.md), [`wt remove`](@/remove.md)
- Set up [project hooks](@/hook.md) for automated setup
-- Explore [LLM commit messages](@/llm-commits.md), [fzf-like
- selector](@/select.md), [Claude Code integration](@/claude-code.md), [CI
+- Explore [LLM commit messages](@/llm-commits.md), [interactive
+ picker](@/switch.md#interactive-picker), [Claude Code integration](@/claude-code.md), [CI
status & PR links](@/list.md#ci-status)
- Run `wt --help` or `wt <command> --help` for quick CLI reference
diff --git a/docs/demos/CLAUDE.md b/docs/demos/CLAUDE.md
index aec4f49dc..c0048c31d 100644
--- a/docs/demos/CLAUDE.md
+++ b/docs/demos/CLAUDE.md
@@ -169,9 +169,9 @@ ffmpeg -i demo.gif -vsync 0 /tmp/gif-frames/frame_%04d.png
# Adjust keystrokeDelayMS: increase if keystroke appears too early, decrease if too late
```
-## wt-select demo goals
+## wt-select demo goals (interactive picker)
-The wt-select demo showcases **realistic variety in all columns**:
+The wt-select demo showcases the interactive picker (`wt switch` without args) with **realistic variety in all columns**:
| Column | Demonstration |
|--------|---------------|
diff --git a/docs/demos/tapes/wt-select.tape b/docs/demos/tapes/wt-select.tape
index 136b4933a..903e0a8ea 100644
--- a/docs/demos/tapes/wt-select.tape
+++ b/docs/demos/tapes/wt-select.tape
@@ -11,8 +11,8 @@ Show
Set KeyStrokes Show
Sleep 500ms
-# Launch wt select
-Type "wt select"
+# Launch interactive picker (wt switch without args)
+Type "wt switch"
Enter
Sleep 1.5s
diff --git a/docs/demos/tapes/wt-zellij-omnibus.tape b/docs/demos/tapes/wt-zellij-omnibus.tape
index 2aa5092b2..5f2e79a36 100644
--- a/docs/demos/tapes/wt-zellij-omnibus.tape
+++ b/docs/demos/tapes/wt-zellij-omnibus.tape
@@ -6,7 +6,7 @@ Output "{{OUTPUT_GIF}}"
#
# Design principles:
# 1. Simple features before complex ones
-# - list, switch, select (navigation) → create, commit, merge (workflows)
+# - list, switch (navigation) → create, commit, merge (workflows)
# 2. Logical story arc
# - Overview → work on branches → create feature → complete it → cleanup
# 3. Merge comes AFTER making changes (not on pre-existing uncommitted changes)
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 2c1267ee5..1c506589f 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -308,6 +308,39 @@ wt switch pr:123 # PR #123's branch
wt switch mr:101 # MR !101's branch
```
+## Interactive picker
+
+When called without arguments, `wt switch` opens an interactive picker to browse and select worktrees with live preview. The picker requires a TTY.
+
+<!-- demo: wt-select.gif 1600x800 -->
+**Keybindings:**
+
+| Key | Action |
+|-----|--------|
+| `↑`/`↓` | Navigate worktree list |
+| `Enter` | Switch to selected worktree |
+| `Esc` | Cancel |
+| (type) | Filter worktrees |
+| `1`/`2`/`3`/`4` | Switch preview tab |
+| `Alt-p` | Toggle preview panel |
+| `Ctrl-u`/`Ctrl-d` | Scroll preview up/down |
+
+**Preview tabs** (toggle with number keys):
+
+1. **HEAD±** — Diff of uncommitted changes
+2. **log** — Recent commits; commits already on the default branch have dimmed hashes
+3. **main…±** — Diff of changes since the merge-base with the default branch
+4. **remote⇅** — Diff vs upstream tracking branch (ahead/behind)
+
+**Pager configuration:** The preview panel pipes diff output through git's pager. Override in user config:
+
+```toml
+[select]
+pager = "delta --paging=never"
+```
+
+Available on Unix only (macOS, Linux). On Windows, use `wt list` or `wt switch <branch>` directly.
+
## GitHub pull requests (experimental)
The `pr:<number>` syntax resolves the branch for a GitHub pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches `refs/pull/N/head` and configures `pushRemote` to the fork URL.
@@ -342,7 +375,6 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
## See also
-- [`wt select`](@/select.md) — Interactive worktree selection
- [`wt list`](@/list.md) — View all worktrees
- [`wt remove`](@/remove.md) — Delete worktrees when done
- [`wt merge`](@/merge.md) — Integrate changes back to the default branch
@@ -351,18 +383,27 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
Switch {
/// Branch name or shortcut
///
+ /// Opens interactive picker if omitted.
/// Shortcuts: '^' (default branch), '-' (previous), '@' (current), 'pr:{N}' (GitHub PR), 'mr:{N}' (GitLab MR)
#[arg(add = crate::completion::worktree_branch_completer())]
- branch: String,
+ branch: Option<String>,
+
+ /// Include branches without worktrees (interactive picker)
+ #[arg(long, conflicts_with_all = ["create", "base", "execute", "execute_args", "clobber"])]
+ branches: bool,
+
+ /// Include remote branches (interactive picker)
+ #[arg(long, conflicts_with_all = ["create", "base", "execute", "execute_args", "clobber"])]
+ remotes: bool,
/// Create a new branch
- #[arg(short = 'c', long)]
+ #[arg(short = 'c', long, requires = "branch")]
create: bool,
/// Base branch
///
/// Defaults to default branch.
- #[arg(short = 'b', long, add = crate::completion::branch_value_completer())]
+ #[arg(short = 'b', long, requires = "branch", add = crate::completion::branch_value_completer())]
base: Option<String>,
/// Command to run after switch
@@ -390,7 +431,7 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
/// Template example: `-x 'code {{ worktree_path }}'` opens VS Code
/// at the worktree, `-x 'tmux new -s {{ branch | sanitize }}'` starts
/// a tmux session named after the branch.
- #[arg(short = 'x', long)]
+ #[arg(short = 'x', long, requires = "branch")]
execute: Option<String>,
/// Additional arguments for --execute command (after --)
@@ -405,7 +446,7 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
yes: bool,
/// Remove stale paths at target
- #[arg(long)]
+ #[arg(long, requires = "branch")]
clobber: bool,
/// Skip hooks
@@ -644,7 +685,7 @@ Missing a field that would be generally useful? Open an issue at https://github.
## See also
-- [`wt select`](@/select.md) — Interactive worktree picker with live preview
+- [`wt switch`](@/switch.md) — Switch worktrees or open interactive picker
"#
)]
// TODO: `args_conflicts_with_subcommands` causes confusing errors for unknown
@@ -926,62 +967,10 @@ lint = "cargo clippy"
#[arg(long)]
stage: Option<crate::commands::commit::StageMode>,
},
- /// Interactive worktree selector
+ /// Deprecated: use `wt switch` instead
///
- /// Browse and switch worktrees with live preview.
- #[cfg_attr(not(unix), command(hide = true))]
- #[command(after_long_help = r#"<!-- demo: wt-select.gif 1600x800 -->
-## Examples
-
-Open the selector:
-
-```console
-wt select
-```
-
-## Preview tabs
-
-Toggle between views with number keys:
-
-1. **HEAD±** — Diff of uncommitted changes
-2. **log** — Recent commits; commits already on the default branch have dimmed hashes
-3. **main…±** — Diff of changes since the merge-base with the default branch
-4. **remote⇅** — Diff vs upstream tracking branch (ahead/behind)
-
-## Keybindings
-
-| Key | Action |
-|-----|--------|
-| `↑`/`↓` | Navigate worktree list |
-| `Enter` | Switch to selected worktree |
-| `Esc` | Cancel |
-| (type) | Filter worktrees |
-| `1`/`2`/`3`/`4` | Switch preview tab |
-| `Alt-p` | Toggle preview panel |
-| `Ctrl-u`/`Ctrl-d` | Scroll preview up/down |
-
-With `--branches`, branches without worktrees are included — selecting one creates a worktree. This matches `wt list --branches`.
-
-## Configuration
-
-### Pager
-
-The preview panel pipes diff output through git's pager (typically `less` or `delta`). Override pager behavior in user config:
-
-```toml
-[select]
-pager = "delta --paging=never"
-```
-
-This is useful when the default pager doesn't render correctly in the embedded preview panel.
-
-## See also
-
-- [`wt list`](@/list.md) — Static table view with all worktree metadata
-- [`wt switch`](@/switch.md) — Direct switching to a known target branch
-
-Available on Unix only (macOS, Linux). On Windows, use `wt list` or `wt switch` directly.
-"#)]
+ /// Interactive worktree picker (now integrated into `wt switch`).
+ #[command(hide = true)]
Select {
/// Include branches without worktrees
#[arg(long)]
@@ -1593,7 +1582,7 @@ verify = true # Run project hooks (--no-verify to skip)
### Select
-Pager behavior for `wt select` diff previews.
+Pager behavior for `wt switch` interactive picker diff previews.
```toml
[select]
diff --git a/src/commands/select/mod.rs b/src/commands/select/mod.rs
index 980cbc2e8..0888b7b1a 100644
--- a/src/commands/select/mod.rs
+++ b/src/commands/select/mod.rs
@@ -28,9 +28,9 @@ pub fn handle_select(
show_remotes: bool,
config: &UserConfig,
) -> anyhow::Result<()> {
- // Select requires an interactive terminal for the TUI
+ // Interactive picker requires a terminal for the TUI
if !std::io::stdin().is_terminal() {
- anyhow::bail!("wt select requires an interactive terminal");
+ anyhow::bail!("Interactive picker requires an interactive terminal");
}
let repo = Repository::current()?;
diff --git a/src/config/user/sections.rs b/src/config/user/sections.rs
index a5ed93bd2..f5c3ff495 100644
--- a/src/config/user/sections.rs
+++ b/src/config/user/sections.rs
@@ -274,7 +274,8 @@ impl Merge for MergeConfig {
}
}
-/// Configuration for the `wt select` command
+/// Configuration for the `wt select` command (now `wt switch` interactive picker).
+// TODO(#890): Rename to SwitchPickerConfig and [switch.picker] once migration is confirmed
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default, JsonSchema)]
pub struct SelectConfig {
/// Pager command with flags for diff preview
diff --git a/src/main.rs b/src/main.rs
index f9f51c981..077b1ce1e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -65,7 +65,6 @@ use worktrunk::HookType;
/// Enhance clap errors with command-specific hints, then exit.
///
-/// For `wt switch` missing the branch argument, adds hints about shortcuts.
/// For unrecognized subcommands that match nested commands, suggests the full path.
fn enhance_and_exit_error(err: clap::Error) -> ! {
// For unrecognized subcommands, check if they match a nested subcommand
@@ -84,24 +83,8 @@ fn enhance_and_exit_error(err: clap::Error) -> ! {
}
}
- // Enhance `wt switch` missing argument error with shortcut hints.
- // Hints go to stderr, which is safe since stdout is reserved for data output.
- // Check for both "wt switch" and "wt.exe switch" (Windows)
- let err_str = format!("{err}");
- let is_switch_missing_arg = err.kind() == ClapErrorKind::MissingRequiredArgument
- && (err_str.contains("wt switch") || err_str.contains("wt.exe switch"));
- if is_switch_missing_arg {
- ceprintln!(
- "{}
-
-<green,bold>Quick switches:</>
- <cyan,bold>wt switch ^</> # default branch's worktree
- <cyan,bold>wt switch -</> # previous worktree
- <cyan,bold>wt select</> # interactive picker",
- err.render().ansi()
- );
- process::exit(2);
- }
+ // Note: `wt switch` without arguments now opens the interactive picker,
+ // so this error enhancement is no longer triggered for that case.
err.exit()
}
@@ -643,6 +626,12 @@ fn main() {
},
#[cfg(unix)]
Commands::Select { branches, remotes } => {
+ // Deprecated: show warning and delegate to handle_select
+ eprintln!(
+ "{}",
+ warning_message("wt select is deprecated; use wt switch instead")
+ );
+
UserConfig::load()
.context("Failed to load config")
.and_then(|config| {
@@ -661,11 +650,18 @@ fn main() {
}
#[cfg(not(unix))]
Commands::Select { .. } => {
- eprintln!("{}", error_message("wt select is not available on Windows"));
+ eprintln!(
+ "{}",
+ warning_message("wt select is deprecated; use wt switch instead")
+ );
+ eprintln!(
+ "{}",
+ error_message("Interactive picker is not available on Windows")
+ );
eprintln!(
"{}",
hint_message(cformat!(
- "To see all worktrees, run <bright-black>wt list</>; to switch directly, run <bright-black>wt switch BRANCH</>"
+ "Specify a branch: <bright-black>wt switch BRANCH</>"
))
);
std::process::exit(1);
@@ -728,6 +724,8 @@ fn main() {
},
Commands::Switch {
branch,
+ branches,
+ remotes,
create,
base,
execute,
@@ -738,6 +736,47 @@ fn main() {
} => UserConfig::load()
.context("Failed to load config")
.and_then(|mut config| {
+ // No branch argument: open interactive picker
+ let Some(branch) = branch else {
+ #[cfg(unix)]
+ {
+ // Get project ID for per-project config lookup
+ let project_id = Repository::current()
+ .ok()
+ .and_then(|r| r.project_identifier().ok());
+
+ // Get effective list config (merges project-specific with global)
+ let (show_branches_config, show_remotes_config) = config
+ .list(project_id.as_deref())
+ .map(|l| (l.branches.unwrap_or(false), l.remotes.unwrap_or(false)))
+ .unwrap_or((false, false));
+
+ // CLI flags override config
+ let show_branches = branches || show_branches_config;
+ let show_remotes = remotes || show_remotes_config;
+
+ return handle_select(show_branches, show_remotes, &config);
+ }
+
+ #[cfg(not(unix))]
+ {
+ // Suppress unused variable warnings on Windows
+ let _ = (branches, remotes);
+
+ eprintln!(
+ "{}",
+ error_message("Interactive picker is not available on Windows")
+ );
+ eprintln!(
+ "{}",
+ hint_message(cformat!(
+ "Specify a branch: <bright-black>wt switch BRANCH</>"
+ ))
+ );
+ std::process::exit(2);
+ }
+ };
+
handle_switch(
SwitchOptions {
branch: &branch,
diff --git a/tests/integration_tests/readme_sync.rs b/tests/integration_tests/readme_sync.rs
index 6bca790c9..78d0fa372 100644
--- a/tests/integration_tests/readme_sync.rs
+++ b/tests/integration_tests/readme_sync.rs
@@ -1304,8 +1304,9 @@ fn test_docs_quickstart_examples_are_in_sync() {
/// Command pages generated via `wt <cmd> --help-page`
/// Each page preserves its frontmatter and replaces the AUTO-GENERATED marker region.
+/// Note: `select` is excluded because it's a deprecated hidden alias for `wt switch`.
const COMMAND_PAGES: &[&str] = &[
- "switch", "list", "merge", "remove", "select", "config", "step", "hook",
+ "switch", "list", "merge", "remove", "config", "step", "hook",
];
/// Sync command pages from --help-page output to docs/content/*.md
@@ -1550,10 +1551,7 @@ const SKILL_SYNC_FILES: &[(&str, &str)] = &[
"docs/content/list.md",
".claude-plugin/skills/worktrunk/reference/list.md",
),
- (
- "docs/content/select.md",
- ".claude-plugin/skills/worktrunk/reference/select.md",
- ),
+ // Note: select.md removed - it's a deprecated hidden alias for `wt switch`
(
"docs/content/step.md",
".claude-plugin/skills/worktrunk/reference/step.md",
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__bash_completion_subcommands.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__bash_completion_subcommands.snap
index 9d8e54ba1..db1609d82 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__bash_completion_subcommands.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__bash_completion_subcommands.snap
@@ -6,7 +6,6 @@ switch
list
remove
merge
-select
step
hook
config
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__fish_completion_subcommands.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__fish_completion_subcommands.snap
index 488382e79..1f7b8bc9d 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__fish_completion_subcommands.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__fish_completion_subcommands.snap
@@ -6,7 +6,6 @@ switch
list
remove
merge
-select
step
hook
config
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__zsh_completion_subcommands.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__zsh_completion_subcommands.snap
index 9d8e54ba1..db1609d82 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__zsh_completion_subcommands.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__unix_tests__zsh_completion_subcommands.snap
@@ -6,7 +6,6 @@ switch
list
remove
merge
-select
step
hook
config
diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rs
index c5603b4cd..10cadc4b6 100644
--- a/tests/integration_tests/switch.rs
+++ b/tests/integration_tests/switch.rs
@@ -1052,9 +1052,11 @@ fn test_switch_ping_pong_realistic(repo: TestRepo) {
);
}
+#[cfg(unix)] // Interactive picker only available on Unix
#[rstest]
-fn test_switch_missing_argument_shows_hints(repo: TestRepo) {
- // Run switch with no arguments - should show clap error plus hints
+fn test_switch_no_args_requires_tty(repo: TestRepo) {
+ // Run switch with no arguments in non-TTY - should fail with TTY requirement
+ // (interactive picker requires a terminal)
snapshot_switch("switch_missing_argument_hints", &repo, &[]);
}
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap b/tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap
index bd282add4..af5ca805f 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap
@@ -12,6 +12,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -36,4 +37,5 @@ exit_code: 1
----- stdout -----
----- stderr -----
-✗ wt select requires an interactive terminal
+▲ wt select is deprecated; use wt switch instead
+✗ Interactive picker requires an interactive terminal
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
index c9f65643c..5b3f02ab3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -9,6 +9,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -126,7 +127,7 @@ Creates ~/.config/worktrunk/config.toml with the following content:
#
# ### Select
#
- # Pager behavior for `wt select` diff previews.
+ # Pager behavior for `wt switch` interactive picker diff previews.
#
# [select]
# # Pager command with flags for diff preview (overrides git's core.pager)
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
index bcf8604e9..a360c1331 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -169,7 +169,7 @@ All flags are on by default. Set to false to change default behavior.
Select
-Pager behavior for wt select diff previews.
+Pager behavior for wt switch interactive picker diff previews.
[select]
# Pager command with flags for diff preview (overrides git's core.pager)
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index 783976cec..abe25a6a2 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -8,6 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -282,4 +283,4 @@ Missing a field that would be generally useful? Open an issue at https://github.
See also
-- wt select — Interactive worktree picker with live preview
+- wt switch — Switch worktrees or open interactive picker
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
index 660a43001..6787225e1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
@@ -8,6 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "80"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -310,4 +311,4 @@ https://github.com/max-sixty/worktrunk.
See also
-- wt select — Interactive worktree picker with live preview
+- wt switch — Switch worktrees or open interactive picker
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_root.snap b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
index a73c9bf8e..97eb5f23d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
@@ -7,6 +7,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -32,7 +33,6 @@ Commands:
list List worktrees and their status
remove Remove worktree; delete branch if merged
merge Merge current branch into target
- select Interactive worktree selector
step Run individual operations
hook Run configured hooks
config Manage user & project configs
diff --git a/tests/snapshots/integration__integration_tests__help__help_no_args.snap b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
index 9a9180987..091c37686 100644
--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
@@ -6,6 +6,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -33,7 +34,6 @@ Usage: wt [OPTIONS] [COMMAND]
list List worktrees and their status
remove Remove worktree; delete branch if merged
merge Merge current branch into target
- select Interactive worktree selector
step Run individual operations
hook Run configured hooks
config Manage user & project configs
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_long.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
index b43bb5032..de4f104fd 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -7,6 +7,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -34,7 +35,6 @@ Usage: wt [OPTIONS] [COMMAND]
list List worktrees and their status
remove Remove worktree; delete branch if merged
merge Merge current branch into target
- select Interactive worktree selector
step Run individual operations
hook Run configured hooks
config Manage user & project configs
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_short.snap b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
index 8b811da34..6417cc34b 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
@@ -7,6 +7,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -34,7 +35,6 @@ Usage: wt [OPTIONS] [COMMAND]
list List worktrees and their status
remove Remove worktree; delete branch if merged
merge Merge current branch into target
- select Interactive worktree selector
step Run individual operations
hook Run configured hooks
config Manage user & project configs
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index 20f4ab51c..a643b1033 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -8,6 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -30,13 +31,13 @@ wt switch - Switch to a worktree
Creates one if needed.
-Usage: wt switch [OPTIONS] <BRANCH> [-- <EXECUTE_ARGS>...]
+Usage: wt switch [OPTIONS] [BRANCH] [-- <EXECUTE_ARGS>...]
Arguments:
- <BRANCH>
+ [BRANCH]
Branch name or shortcut
- Shortcuts: '^' (default branch), '-' (previous), '@' (current), 'pr:{N}' (GitHub PR), 'mr:{N}' (GitLab MR)
+ Opens interactive picker if omitted. Shortcuts: '^' (default branch), '-' (previous), '@' (current), 'pr:{N}' (GitHub PR), 'mr:{N}' (GitLab MR)
[EXECUTE_ARGS]...
Additional arguments for --execute command (after --)
@@ -44,6 +45,12 @@ Usage: wt switch [OPTIONS] <BRANCH> [--
Arguments after -- are appended to the execute command. Each argument is expanded for templates, then POSIX shell-escaped.
Options:
+ --branches
+ Include branches without worktrees (interactive picker)
+
+ --remotes
+ Include remote branches (interactive picker)
+
-c, --create
Create a new branch
@@ -140,6 +147,36 @@ When creating a worktree, worktrunk:
wt switch pr:123 # PR #123's branch
wt switch mr:101 # MR !101's branch
+Interactive picker
+
+When called without arguments, wt switch opens an interactive picker to browse and select worktrees with live preview. The picker requires a TTY.
+
+Keybindings:
+
+ Key Action
+ ───────────── ───────────────────────────
+ ↑/↓ Navigate worktree list
+ Enter Switch to selected worktree
+ Esc Cancel
+ (type) Filter worktrees
+ 1/2/3/4 Switch preview tab
+ Alt-p Toggle preview panel
+ Ctrl-u/Ctrl-d Scroll preview up/down
+
+Preview tabs (toggle with number keys):
+
+1. HEAD± — Diff of uncommitted changes
+2. log — Recent commits; commits already on the default branch have dimmed hashes
+3. main…± — Diff of changes since the merge-base with the default branch
+4. remote⇅ — Diff vs upstream tracking branch (ahead/behind)
+
+Pager configuration: The preview panel pipes diff output through git's pager. Override in user config:
+
+ [select]
+ pager = "delta --paging=never"
+
+Available on Unix only (macOS, Linux). On Windows, use wt list or wt switch <branch> directly.
+
GitHub pull requests (experimental)
The pr:<number> syntax resolves the branch for a GitHub pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches refs/pull/N/head and configures pushRemote to the fork URL.
@@ -170,7 +207,6 @@ To change which branch a worktree is on, use git switch inside that work
See also
-- wt select — Interactive worktree selection
- wt list — View all worktrees
- wt remove — Delete worktrees when done
- wt merge — Integrate changes back to the default branch
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
index d20b9e3b1..72fcb6e4b 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -8,6 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
PSModulePath: ""
@@ -28,13 +29,15 @@ exit_code: 0
----- stderr -----
wt switch - Switch to a worktree
-Usage: wt switch [OPTIONS] <BRANCH> [-- <EXECUTE_ARGS>...]
+Usage: wt switch [OPTIONS] [BRANCH] [-- <EXECUTE_ARGS>...]
Arguments:
- <BRANCH> Branch name or shortcut
+ [BRANCH] Branch name or shortcut
[EXECUTE_ARGS]... Additional arguments for --execute command (after --)
Options:
+ --branches Include branches without worktrees (interactive picker)
+ --remotes Include remote branches (interactive picker)
-c, --create Create a new branch
-b, --base <BASE> Base branch
-x, --execute <EXECUTE> Command to run after switch
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_missing_argument_hints.snap b/tests/snapshots/integration__integration_tests__switch__switch_missing_argument_hints.snap
index 15abb7624..7a0cc2886 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_missing_argument_hints.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_missing_argument_hints.snap
@@ -12,6 +12,7 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -32,19 +33,8 @@ info:
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: false
-exit_code: 2
+exit_code: 1
----- stdout -----
----- stderr -----
-error: the following required arguments were not provided:
- <BRANCH>
-
-Usage: wt switch <BRANCH> [-- <EXECUTE_ARGS>...]
-
-For more information, try '--help'.
-
-
-Quick switches:
- wt switch ^ # default branch's worktree
- wt switch - # previous worktree
- wt select # interactive picker
+✗ Interactive picker requires an interactive terminal