Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
docs: clean up switch command help text (#1782)
worktrunk-bote14e80c0ceec
diff --git a/docs/content/switch.md b/docs/content/switch.mdindex 18cb6b5c5..e29c99596 100644--- a/docs/content/switch.md+++ b/docs/content/switch.md@@ -36,14 +36,12 @@ The `--create` flag creates a new branch from `--base` — the default branch un## Creating worktrees-If the branch already has a worktree, `wt switch` changes directories to it. Otherwise, it creates one, running [hooks](@/hook.md).+If the branch already has a worktree, `wt switch` changes directories to it. Otherwise, it creates one:-When creating a worktree, worktrunk:--1. Runs [pre-switch hooks](@/hook.md#pre-switch) — blocks until complete+1. Runs [pre-switch hooks](@/hook.md#pre-switch), blocking until complete2. Creates worktree at configured path3. Switches to new directory-4. Runs [pre-start hooks](@/hook.md#pre-start) — blocks until complete+4. Runs [pre-start hooks](@/hook.md#pre-start), blocking until complete5. Spawns [post-start](@/hook.md#post-start) and [post-switch hooks](@/hook.md#post-switch) in the background```bash@@ -73,7 +71,7 @@ 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.+When called without arguments, `wt switch` opens an interactive picker to browse and select worktrees with live preview.<figure class="demo"><picture>@@ -89,7 +87,7 @@ When called without arguments, `wt switch` opens an interactive picker to browse| `↑`/`↓` | Navigate worktree list || (type) | Filter worktrees || `Enter` | Switch to selected worktree |-| `Alt-c` | Create new worktree from query |+| `Alt-c` | Create new worktree named as entered text || `Esc` | Cancel || `1`–`5` | Switch preview tab || `Alt-p` | Toggle preview panel |diff --git a/skills/worktrunk/reference/switch.md b/skills/worktrunk/reference/switch.mdindex 55d95a32f..459a04bfb 100644--- a/skills/worktrunk/reference/switch.md+++ b/skills/worktrunk/reference/switch.md@@ -20,14 +20,12 @@ The `--create` flag creates a new branch from `--base` — the default branch un## Creating worktrees-If the branch already has a worktree, `wt switch` changes directories to it. Otherwise, it creates one, running [hooks](https://worktrunk.dev/hook/).+If the branch already has a worktree, `wt switch` changes directories to it. Otherwise, it creates one:-When creating a worktree, worktrunk:--1. Runs [pre-switch hooks](https://worktrunk.dev/hook/#pre-switch) — blocks until complete+1. Runs [pre-switch hooks](https://worktrunk.dev/hook/#pre-switch), blocking until complete2. Creates worktree at configured path3. Switches to new directory-4. Runs [pre-start hooks](https://worktrunk.dev/hook/#pre-start) — blocks until complete+4. Runs [pre-start hooks](https://worktrunk.dev/hook/#pre-start), blocking until complete5. Spawns [post-start](https://worktrunk.dev/hook/#post-start) and [post-switch hooks](https://worktrunk.dev/hook/#post-switch) in the background```bash@@ -57,7 +55,7 @@ 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.+When called without arguments, `wt switch` opens an interactive picker to browse and select worktrees with live preview.**Keybindings:**@@ -66,7 +64,7 @@ When called without arguments, `wt switch` opens an interactive picker to browse| `↑`/`↓` | Navigate worktree list || (type) | Filter worktrees || `Enter` | Switch to selected worktree |-| `Alt-c` | Create new worktree from query |+| `Alt-c` | Create new worktree named as entered text || `Esc` | Cancel || `1`–`5` | Switch preview tab || `Alt-p` | Toggle preview panel |diff --git a/src/cli/mod.rs b/src/cli/mod.rsindex 1000dd297..cafb683e2 100644--- a/src/cli/mod.rs+++ b/src/cli/mod.rs@@ -268,14 +268,12 @@ The `--create` flag creates a new branch from `--base` — the default branch un## Creating worktrees-If the branch already has a worktree, `wt switch` changes directories to it. Otherwise, it creates one, running [hooks](@/hook.md).+If the branch already has a worktree, `wt switch` changes directories to it. Otherwise, it creates one:-When creating a worktree, worktrunk:--1. Runs [pre-switch hooks](@/hook.md#pre-switch) — blocks until complete+1. Runs [pre-switch hooks](@/hook.md#pre-switch), blocking until complete2. Creates worktree at configured path3. Switches to new directory-4. Runs [pre-start hooks](@/hook.md#pre-start) — blocks until complete+4. Runs [pre-start hooks](@/hook.md#pre-start), blocking until complete5. Spawns [post-start](@/hook.md#post-start) and [post-switch hooks](@/hook.md#post-switch) in the background```console@@ -305,7 +303,7 @@ 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.+When called without arguments, `wt switch` opens an interactive picker to browse and select worktrees with live preview.<!-- demo: wt-switch-picker.gif 1600x800 -->**Keybindings:**@@ -315,7 +313,7 @@ When called without arguments, `wt switch` opens an interactive picker to browse| `↑`/`↓` | Navigate worktree list || (type) | Filter worktrees || `Enter` | Switch to selected worktree |-| `Alt-c` | Create new worktree from query |+| `Alt-c` | Create new worktree named as entered text || `Esc` | Cancel || `1`–`5` | Switch preview tab || `Alt-p` | Toggle preview panel |diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snapindex c7f70d6e5..d7b162269 100644--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap@@ -124,14 +124,12 @@ The [2m--create[0m flag creates a new branch from [2m--base[0m — the defau[1m[32mCreating worktrees[0m-If the branch already has a worktree, [2mwt switch[0m changes directories to it. Otherwise, it creates one, running hooks.+If the branch already has a worktree, [2mwt switch[0m changes directories to it. Otherwise, it creates one:-When creating a worktree, worktrunk:--1. Runs pre-switch hooks — blocks until complete+1. Runs pre-switch hooks, blocking until complete2. Creates worktree at configured path3. Switches to new directory-4. Runs pre-start hooks — blocks until complete+4. Runs pre-start hooks, blocking until complete5. Spawns post-start and post-switch hooks in the background[107m [0m [2m[0m[2m[34mwt[0m[2m switch feature # Existing branch → creates worktree[0m[2m[0m@@ -157,20 +155,20 @@ When creating a worktree, worktrunk:[1m[32mInteractive picker[0m-When called without arguments, [2mwt switch[0m opens an interactive picker to browse and select worktrees with live preview. The picker requires a TTY.+When called without arguments, [2mwt switch[0m opens an interactive picker to browse and select worktrees with live preview.[1mKeybindings:[0m- Key Action- ───────────── ──────────────────────────────- [2m↑[0m/[2m↓[0m Navigate worktree list- (type) Filter worktrees- [2mEnter[0m Switch to selected worktree- [2mAlt-c[0m Create new worktree from query- [2mEsc[0m Cancel- [2m1[0m–[2m5[0m Switch preview tab- [2mAlt-p[0m Toggle preview panel- [2mCtrl-u[0m/[2mCtrl-d[0m Scroll preview up/down+ Key Action+ ───────────── ─────────────────────────────────────────+ [2m↑[0m/[2m↓[0m Navigate worktree list+ (type) Filter worktrees+ [2mEnter[0m Switch to selected worktree+ [2mAlt-c[0m Create new worktree named as entered text+ [2mEsc[0m Cancel+ [2m1[0m–[2m5[0m Switch preview tab+ [2mAlt-p[0m Toggle preview panel+ [2mCtrl-u[0m/[2mCtrl-d[0m Scroll preview up/down[1mPreview tabs[0m — toggle with number keys: