Skip to content

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

Docs: Add explicit `wt` prefix in `Usage` lines for clarity

Maximilian Roos324f301ee289
diff --git a/README.md b/README.md
index 33c0a1624..f2cc9b98d 100644
--- a/README.md
+++ b/README.md
@@ -348,7 +348,7 @@ HEAD.
```text
wt switch — Switch to a worktree
-Usage: switch [OPTIONS] <BRANCH>
+Usage: wt switch [OPTIONS] <BRANCH>
Arguments:
<BRANCH>
@@ -375,6 +375,16 @@ Options:
-h, --help
Print help (see a summary with '-h')
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ -v, --verbose
+ Show commands and debug info
+
```
## Operation
@@ -478,7 +488,7 @@ wt remove @ # Remove current worktree
```text
wt merge — Merge worktree into target branch
-Usage: merge [OPTIONS] [TARGET]
+Usage: wt merge [OPTIONS] [TARGET]
Arguments:
[TARGET]
@@ -513,6 +523,16 @@ Options:
-h, --help
Print help (see a summary with '-h')
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ -v, --verbose
+ Show commands and debug info
+
```
## Operation
@@ -589,7 +609,7 @@ wt merge --no-verify
```text
wt remove — Remove worktree and branch
-Usage: remove [OPTIONS] [WORKTREES]...
+Usage: wt remove [OPTIONS] [WORKTREES]...
Arguments:
[WORKTREES]...
@@ -608,6 +628,16 @@ Options:
-h, --help
Print help (see a summary with '-h')
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ -v, --verbose
+ Show commands and debug info
+
```
## Operation
@@ -694,7 +724,7 @@ wt remove # (when already in main worktree)
```text
wt list — List worktrees and optionally branches
-Usage: list [OPTIONS]
+Usage: wt list [OPTIONS]
Options:
--format <FORMAT>
@@ -719,6 +749,16 @@ Options:
-h, --help
Print help (see a summary with '-h')
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ -v, --verbose
+ Show commands and debug info
+
```
## Columns
@@ -824,7 +864,7 @@ jq '.[] | select(.is_current == true)'
```text
wt config — Manage configuration and shell integration
-Usage: config <COMMAND>
+Usage: wt config [OPTIONS] <COMMAND>
Commands:
shell Shell integration setup
@@ -833,12 +873,21 @@ Commands:
cache Manage caches (CI status, default branch)
status Manage branch status markers
approvals Manage command approvals
- help Print this message or the help of the given subcommand(s)
Options:
-h, --help
Print help (see a summary with '-h')
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ -v, --verbose
+ Show commands and debug info
+
```
## Setup Guide
@@ -916,7 +965,7 @@ Docs: <https://llm.datasette.io/> | <https://github.com/sigoden/aichat>
```text
wt step — Workflow building blocks
-Usage: step <COMMAND>
+Usage: wt step [OPTIONS] <COMMAND>
Commands:
commit Commit changes with LLM commit message
@@ -928,11 +977,14 @@ Commands:
pre-commit Run pre-commit hook
pre-merge Run pre-merge hook
post-merge Run post-merge hook
- help Print this message or the help of the given subcommand(s)
Options:
- -h, --help
- Print help
+ -h, --help Print help
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
```
<!-- END AUTO-GENERATED -->
diff --git a/src/help_resolver.rs b/src/help_resolver.rs
deleted file mode 100644
index 3e8567313..000000000
--- a/src/help_resolver.rs
+++ /dev/null
@@ -1,73 +0,0 @@
-//! Resolves which subcommand's help to display based on argv.
-//!
-//! Walks through command-line arguments to find the deepest matching subcommand,
-//! ignoring flags and their values.
-
-use clap::Command;
-
-/// Walk argv and descend into subcommands; ignore flags and values
-pub fn resolve_target_command(
- cmd: &mut Command,
- argv: impl IntoIterator<Item = String>,
-) -> &mut Command {
- // First pass: collect subcommand path by examining argv
- let subcommand_path = extract_subcommand_path(cmd, argv);
-
- // Second pass: navigate to the target command
- navigate_to_command(cmd, &subcommand_path)
-}
-
-/// Extract the sequence of subcommand names from argv
-fn extract_subcommand_path(
- base_cmd: &Command,
- argv: impl IntoIterator<Item = String>,
-) -> Vec<String> {
- let mut it = argv.into_iter().peekable();
- let _bin = it.next(); // skip program name
- let mut path = Vec::new();
- let mut current_cmd = base_cmd;
-
- while let Some(tok) = it.next() {
- if tok == "-h" || tok == "--help" {
- break;
- }
- if tok.starts_with('-') {
- // skip flag + its possible value (best-effort)
- if let Some(next) = it.peek()
- && !next.starts_with('-')
- && !is_subcommand(current_cmd, next)
- {
- let _ = it.next();
- }
- continue;
- }
- // Check if this is a subcommand
- if let Some(sub) = find_subcommand(current_cmd, &tok) {
- path.push(tok);
- current_cmd = sub;
- } else {
- // Token isn't a subcommand, stop searching
- break;
- }
- }
-
- path
-}
-
-/// Navigate to a subcommand by following a path
-fn navigate_to_command<'a>(mut cmd: &'a mut Command, path: &[String]) -> &'a mut Command {
- for name in path {
- cmd = cmd.find_subcommand_mut(name).unwrap();
- }
- cmd
-}
-
-fn is_subcommand(cmd: &Command, name: &str) -> bool {
- cmd.get_subcommands()
- .any(|c| c.get_name() == name || c.get_visible_aliases().any(|a| a == name))
-}
-
-fn find_subcommand<'a>(cmd: &'a Command, name: &str) -> Option<&'a Command> {
- cmd.get_subcommands()
- .find(|c| c.get_name() == name || c.get_visible_aliases().any(|a| a == name))
-}
diff --git a/src/main.rs b/src/main.rs
index b132b89d8..06dfbed10 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -12,7 +12,6 @@ mod commands;
mod completion;
mod display;
pub(crate) mod help_pager;
-mod help_resolver;
mod llm;
mod md_help;
mod output;
@@ -39,7 +38,14 @@ use cli::{
};
use worktrunk::HookType;
-/// Try to handle --help flag with pager before clap processes it
+/// Custom help handling for pager support and markdown rendering.
+///
+/// We intercept help requests to provide:
+/// 1. **Pager support**: Help is shown through `less` (like git)
+/// 2. **Markdown rendering**: `## Headers` become green, code blocks are dimmed
+///
+/// Uses `Error::render()` to get clap's pre-formatted help, which already
+/// respects `-h` (short) vs `--help` (long) distinction.
fn maybe_handle_help_with_pager() -> bool {
use clap::ColorChoice;
use clap::error::ErrorKind;
@@ -49,7 +55,9 @@ fn maybe_handle_help_with_pager() -> bool {
// Check for --help-md flag (output raw markdown without ANSI rendering)
if args.iter().any(|a| a == "--help-md") {
let mut cmd = cli::build_command();
- // Filter out --help-md and add --help for clap
+ cmd = cmd.color(ColorChoice::Never); // No ANSI codes for raw markdown
+
+ // Replace --help-md with --help for clap
let filtered_args: Vec<String> = args
.iter()
.map(|a| {
@@ -60,29 +68,33 @@ fn maybe_handle_help_with_pager() -> bool {
}
})
.collect();
- let target = help_resolver::resolve_target_command(&mut cmd, filtered_args);
- let help = target.render_long_help().to_string(); // Raw markdown, no ANSI
- println!("{}", help);
- process::exit(0);
+
+ if let Err(err) = cmd.try_get_matches_from_mut(filtered_args)
+ && matches!(
+ err.kind(),
+ ErrorKind::DisplayHelp | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
+ )
+ {
+ // err.render() returns the help text clap already built
+ println!("{}", err.render());
+ process::exit(0);
+ }
+ // Fall through if not a help request
}
let mut cmd = cli::build_command();
- cmd = cmd.color(ColorChoice::Always); // Force clap to always emit ANSI codes
-
- // DON'T render markdown yet - let clap generate help first
+ cmd = cmd.color(ColorChoice::Always); // Force clap to emit ANSI codes
match cmd.try_get_matches_from_mut(args) {
Ok(_) => false, // Normal args, not help
Err(err) => {
match err.kind() {
- ErrorKind::DisplayHelp
- | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
- | ErrorKind::MissingSubcommand => {
- // Re-resolve which subcommand's help user asked for
- let target = help_resolver::resolve_target_command(&mut cmd, std::env::args());
- let mut help = target.render_long_help().to_string(); // StyledStr -> string (contains raw markdown)
-
- // NOW render markdown sections to ANSI
+ ErrorKind::DisplayHelp | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand => {
+ // err.render() contains the correctly formatted help
+ // (short for -h, long for --help) - no need to re-parse argv
+ let mut help = err.render().to_string();
+
+ // Render markdown sections to ANSI
help = md_help::render_markdown_in_help(&help);
if let Err(e) = help_pager::show_help_in_pager(&help) {
@@ -92,13 +104,11 @@ fn maybe_handle_help_with_pager() -> bool {
process::exit(0);
}
ErrorKind::DisplayVersion => {
- // Version display
println!("{}", err);
process::exit(0);
}
_ => {
- // Not help or version - this will be re-parsed by Cli::parse() below
- // which will handle the error with proper ANSI formatting
+ // Not help or version - will be re-parsed by Cli::parse()
false
}
}
diff --git a/tests/integration_tests/help.rs b/tests/integration_tests/help.rs
index 5f7a02bfb..d838d4d05 100644
--- a/tests/integration_tests/help.rs
+++ b/tests/integration_tests/help.rs
@@ -1,7 +1,10 @@
-//! Snapshot tests for top-level `--help` output.
+//! Snapshot tests for `-h` (short) and `--help` (long) output.
//!
-//! These ensure our compact help formatting stays stable across releases and
+//! These ensure our help formatting stays stable across releases and
//! catches accidental regressions in wording or wrapping.
+//!
+//! - Short help (`-h`): Compact format, single-line options
+//! - Long help (`--help`): Verbose format with `after_long_help` content
use crate::common::wt_command;
use insta::Settings;
@@ -17,50 +20,102 @@ fn snapshot_help(test_name: &str, args: &[&str]) {
});
}
+// =============================================================================
+// Root command (wt)
+// =============================================================================
+
+#[test]
+fn help_root_short() {
+ snapshot_help("help_root_short", &["-h"]);
+}
+
#[test]
-fn help_root() {
- snapshot_help("help_root", &["--help"]);
+fn help_root_long() {
+ snapshot_help("help_root_long", &["--help"]);
}
#[test]
fn help_no_args() {
- // Running `wt` with no args should show help and exit 0
+ // Running `wt` with no args should show short help and exit 0
snapshot_help("help_no_args", &[]);
}
+// =============================================================================
+// Major commands - short and long variants
+// =============================================================================
+
#[test]
-fn help_config_shell() {
- snapshot_help("help_config_shell", &["config", "shell", "--help"]);
+fn help_config_short() {
+ snapshot_help("help_config_short", &["config", "-h"]);
}
#[test]
-fn help_config() {
- snapshot_help("help_config", &["config", "--help"]);
+fn help_config_long() {
+ snapshot_help("help_config_long", &["config", "--help"]);
}
#[test]
-fn help_beta() {
- snapshot_help("help_beta", &["beta", "--help"]);
+fn help_list_short() {
+ snapshot_help("help_list_short", &["list", "-h"]);
+}
+
+#[test]
+fn help_list_long() {
+ snapshot_help("help_list_long", &["list", "--help"]);
+}
+
+#[test]
+fn help_switch_short() {
+ snapshot_help("help_switch_short", &["switch", "-h"]);
+}
+
+#[test]
+fn help_switch_long() {
+ snapshot_help("help_switch_long", &["switch", "--help"]);
+}
+
+#[test]
+fn help_remove_short() {
+ snapshot_help("help_remove_short", &["remove", "-h"]);
+}
+
+#[test]
+fn help_remove_long() {
+ snapshot_help("help_remove_long", &["remove", "--help"]);
+}
+
+#[test]
+fn help_merge_short() {
+ snapshot_help("help_merge_short", &["merge", "-h"]);
}
#[test]
-fn help_list() {
- snapshot_help("help_list", &["list", "--help"]);
+fn help_merge_long() {
+ snapshot_help("help_merge_long", &["merge", "--help"]);
}
#[test]
-fn help_switch() {
- snapshot_help("help_switch", &["switch", "--help"]);
+fn help_step_short() {
+ snapshot_help("help_step_short", &["step", "-h"]);
}
#[test]
-fn help_remove() {
- snapshot_help("help_remove", &["remove", "--help"]);
+fn help_step_long() {
+ snapshot_help("help_step_long", &["step", "--help"]);
}
+// =============================================================================
+// Config subcommands (long help only - these are less frequently accessed)
+// =============================================================================
+
#[test]
-fn help_merge() {
- snapshot_help("help_merge", &["merge", "--help"]);
+fn help_config_shell() {
+ snapshot_help("help_config_shell", &["config", "shell", "--help"]);
+}
+
+#[test]
+fn help_beta() {
+ snapshot_help("help_beta", &["beta", "--help"]);
}
#[test]
diff --git a/tests/snapshots/integration__integration_tests__help__help_beta.snap b/tests/snapshots/integration__integration_tests__help__help_beta.snap
index 101b582b0..c62621b4d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_beta.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_beta.snap
@@ -9,6 +9,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_BIN: ""
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -25,15 +26,9 @@ Commands:
statusline Single-line status for shell prompts
Options:
- -h, --help
- Print help
+ -h, --help Print help
Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose
- Show commands and debug info
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_config.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
similarity index 98%
rename from tests/snapshots/integration__integration_tests__help__help_config.snap
rename to tests/snapshots/integration__integration_tests__help__help_config_long.snap
index c3cbb867c..8113772aa 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -9,6 +9,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_BIN: ""
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
index 3bd20c1ae..2c372fc19 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
@@ -10,6 +10,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_BIN: ""
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -27,15 +28,9 @@ Commands:
uninstall Remove shell integration from config files
Options:
- -h, --help
- Print help
+ -h, --help Print help
Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose
- Show commands and debug info
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_short.snap b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
new file mode 100644
index 000000000..6c3f98985
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
@@ -0,0 +1,38 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - config
+ - "-h"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt config - Manage configuration and shell integration
+Usage: wt config [OPTIONS] <COMMAND>
+
+Commands:
+ shell Shell integration setup
+ create Create global configuration file
+ show Show configuration files & locations
+ cache Manage caches (CI status, default branch)
+ status Manage branch status markers
+ approvals Manage command approvals
+
+Options:
+ -h, --help Print help (see more with '--help')
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_list.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
similarity index 100%
rename from tests/snapshots/integration__integration_tests__help__help_list.snap
rename to tests/snapshots/integration__integration_tests__help__help_list_long.snap
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_short.snap b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
new file mode 100644
index 000000000..756dc5f9e
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
@@ -0,0 +1,35 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - list
+ - "-h"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt list - List worktrees and optionally branches
+Usage: wt list [OPTIONS]
+
+Options:
+ --format <FORMAT> Output format (table, json) [default: table]
+ --branches Include branches without worktrees
+ --remotes Include remote branches
+ --full Show CI, conflicts, diffs
+ --progressive Show fast info immediately, update with slow info
+ -h, --help Print help (see more with '--help')
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
similarity index 98%
rename from tests/snapshots/integration__integration_tests__help__help_merge.snap
rename to tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index bb8ea6e0f..044c12b31 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -9,6 +9,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_BIN: ""
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
new file mode 100644
index 000000000..c1c4e6091
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
@@ -0,0 +1,39 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - merge
+ - "-h"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt merge - Merge worktree into target branch
+Usage: wt merge [OPTIONS] [TARGET]
+
+Arguments:
+ [TARGET] Target branch
+
+Options:
+ --no-squash Skip commit squashing
+ --no-commit Skip commit, squash, and rebase
+ --no-remove Keep worktree after merge
+ --no-verify Skip all project hooks
+ -f, --force Skip approval prompts
+ --stage <STAGE> What to stage before committing [default: all] [possible values: all, tracked, none]
+ -h, --help Print help (see more with '--help')
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
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 df7c10978..8e80b85f2 100644
--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
@@ -7,6 +7,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_BIN: ""
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -27,20 +28,10 @@ Commands:
merge Merge worktree into target branch
Options:
- -h, --help
- Print help (see a summary with '-h')
-
- -V, --version
- Print version
+ -h, --help Print help (see more with '--help')
+ -V, --version Print version
Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose
- Show commands and debug info
-
-See wt config --help for configuration file locations and setup.
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
similarity index 100%
rename from tests/snapshots/integration__integration_tests__help__help_remove.snap
rename to tests/snapshots/integration__integration_tests__help__help_remove_long.snap
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
new file mode 100644
index 000000000..e6abf7b05
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -0,0 +1,36 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - remove
+ - "-h"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt remove - Remove worktree and branch
+Usage: wt remove [OPTIONS] [WORKTREES]...
+
+Arguments:
+ [WORKTREES]... Worktree or branch (@ for current)
+
+Options:
+ --no-delete-branch Keep branch after removal
+ -D, --force-delete Delete unmerged branches
+ --no-background Run removal in foreground
+ -h, --help Print help (see more with '--help')
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_root.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
similarity index 96%
rename from tests/snapshots/integration__integration_tests__help__help_root.snap
rename to tests/snapshots/integration__integration_tests__help__help_root_long.snap
index 716f945a5..cb898cdab 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -8,6 +8,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_BIN: ""
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_short.snap b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
new file mode 100644
index 000000000..24e4c9184
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
@@ -0,0 +1,38 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - "-h"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt - Git worktree management
+Usage: wt [OPTIONS] <COMMAND>
+
+Commands:
+ config Manage configuration and shell integration
+ step Workflow building blocks
+ list List worktrees and optionally branches
+ switch Switch to a worktree
+ remove Remove worktree and branch
+ merge Merge worktree into target branch
+
+Options:
+ -h, --help Print help (see more with '--help')
+ -V, --version Print version
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_long.snap b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
new file mode 100644
index 000000000..68345b700
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
@@ -0,0 +1,41 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - step
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt step - Workflow building blocks
+Usage: wt step [OPTIONS] <COMMAND>
+
+Commands:
+ commit Commit changes with LLM commit message
+ squash Squash commits with LLM commit message
+ push Push changes to local target branch
+ rebase Rebase onto target
+ post-create Run post-create hook
+ post-start Run post-start hook
+ pre-commit Run pre-commit hook
+ pre-merge Run pre-merge hook
+ post-merge Run post-merge hook
+
+Options:
+ -h, --help Print help
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_short.snap b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
new file mode 100644
index 000000000..9a698d6db
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
@@ -0,0 +1,41 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - step
+ - "-h"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt step - Workflow building blocks
+Usage: wt step [OPTIONS] <COMMAND>
+
+Commands:
+ commit Commit changes with LLM commit message
+ squash Squash commits with LLM commit message
+ push Push changes to local target branch
+ rebase Rebase onto target
+ post-create Run post-create hook
+ post-start Run post-start hook
+ pre-commit Run pre-commit hook
+ pre-merge Run pre-merge hook
+ post-merge Run post-merge hook
+
+Options:
+ -h, --help Print help
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
similarity index 98%
rename from tests/snapshots/integration__integration_tests__help__help_switch.snap
rename to tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index 6146f2a40..d436b0ac0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -9,6 +9,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_BIN: ""
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
new file mode 100644
index 000000000..8a31502b9
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -0,0 +1,38 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - switch
+ - "-h"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_EDITOR: ""
+ SOURCE_DATE_EPOCH: "1735776000"
+ WORKTRUNK_BIN: ""
+ WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+wt switch - Switch to a worktree
+Usage: wt switch [OPTIONS] <BRANCH>
+
+Arguments:
+ <BRANCH> Branch, path, '@' (HEAD), '-' (previous), or '^' (main)
+
+Options:
+ -c, --create Create a new branch
+ -b, --base <BASE> Base branch
+ -x, --execute <EXECUTE> Command to run after switch
+ -f, --force Skip approval prompts
+ --no-verify Skip all project hooks
+ -h, --help Print help (see more with '--help')
+
+Global Options:
+ -C <path> Working directory for this command
+ --config <path> User config file path
+ -v, --verbose Show commands and debug info