Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
docs: improve switch command description (#1082)
Maximilian Roos6e55625ab3d9
diff --git a/docs/content/switch.md b/docs/content/switch.mdindex 9ac6aeeba..7e866862a 100644--- a/docs/content/switch.md+++ b/docs/content/switch.md@@ -8,7 +8,7 @@ group = "Commands"<!-- ⚠️ AUTO-GENERATED from `wt switch --help-page` — edit cli.rs to update -->-Switch to a worktree. Creates one if needed.+Switch to a worktree; create if needed.Worktrees are addressed by branch name; paths are computed from a configurable template. Unlike `git switch`, this navigates between worktrees rather than changing branches in place.@@ -155,9 +155,7 @@ To change which branch a worktree is on, use `git switch` inside that worktree.## Command reference{% terminal() %}-wt switch - Switch to a worktree--Creates one if needed.+wt switch - Switch to a worktree; create if neededUsage: <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><EXECUTE_ARGS>...</span><b><span class=c>]</span></b>diff --git a/skills/worktrunk/reference/switch.md b/skills/worktrunk/reference/switch.mdindex 14e3ece37..3f722f897 100644--- a/skills/worktrunk/reference/switch.md+++ b/skills/worktrunk/reference/switch.md@@ -1,6 +1,6 @@# wt switch-Switch to a worktree. Creates one if needed.+Switch to a worktree; create if needed.Worktrees are addressed by branch name; paths are computed from a configurable template. Unlike `git switch`, this navigates between worktrees rather than changing branches in place.@@ -126,9 +126,7 @@ To change which branch a worktree is on, use `git switch` inside that worktree.## Command reference-wt switch - Switch to a worktree--Creates one if needed.+wt switch - Switch to a worktree; create if neededUsage: <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><EXECUTE_ARGS>...</span><b><span class=c>]</span></b>diff --git a/src/cli/mod.rs b/src/cli/mod.rsindex 15b39d75a..c97c1ff47 100644--- a/src/cli/mod.rs+++ b/src/cli/mod.rs@@ -247,9 +247,7 @@ pub(crate) struct Cli {#[derive(Subcommand)]pub(crate) enum Commands {- /// Switch to a worktree- ///- /// Creates one if needed.+ /// Switch to a worktree; create if needed#[command(after_long_help = r#"Worktrees are addressed by branch name; paths are computed from a configurable template. Unlike `git switch`, this navigates between worktrees rather than changing branches in place.diff --git a/tests/snapshots/integration__integration_tests__help__help_md_root.snap b/tests/snapshots/integration__integration_tests__help__help_md_root.snapindex 53a3e7044..46d369934 100644--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap@@ -16,6 +16,7 @@ info:TERM: alacrittyWORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.tomlWORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.tomlWORKTRUNK_TEST_CLAUDE_INSTALLED: "0"WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"WORKTRUNK_TEST_EPOCH: "1735776000"@@ -31,7 +32,7 @@ wt - Git worktree management for parallel AI agent workflowsUsage: wt [OPTIONS] [COMMAND]Commands:- switch Switch to a worktree+ switch Switch to a worktree; create if neededlist List worktrees and their statusremove Remove worktree; delete branch if mergedmerge Merge current branch into targetdiff --git a/tests/snapshots/integration__integration_tests__help__help_no_args.snap b/tests/snapshots/integration__integration_tests__help__help_no_args.snapindex 3c0d2ae33..89ca485a3 100644--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap@@ -13,10 +13,13 @@ info:RUST_LOG: warnSHELL: ""TERM: alacritty+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.tomlWORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.tomlWORKTRUNK_TEST_CLAUDE_INSTALLED: "0"WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"WORKTRUNK_TEST_EPOCH: "1735776000"+ WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"---@@ -30,7 +33,7 @@ wt - Git worktree management for parallel AI agent workflowsUsage: [1m[36mwt[0m [36m[OPTIONS][0m [36m[COMMAND][0m[1m[32mCommands:[0m- [1m[36mswitch[0m Switch to a worktree+ [1m[36mswitch[0m Switch to a worktree; create if needed[1m[36mlist[0m List worktrees and their status[1m[36mremove[0m Remove worktree; delete branch if merged[1m[36mmerge[0m Merge current branch into targetdiff --git a/tests/snapshots/integration__integration_tests__help__help_root_long.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snapindex 6cb551004..bcafe06ba 100644--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap@@ -14,10 +14,13 @@ info:RUST_LOG: warnSHELL: ""TERM: alacritty+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.tomlWORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.tomlWORKTRUNK_TEST_CLAUDE_INSTALLED: "0"WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"WORKTRUNK_TEST_EPOCH: "1735776000"+ WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"---@@ -31,7 +34,7 @@ wt - Git worktree management for parallel AI agent workflowsUsage: [1m[36mwt[0m [36m[OPTIONS][0m [36m[COMMAND][0m[1m[32mCommands:[0m- [1m[36mswitch[0m Switch to a worktree+ [1m[36mswitch[0m Switch to a worktree; create if needed[1m[36mlist[0m List worktrees and their status[1m[36mremove[0m Remove worktree; delete branch if merged[1m[36mmerge[0m Merge current branch into targetdiff --git a/tests/snapshots/integration__integration_tests__help__help_root_short.snap b/tests/snapshots/integration__integration_tests__help__help_root_short.snapindex acc67b469..a69fd2a42 100644--- a/tests/snapshots/integration__integration_tests__help__help_root_short.snap+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap@@ -14,10 +14,13 @@ info:RUST_LOG: warnSHELL: ""TERM: alacritty+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.tomlWORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.tomlWORKTRUNK_TEST_CLAUDE_INSTALLED: "0"WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"WORKTRUNK_TEST_EPOCH: "1735776000"+ WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"---@@ -31,7 +34,7 @@ wt - Git worktree management for parallel AI agent workflowsUsage: [1m[36mwt[0m [36m[OPTIONS][0m [36m[COMMAND][0m[1m[32mCommands:[0m- [1m[36mswitch[0m Switch to a worktree+ [1m[36mswitch[0m Switch to a worktree; create if needed[1m[36mlist[0m List worktrees and their status[1m[36mremove[0m Remove worktree; delete branch if merged[1m[36mmerge[0m Merge current branch into targetdiff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snapindex 48037a8b0..60a350a28 100644--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap@@ -15,7 +15,9 @@ info:RUST_LOG: warnSHELL: ""TERM: alacritty+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.tomlWORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.tomlWORKTRUNK_TEST_CLAUDE_INSTALLED: "0"WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"WORKTRUNK_TEST_EPOCH: "1735776000"@@ -28,9 +30,7 @@ exit_code: 0----- stdout ---------- stderr ------wt switch - Switch to a worktree[0m--Creates one if needed.[0m+wt switch - Switch to a worktree; create if neededUsage: [1m[36mwt switch[0m [36m[OPTIONS][0m [36m[BRANCH][0m [1m[36m[--[0m [36m<EXECUTE_ARGS>...[0m[1m[36m][0mdiff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snapindex 030700518..f5d23502b 100644--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap@@ -15,10 +15,13 @@ info:RUST_LOG: warnSHELL: ""TERM: alacritty+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.tomlWORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.tomlWORKTRUNK_TEST_CLAUDE_INSTALLED: "0"WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"WORKTRUNK_TEST_EPOCH: "1735776000"+ WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"---@@ -27,7 +30,7 @@ exit_code: 0----- stdout ---------- stderr ------wt switch - Switch to a worktree+wt switch - Switch to a worktree; create if neededUsage: [1m[36mwt switch[0m [36m[OPTIONS][0m [36m[BRANCH][0m [1m[36m[--[0m [36m<EXECUTE_ARGS>...[0m[1m[36m][0m