Skip to content

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.md
index b7f7abe11..3362e7c65 100644
--- a/README.md
+++ b/README.md
@@ -521,20 +521,6 @@ wt switch --create hotfix --base production
For 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 Worktrees
With `--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 Lookup
Arguments resolve by checking the filesystem before git branches:
diff --git a/docs/content/config.md b/docs/content/config.md
index c15486610..8ec83ea1b 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -6,6 +6,8 @@ weight = 15
group = "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.
## Examples
diff --git a/docs/content/list.md b/docs/content/list.md
index 4921eec01..0cf6b8290 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -6,6 +6,8 @@ weight = 11
group = "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.md
index 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.md
index 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.
## Examples
diff --git a/docs/content/select.md b/docs/content/select.md
index afd60aa47..7fc628948 100644
--- a/docs/content/select.md
+++ b/docs/content/select.md
@@ -6,6 +6,8 @@ weight = 14
group = "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.
## Examples
diff --git a/docs/content/step.md b/docs/content/step.md
index b148bf4c1..2d632d403 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -6,6 +6,8 @@ weight = 16
group = "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/).
## Examples
diff --git a/docs/content/switch.md b/docs/content/switch.md
index f37f563a4..fcb2e3163 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -6,6 +6,8 @@ weight = 10
group = "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 production
For 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 Worktrees
With `--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 Lookup
Arguments resolve by checking the filesystem before git branches:
diff --git a/src/cli.rs b/src/cli.rs
index 59bcc9163..e09fc7299 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -992,20 +992,6 @@ wt switch --create hotfix --base production
For 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 Worktrees
With `--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 Lookup
Arguments resolve by checking the filesystem before git branches:
diff --git a/src/main.rs b/src/main.rs
index 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 utilities
let 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.snap
index 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 [wt select](/select/).
-Shortcuts
-
-| Symbol | Meaning |
-|--------|---------|
-| - | Previous worktree |
-| @ | Current branch's worktree |
-| ^ | Default branch worktree |
-
- wt switch - # Back to previous
- wt switch ^ # Main worktree
- wt switch --create fix --base=@ # Branch from current HEAD
-
Creating Worktrees
With --create, worktrunk:
@@ -98,6 +86,18 @@ With --create, worktrunk:
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 |
+
+ wt switch - # Back to previous
+ wt switch ^ # Main worktree
+ wt switch --create fix --base=@ # Branch from current HEAD
+
Path-First Lookup
Arguments resolve by checking the filesystem before git branches: