Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
docs: reorganize switch command sections and add auto-generated headers
Maximilian Roosddea69acde91
diff --git a/README.md b/README.mdindex b7f7abe11..3362e7c65 100644--- a/README.md+++ b/README.md@@ -521,20 +521,6 @@ wt switch --create hotfix --base productionFor interactive selection, use [`wt select`](/select/).-### Shortcuts--| Symbol | Meaning |-|--------|---------|-| `-` | Previous worktree |-| `@` | Current branch's worktree |-| `^` | Default branch worktree |--```bash-wt switch - # Back to previous-wt switch ^ # Main worktree-wt switch --create fix --base=@ # Branch from current HEAD-```-### Creating WorktreesWith `--create`, worktrunk:@@ -552,6 +538,20 @@ wt switch --create docs --execute "code ."wt switch --create temp --no-verify # Skip hooks```+### Shortcuts++| Symbol | Meaning |+|--------|---------|+| `-` | Previous worktree |+| `@` | Current branch's worktree |+| `^` | Default branch worktree |++```bash+wt switch - # Back to previous+wt switch ^ # Main worktree+wt switch --create fix --base=@ # Branch from current HEAD+```+### Path-First LookupArguments resolve by checking the filesystem before git branches:diff --git a/docs/content/config.md b/docs/content/config.mdindex c15486610..8ec83ea1b 100644--- a/docs/content/config.md+++ b/docs/content/config.md@@ -6,6 +6,8 @@ weight = 15group = "Commands"++++<!-- ⚠️ AUTO-GENERATED from `wt config --help-page` — edit src/cli.rs to update -->+Manages configuration, shell integration, and runtime settings. The command provides subcommands for setup, inspection, and cache management.## Examplesdiff --git a/docs/content/list.md b/docs/content/list.mdindex 4921eec01..0cf6b8290 100644--- a/docs/content/list.md+++ b/docs/content/list.md@@ -6,6 +6,8 @@ weight = 11group = "Commands"++++<!-- ⚠️ AUTO-GENERATED from `wt list --help-page` — edit src/cli.rs to update -->+Show all worktrees with their status. The table includes uncommitted changes, divergence from main and remote, and optional CI status.The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as background git operations complete. CI status (with `--full`) requires network requests and may take longer.diff --git a/docs/content/merge.md b/docs/content/merge.mdindex 9be9ad84b..5b81bfd04 100644--- a/docs/content/merge.md+++ b/docs/content/merge.md@@ -1,11 +1,13 @@+++title = "wt merge"-weight = 12+weight = 13[extra]group = "Commands"++++<!-- ⚠️ AUTO-GENERATED from `wt merge --help-page` — edit src/cli.rs to update -->+Merge the current branch into the target branch and clean up. Handles the full workflow: commit uncommitted changes, squash commits, rebase, run hooks, push to target, and remove the worktree.When already on the target branch or in the main worktree, the worktree is preserved automatically.diff --git a/docs/content/remove.md b/docs/content/remove.mdindex 0469f8680..51f782414 100644--- a/docs/content/remove.md+++ b/docs/content/remove.md@@ -1,11 +1,13 @@+++title = "wt remove"-weight = 13+weight = 12[extra]group = "Commands"++++<!-- ⚠️ AUTO-GENERATED from `wt remove --help-page` — edit src/cli.rs to update -->+Removes worktrees and their branches. Without arguments, removes the current worktree and returns to the main worktree.## Examplesdiff --git a/docs/content/select.md b/docs/content/select.mdindex afd60aa47..7fc628948 100644--- a/docs/content/select.md+++ b/docs/content/select.md@@ -6,6 +6,8 @@ weight = 14group = "Commands"++++<!-- ⚠️ AUTO-GENERATED from `wt select --help-page` — edit src/cli.rs to update -->+Interactive worktree picker with live preview. Navigate worktrees with keyboard shortcuts and press Enter to switch.## Examplesdiff --git a/docs/content/step.md b/docs/content/step.mdindex b148bf4c1..2d632d403 100644--- a/docs/content/step.md+++ b/docs/content/step.md@@ -6,6 +6,8 @@ weight = 16group = "Commands"++++<!-- ⚠️ AUTO-GENERATED from `wt step --help-page` — edit src/cli.rs to update -->+Run individual workflow operations: commits, squashes, rebases, pushes, and [hooks](/hooks/).## Examplesdiff --git a/docs/content/switch.md b/docs/content/switch.mdindex f37f563a4..fcb2e3163 100644--- a/docs/content/switch.md+++ b/docs/content/switch.md@@ -6,6 +6,8 @@ weight = 10group = "Commands"++++<!-- ⚠️ AUTO-GENERATED from `wt switch --help-page` — edit src/cli.rs to update -->+Two distinct operations:- **Switch to existing worktree** — Changes directory, nothing else@@ -22,20 +24,6 @@ wt switch --create hotfix --base productionFor interactive selection, use [`wt select`](/select/).-## Shortcuts--| Symbol | Meaning |-|--------|---------|-| `-` | Previous worktree |-| `@` | Current branch's worktree |-| `^` | Default branch worktree |--```bash-wt switch - # Back to previous-wt switch ^ # Main worktree-wt switch --create fix --base=@ # Branch from current HEAD-```-## Creating WorktreesWith `--create`, worktrunk:@@ -53,6 +41,20 @@ wt switch --create docs --execute "code ."wt switch --create temp --no-verify # Skip hooks```+## Shortcuts++| Symbol | Meaning |+|--------|---------|+| `-` | Previous worktree |+| `@` | Current branch's worktree |+| `^` | Default branch worktree |++```bash+wt switch - # Back to previous+wt switch ^ # Main worktree+wt switch --create fix --base=@ # Branch from current HEAD+```+## Path-First LookupArguments resolve by checking the filesystem before git branches:diff --git a/src/cli.rs b/src/cli.rsindex 59bcc9163..e09fc7299 100644--- a/src/cli.rs+++ b/src/cli.rs@@ -992,20 +992,6 @@ wt switch --create hotfix --base productionFor interactive selection, use [`wt select`](/select/).-## Shortcuts--| Symbol | Meaning |-|--------|---------|-| `-` | Previous worktree |-| `@` | Current branch's worktree |-| `^` | Default branch worktree |--```console-wt switch - # Back to previous-wt switch ^ # Main worktree-wt switch --create fix --base=@ # Branch from current HEAD-```-## Creating WorktreesWith `--create`, worktrunk:@@ -1023,6 +1009,20 @@ wt switch --create docs --execute "code ."wt switch --create temp --no-verify # Skip hooks```+## Shortcuts++| Symbol | Meaning |+|--------|---------|+| `-` | Previous worktree |+| `@` | Current branch's worktree |+| `^` | Default branch worktree |++```console+wt switch - # Back to previous+wt switch ^ # Main worktree+wt switch --create fix --base=@ # Branch from current HEAD+```+## Path-First LookupArguments resolve by checking the filesystem before git branches:diff --git a/src/main.rs b/src/main.rsindex aec742257..48443b375 100644--- a/src/main.rs+++ b/src/main.rs@@ -242,12 +242,12 @@ fn handle_help_page(args: &[String]) {// Weight mapping (for nav order)// Commands are grouped together after Concepts (weight 3)- // Order: switch, list (daily use), merge, remove (workflow completion), then utilities+ // Order: switch, list (daily use), remove, merge (workflow completion), then utilitieslet weight = match subcommand.as_str() {"switch" => 10,"list" => 11,- "merge" => 12,- "remove" => 13,+ "remove" => 12,+ "merge" => 13,"select" => 14,"config" => 15,"step" => 16,@@ -263,6 +263,10 @@ fn handle_help_page(args: &[String]) {println!("group = \"Commands\"");println!("+++");println!();+ println!(+ "<!-- ⚠️ AUTO-GENERATED from `wt {subcommand} --help-page` — edit src/cli.rs to update -->"+ );+ println!();println!("{}", after_help.trim());println!();println!("---");diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snapindex 946ac0008..6a0dd0d0f 100644--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap@@ -71,18 +71,6 @@ Two distinct operations:For interactive selection, use [[2mwt select[0m](/select/).-[32mShortcuts[0m--| Symbol | Meaning |-|--------|---------|-| [2m-[0m | Previous worktree |-| [2m@[0m | Current branch's worktree |-| [2m^[0m | Default branch worktree |-- [2mwt switch - # Back to previous[0m- [2mwt switch ^ # Main worktree[0m- [2mwt switch --create fix --base=@ # Branch from current HEAD[0m-[32mCreating Worktrees[0mWith [2m--create[0m, worktrunk:@@ -98,6 +86,18 @@ With [2m--create[0m, worktrunk:[2mwt switch --create docs --execute "code ."[0m[2mwt switch --create temp --no-verify # Skip hooks[0m+[32mShortcuts[0m++| Symbol | Meaning |+|--------|---------|+| [2m-[0m | Previous worktree |+| [2m@[0m | Current branch's worktree |+| [2m^[0m | Default branch worktree |++ [2mwt switch - # Back to previous[0m+ [2mwt switch ^ # Main worktree[0m+ [2mwt switch --create fix --base=@ # Branch from current HEAD[0m+[32mPath-First Lookup[0mArguments resolve by checking the filesystem before git branches: