Skip to content

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

feat(help): syntax-highlight code blocks in --help (#1365)

Maximilian Roose0067f064fc0
diff --git a/src/md_help.rs b/src/md_help.rs
index 71370ba56..67d4c8610 100644
--- a/src/md_help.rs
+++ b/src/md_help.rs
@@ -5,7 +5,9 @@ use crossterm::style::Attribute;
use termimad::{CompoundStyle, MadSkin, TableBorderChars};
use unicode_width::UnicodeWidthStr;
-use worktrunk::styling::{DEFAULT_HELP_WIDTH, wrap_styled_text};
+use worktrunk::styling::{
+ DEFAULT_HELP_WIDTH, format_bash_with_gutter, format_toml, format_with_gutter, wrap_styled_text,
+};
/// Table border style matching our help text format:
/// - Horizontal lines under headers with spaces between column segments
@@ -41,10 +43,11 @@ fn help_table_skin() -> MadSkin {
/// and headers are never wrapped (tables need full-width rows for alignment).
pub(crate) fn render_markdown_in_help_with_width(help: &str, width: Option<usize>) -> String {
let green = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- let dimmed = Style::new().dimmed();
let mut result = String::new();
let mut in_code_block = false;
+ let mut code_block_lang = String::new();
+ let mut code_block_lines: Vec<&str> = Vec::new();
let mut table_lines: Vec<&str> = Vec::new();
let lines: Vec<&str> = help.lines().collect();
@@ -61,15 +64,41 @@ pub(crate) fn render_markdown_in_help_with_width(help: &str, width: Option<usize
}
// Handle code fences
- if trimmed.starts_with("```") {
- in_code_block = !in_code_block;
+ if let Some(after_fence) = trimmed.strip_prefix("```") {
+ if !in_code_block {
+ // Opening fence — extract language identifier
+ code_block_lang = after_fence.trim().to_string();
+ code_block_lines.clear();
+ in_code_block = true;
+ } else {
+ // Closing fence — render collected code block with gutter
+ let content = code_block_lines.join("\n");
+ let formatted = match code_block_lang.as_str() {
+ "toml" => format_toml(&content),
+ "console" | "bash" | "sh" => format_bash_with_gutter(&content),
+ _ => {
+ // Dim the content before adding gutter (format_with_gutter
+ // doesn't style text; bash/toml formatters handle their own)
+ let dim = Style::new().dimmed();
+ let dimmed = code_block_lines
+ .iter()
+ .map(|l| format!("{dim}{l}{dim:#}"))
+ .collect::<Vec<_>>()
+ .join("\n");
+ format_with_gutter(&dimmed, None)
+ }
+ };
+ result.push_str(&formatted);
+ result.push('\n');
+ in_code_block = false;
+ }
i += 1;
continue;
}
- // Inside code blocks, render dimmed with indent
+ // Inside code blocks, collect lines for deferred rendering
if in_code_block {
- result.push_str(&format!(" {dimmed}{line}{dimmed:#}\n"));
+ code_block_lines.push(line);
i += 1;
continue;
}
@@ -150,9 +179,9 @@ pub(crate) fn render_markdown_in_help_with_width(help: &str, width: Option<usize
colorize_status_symbols(&result)
}
-/// Render a markdown table using termimad (for help text, adds 2-space indent)
+/// Render a markdown table using termimad (for help text, no indent)
fn render_table(lines: &[&str], max_width: Option<usize>) -> String {
- render_table_with_termimad(lines, " ", max_width)
+ render_table_with_termimad(lines, "", max_width)
}
/// Render a markdown table from markdown source string (no indent)
@@ -563,6 +592,17 @@ mod tests {
assert!(result.contains("after"));
}
+ #[test]
+ fn test_render_markdown_in_help_toml_code_block() {
+ let md = "```toml\n[section]\nkey = \"value\"\n```\nafter";
+ let result = render_markdown_in_help(md);
+ // TOML blocks get syntax highlighting with gutter
+ assert!(result.contains("section"));
+ assert!(result.contains("after"));
+ // Should have gutter (BrightWhite background = SGR 107)
+ assert!(result.contains("\u{1b}[107m"));
+ }
+
#[test]
fn test_render_markdown_in_help_html_comment() {
let md = "<!-- comment -->\nvisible";
diff --git a/src/styling/highlighting.rs b/src/styling/highlighting.rs
index 3559af5eb..3e830ed37 100644
--- a/src/styling/highlighting.rs
+++ b/src/styling/highlighting.rs
@@ -94,6 +94,7 @@ pub fn format_toml(content: &str) -> String {
// synoptic has built-in TOML support, so this always succeeds
let mut highlighter = from_extension("toml", 4).expect("synoptic supports TOML");
let gutter = super::GUTTER;
+ let dim = Style::new().dimmed();
let lines: Vec<String> = content.lines().map(|s| s.to_string()).collect();
// Process all lines through the highlighter
@@ -116,7 +117,8 @@ pub fn format_toml(content: &str) -> String {
if let Some(s) = style {
line_output.push_str(&format!("{s}{text}{s:#}"));
} else {
- line_output.push_str(&text);
+ // Unstyled tokens (keys, operators, whitespace) rendered dim
+ line_output.push_str(&format!("{dim}{text}{dim:#}"));
}
}
@@ -136,24 +138,35 @@ pub fn format_toml(content: &str) -> String {
/// - "table": table headers [...]
/// - "digit": numeric values
fn toml_token_style(kind: &str) -> Option<Style> {
+ // All styles include .dimmed() so highlighted tokens match the dim base text,
+ // consistent with bash_token_style(). We do NOT use .bold() because bold (SGR 1)
+ // and dim (SGR 2) are mutually exclusive in some terminals like Alacritty.
match kind {
- // Strings (quoted values)
- "string" => Some(Style::new().fg_color(Some(Color::Ansi(AnsiColor::Green)))),
+ // Strings (quoted values) - dim green
+ "string" => Some(
+ Style::new()
+ .fg_color(Some(Color::Ansi(AnsiColor::Green)))
+ .dimmed(),
+ ),
- // Comments (hash-prefixed)
+ // Comments (hash-prefixed) - dim (no color, just subdued)
"comment" => Some(Style::new().dimmed()),
- // Table headers [table] and [[array]]
+ // Table headers [table] and [[array]] - dim cyan
"table" => Some(
Style::new()
.fg_color(Some(Color::Ansi(AnsiColor::Cyan)))
- .bold(),
+ .dimmed(),
),
- // Booleans and numbers
- "boolean" | "digit" => Some(Style::new().fg_color(Some(Color::Ansi(AnsiColor::Yellow)))),
+ // Booleans and numbers - dim yellow
+ "boolean" | "digit" => Some(
+ Style::new()
+ .fg_color(Some(Color::Ansi(AnsiColor::Yellow)))
+ .dimmed(),
+ ),
- // Everything else (operators, punctuation, keys)
+ // Everything else (operators, punctuation, keys) - no styling (will use base dim)
_ => None,
}
}
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap b/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
index 21d2935be..7ddf08f55 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__config_show_theme__show_theme.snap
@@ -43,8 +43,8 @@ exit_code: 0
  expected `=`, found newline at line 3 column 1
○ Gutter formatting (config):
-  [commit.generation]
-  command = "llm --model claude"
+  [commit.generation]
+  command = "llm --model claude"
○ Gutter formatting (shell code):
  eval "$(wt config shell init bash)"
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_always_regenerates_migration_file.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_always_regenerates_migration_file.snap
index 7669b1f05..873912f48 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_always_regenerates_migration_file.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_always_regenerates_migration_file.snap
@@ -57,7 +57,7 @@ exit_code: 0
  -post-create = "ln -sf {{ main_worktree }}/node_modules"
  +post-create = "ln -sf {{ repo }}/node_modules"
○ Current config:
-  post-create = "ln -sf {{ main_worktree }}/node_modules"
+  post-create = "ln -sf {{ main_worktree }}/node_modules"
SHELL INTEGRATION
▲ Shell integration not active
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_claude_available_plugin_not_installed.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_claude_available_plugin_not_installed.snap
index 99ea7b6b4..314ce005a 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_claude_available_plugin_not_installed.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_claude_available_plugin_not_installed.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap
index 063585167..3f0becabb 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_deprecation_details.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -55,8 +56,8 @@ exit_code: 0
  +worktree-path = "../{{ repo }}.{{ branch }}"
  +post-create = "ln -sf {{ repo_path }}/node_modules"
○ Current config:
-  worktree-path = "../{{ main_worktree }}.{{ branch }}"
-  post-create = "ln -sf {{ repo_root }}/node_modules"
+  worktree-path = "../{{ main_worktree }}.{{ branch }}"
+  post-create = "ln -sf {{ repo_root }}/node_modules"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap
index 4e30e8614..2afa6bd86 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_project_commit_generation_deprecations.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -56,10 +57,10 @@ exit_code: 0
  +[projects."github.com/example/repo".commit.generation]
  command = "llm -m gpt-4"
○ Current config:
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
 
-  [projects."github.com/example/repo".commit-generation]
-  command = "llm -m gpt-4"
+  [projects."github.com/example/repo".commit-generation]
+  command = "llm -m gpt-4"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_empty_project_config.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_empty_project_config.snap
index 55dfe674d..05eee7312 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_empty_project_config.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_empty_project_config.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_from_linked_worktree_shows_main_worktree_hint.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_from_linked_worktree_shows_main_worktree_hint.snap
index 4d1208f11..dc514fd7e 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_from_linked_worktree_shows_main_worktree_hint.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_from_linked_worktree_shows_main_worktree_hint.snap
@@ -50,7 +50,7 @@ exit_code: 0
↳ To apply:
  wt -C _REPO_ config update
○ Current config:
-  post-create = "ln -sf {{ main_worktree }}/node_modules"
+  post-create = "ln -sf {{ main_worktree }}/node_modules"
SHELL INTEGRATION
▲ Shell integration not active
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_full_command_not_found.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_full_command_not_found.snap
index 50dda6d33..e275b713f 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_full_command_not_found.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_full_command_not_found.snap
@@ -20,6 +20,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -32,7 +33,7 @@ info:
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_LATEST_VERSION: 0.24.1
+ WORKTRUNK_TEST_LATEST_VERSION: 0.28.2
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
@@ -44,10 +45,10 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
 
-  [commit.generation]
-  command = "nonexistent-llm-command-12345 -m test-model"
+  [commit.generation]
+  command = "nonexistent-llm-command-12345 -m test-model"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_full_not_configured.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_full_not_configured.snap
index 4f2bd1e37..09e8b84e3 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_full_not_configured.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_full_not_configured.snap
@@ -20,6 +20,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -32,7 +33,7 @@ info:
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_LATEST_VERSION: 0.24.1
+ WORKTRUNK_TEST_LATEST_VERSION: 0.28.2
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
@@ -44,7 +45,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_full_update_available.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_full_update_available.snap
index 4e3e9f145..0ef830e59 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_full_update_available.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_full_update_available.snap
@@ -20,6 +20,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -44,7 +45,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_full_version_check_unavailable.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_full_version_check_unavailable.snap
index 861cbedb1..086df7246 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_full_version_check_unavailable.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_full_version_check_unavailable.snap
@@ -20,6 +20,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -44,7 +45,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_github_remote.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_github_remote.snap
index 6f93454ad..18533a552 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_github_remote.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_github_remote.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_gitlab_remote.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_gitlab_remote.snap
index 6f93454ad..18533a552 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_gitlab_remote.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_gitlab_remote.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_project_toml.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_project_toml.snap
index 2fface884..2c8f355c8 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_project_toml.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_project_toml.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
@@ -52,7 +53,7 @@ exit_code: 0
  1 | invalid = [unclosed bracket
  | ^
  unclosed array, expected `]`
-  invalid = [unclosed bracket
+  invalid = [unclosed bracket
SHELL INTEGRATION
▲ Shell integration not active
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap
index c8f7cefaa..3a17ccccd 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_system_config.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -48,7 +49,7 @@ exit_code: 0
  1 | invalid = [toml
  | ^
  unclosed array, expected `]`
-  invalid = [toml
+  invalid = [toml
USER CONFIG ~/.config/worktrunk/config.toml
↳ Empty file (using defaults)
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap
index 0cc9059b2..02b4ce0c2 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_invalid_user_toml.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -48,7 +49,7 @@ exit_code: 0
  1 | this is not valid toml {{{
  | ^
  key with no value, expected `=`
-  this is not valid toml {{{
+  this is not valid toml {{{
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_no_project_config.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_no_project_config.snap
index 6f93454ad..18533a552 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_no_project_config.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_no_project_config.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_outside_git_repo.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_outside_git_repo.snap
index 907b633de..30fef64f5 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_outside_git_repo.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_outside_git_repo.snap
@@ -14,6 +14,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -37,7 +38,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG Not in a git repository
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_plugin_installed.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_plugin_installed.snap
index c44b8a03b..31b43aefd 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_plugin_installed.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_plugin_installed.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_shell_integration_active.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_shell_integration_active.snap
index 1121434f1..25541a460 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_shell_integration_active.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_shell_integration_active.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -43,7 +44,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_statusline_configured.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_statusline_configured.snap
index f55d2ca53..47f345973 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_statusline_configured.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_statusline_configured.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
index f2e6a6662..781500e1d 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -43,10 +44,10 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
▲ Key ci belongs in project config (will be ignored)
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
 
-  [ci]
-  platform = "github"
+  [ci]
+  platform = "github"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
index 87389ed8c..c69752be9 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
@@ -61,8 +62,8 @@ exit_code: 0
  +command = "claude"
▲ Key commit-generation belongs in user config (will be ignored)
○ Current config:
-  [commit-generation]
-  command = "claude"
+  [commit-generation]
+  command = "claude"
SHELL INTEGRATION
▲ Shell integration not active
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_project_keys.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_project_keys.snap
index 31e704e45..0f0a7b403 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_project_keys.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_project_keys.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,13 +43,13 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
▲ Unknown key post-merge-command will be ignored
-  [post-merge-command]
-  deploy = "task deploy"
+  [post-merge-command]
+  deploy = "task deploy"
SHELL INTEGRATION
▲ Shell integration not active
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap
index 677267d6a..e62a8caa5 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_warns_unknown_user_keys.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -43,10 +44,10 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
▲ Unknown key commit-gen will be ignored
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
 
-  [commit-gen]
-  command = "llm"
+  [commit-gen]
+  command = "llm"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_whitespace_only_project_config.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_whitespace_only_project_config.snap
index 55dfe674d..05eee7312 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_whitespace_only_project_config.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_whitespace_only_project_config.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,7 +43,7 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_with_project_config.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_with_project_config.snap
index 5ffcc04fb..0f8b2337b 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_with_project_config.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_with_project_config.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,14 +43,14 @@ exit_code: 0
----- stderr -----
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
↳ Optional system config not found @ /etc/xdg/worktrunk/config.toml
PROJECT CONFIG _REPO_/.config/wt.toml
-  post-create = "npm install"
+  post-create = "npm install"
 
-  [post-start]
-  server = "npm run dev"
+  [post-start]
+  server = "npm run dev"
SHELL INTEGRATION
▲ Shell integration not active
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_with_system_config.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_with_system_config.snap
index e64fda4c9..fe0703644 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_with_system_config.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_with_system_config.snap
@@ -19,6 +19,7 @@ info:
LANG: C
LC_ALL: C
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ NO_COLOR: ""
PATH: "[PATH]"
PSModulePath: ""
RUST_LOG: warn
@@ -42,15 +43,15 @@ exit_code: 0
----- stderr -----
SYSTEM CONFIG [PROJECT_ID]
-  [merge]
-  squash = true
-  verify = true
+  [merge]
+  squash = true
+  verify = true
 
-  [commit.generation]
-  command = "company-llm-tool"
+  [commit.generation]
+  command = "company-llm-tool"
USER CONFIG ~/.config/worktrunk/config.toml
-  worktree-path = "../{{ repo }}.{{ branch }}"
+  worktree-path = "../{{ repo }}.{{ branch }}"
PROJECT CONFIG _REPO_/.config/wt.toml
↳ Not found
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
index cc8cfb5b5..240bc593d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -57,323 +57,323 @@ Usage: wt config create [OPTIONS]
Creates ~/.config/worktrunk/config.toml with the following content:
- # # User Configuration
- #
- # Create with `wt config create`.
- #
- # Location:
- #
- # - macOS/Linux: `~/.config/worktrunk/config.toml` (or `$XDG_CONFIG_HOME` if set)
- # - Windows: `%APPDATA%\worktrunk\config.toml`
- #
- # ## Worktree path template
- #
- # Controls where new worktrees are created.
- #
- # **Variables:**
- #
- # - `{{ repo_path }}` — absolute path to the repository (e.g., `/Users/me/code/myproject`)
- # - `{{ repo }}` — repository directory name (e.g., `myproject`)
- # - `{{ branch }}` — raw branch name (e.g., `feature/auth`)
- # - `{{ branch | sanitize }}` — filesystem-safe: `/` and `\` become `-` (e.g., `feature-auth`)
- # - `{{ branch | sanitize_db }}` — database-safe: lowercase, underscores, hash suffix (e.g., `feature_auth_x7k`)
- #
- # **Examples** for repo at `~/code/myproject`, branch `feature/auth`:
- #
- # # Default — sibling directory
- # # Creates: ~/code/myproject.feature-auth
- # # worktree-path = "{{ repo_path }}/../{{ repo }}.{{ branch | sanitize }}"
- #
- # # Inside the repository
- # # Creates: ~/code/myproject/.worktrees/feature-auth
- # worktree-path = "{{ repo_path }}/.worktrees/{{ branch | sanitize }}"
- #
- # # Centralized worktrees directory
- # # Creates: ~/worktrees/myproject/feature-auth
- # worktree-path = "~/worktrees/{{ repo }}/{{ branch | sanitize }}"
- #
- # `~` expands to the home directory. Relative paths are relative to the repository root.
- #
- # ## LLM commit messages
- #
- # Generate commit messages automatically during merge. Requires an external CLI tool.
- #
- # See LLM commits docs (https://worktrunk.dev/llm-commits/) for setup and Custom prompt templates (#custom-prompt-templates) for template customization.
- #
- # ## Command config
- #
- # ### List
- #
- # Persistent flag values for `wt list`. Override on command line as needed.
- #
- # [list]
- # summary = false # Enable LLM branch summaries (requires [commit.generation])
- #
- # full = false # Show CI, main…± diffstat, and LLM summaries (--full)
- # branches = false # Include branches without worktrees (--branches)
- # remotes = false # Include remote-only branches (--remotes)
- #
- # ### Commit
- #
- # Shared by `wt step commit`, `wt step squash`, and `wt merge`.
- #
- # [commit]
- # stage = "all" # What to stage before commit: "all", "tracked", or "none"
- #
- # ### Merge
- #
- # All flags are on by default. Set to false to change default behavior.
- #
- # [merge]
- # squash = true # Squash commits into one (--no-squash to preserve history)
- # commit = true # Commit uncommitted changes first (--no-commit to skip)
- # rebase = true # Rebase onto target before merge (--no-rebase to skip)
- # remove = true # Remove worktree after merge (--no-remove to keep)
- # verify = true # Run project hooks (--no-verify to skip)
- #
- # ### Switch picker
- #
- # Configuration for `wt switch` interactive picker.
- #
- # [switch.picker]
- # # Pager command for diff preview (overrides git's core.pager)
- # # pager = "delta --paging=never"
- #
- # # Timeout (ms) for git commands during picker loading (default: 200)
- # # Lower values show the TUI faster; 0 disables timeouts
- # # timeout-ms = 200
- #
- # ### Aliases
- #
- # Command templates that run with `wt step <name>`. See `wt step` aliases (https://worktrunk.dev/step/#aliases) for usage and flags.
- #
- # [aliases]
- # greet = "echo Hello from {{ branch }}"
- # url = "echo http://localhost:{{ branch | hash_port }}"
- #
- # Aliases defined here apply to all projects. For project-specific aliases, use the project config (https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.
- #
- # ### User project-specific settings
- #
- # For context:
- #
- # - Project config (https://worktrunk.dev/config/#project-configuration) settings are shared with teammates.
- # - User configs generally apply to all projects.
- # - User configs _also_ has a `[projects]` table which holds project-specific settings for the user, such as worktree layout and setting overrides. That's what this section covers.
- #
- # Entries are keyed by project identifier (e.g., `github.com/user/repo`).
- #
- # #### Setting overrides (Experimental)
- #
- # Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value. Hooks append — both global and per-project hooks run. Aliases merge — per-project aliases override global aliases on name collision.
- #
- # [projects."github.com/user/repo"]
- # worktree-path = ".worktrees/{{ branch | sanitize }}"
- # list.full = true
- # merge.squash = false
- # post-create.env = "cp .env.example .env"
- # aliases.deploy = "make deploy BRANCH={{ branch }}"
- #
- # ### Custom prompt templates
- #
- # Templates use minijinja (https://docs.rs/minijinja/) syntax.
- #
- # #### Commit template
- #
- # Available variables:
- #
- # - `{{ git_diff }}`, `{{ git_diff_stat }}` — diff content
- # - `{{ branch }}`, `{{ repo }}` — context
- # - `{{ recent_commits }}` — recent commit messages
- #
- # Default template:
- #
- # <!-- DEFAULT_TEMPLATE_START -->
- # [commit.generation]
- # template = """
- # Write a commit message for the staged changes below.
- #
- # <format>
- # - Subject line under 50 chars
- # - For material changes, add a blank line then a body paragraph explaining the change
- # - Output only the commit message, no quotes or code blocks
- # </format>
- #
- # <style>
- # - Imperative mood: "Add feature" not "Added feature"
- # - Match recent commit style (conventional commits if used)
- # - Describe the change, not the intent or benefit
- # </style>
- #
- # <diffstat>
- # {{ git_diff_stat }}
- # </diffstat>
- #
- # <diff>
- # {{ git_diff }}
- # </diff>
- #
- # <context>
- # Branch: {{ branch }}
- # {% if recent_commits %}<recent_commits>
- # {% for commit in recent_commits %}- {{ commit }}
- # {% endfor %}</recent_commits>{% endif %}
- # </context>
- #
- # """
- # <!-- DEFAULT_TEMPLATE_END -->
- #
- # #### Squash template
- #
- # Available variables (in addition to commit template variables):
- #
- # - `{{ commits }}` — list of commits being squashed
- # - `{{ target_branch }}` — merge target branch
- #
- # Default template:
- #
- # <!-- DEFAULT_SQUASH_TEMPLATE_START -->
- # [commit.generation]
- # squash-template = """
- # Combine these commits into a single commit message.
- #
- # <format>
- # - Subject line under 50 chars
- # - For material changes, add a blank line then a body paragraph explaining the change
- # - Output only the commit message, no quotes or code blocks
- # </format>
- #
- # <style>
- # - Imperative mood: "Add feature" not "Added feature"
- # - Match the style of commits being squashed (conventional commits if used)
- # - Describe the change, not the intent or benefit
- # </style>
- #
- # <commits branch="{{ branch }}" target="{{ target_branch }}">
- # {% for commit in commits %}- {{ commit }}
- # {% endfor %}</commits>
- #
- # <diffstat>
- # {{ git_diff_stat }}
- # </diffstat>
- #
- # <diff>
- # {{ git_diff }}
- # </diff>
- #
- # """
- # <!-- DEFAULT_SQUASH_TEMPLATE_END -->
+  # # User Configuration
+  #
+  # Create with `wt config create`.
+  #
+  # Location:
+  #
+  # - macOS/Linux: `~/.config/worktrunk/config.toml` (or `$XDG_CONFIG_HOME` if set)
+  # - Windows: `%APPDATA%\worktrunk\config.toml`
+  #
+  # ## Worktree path template
+  #
+  # Controls where new worktrees are created.
+  #
+  # **Variables:**
+  #
+  # - `{{ repo_path }}` — absolute path to the repository (e.g., `/Users/me/code/myproject`)
+  # - `{{ repo }}` — repository directory name (e.g., `myproject`)
+  # - `{{ branch }}` — raw branch name (e.g., `feature/auth`)
+  # - `{{ branch | sanitize }}` — filesystem-safe: `/` and `\` become `-` (e.g., `feature-auth`)
+  # - `{{ branch | sanitize_db }}` — database-safe: lowercase, underscores, hash suffix (e.g., `feature_auth_x7k`)
+  #
+  # **Examples** for repo at `~/code/myproject`, branch `feature/auth`:
+  #
+  # # Default — sibling directory
+  # # Creates: ~/code/myproject.feature-auth
+  # # worktree-path = "{{ repo_path }}/../{{ repo }}.{{ branch | sanitize }}"
+  #
+  # # Inside the repository
+  # # Creates: ~/code/myproject/.worktrees/feature-auth
+  # worktree-path = "{{ repo_path }}/.worktrees/{{ branch | sanitize }}"
+  #
+  # # Centralized worktrees directory
+  # # Creates: ~/worktrees/myproject/feature-auth
+  # worktree-path = "~/worktrees/{{ repo }}/{{ branch | sanitize }}"
+  #
+  # `~` expands to the home directory. Relative paths are relative to the repository root.
+  #
+  # ## LLM commit messages
+  #
+  # Generate commit messages automatically during merge. Requires an external CLI tool.
+  #
+  # See LLM commits docs (https://worktrunk.dev/llm-commits/) for setup and Custom prompt templates (#custom-prompt-templates) for template customization.
+  #
+  # ## Command config
+  #
+  # ### List
+  #
+  # Persistent flag values for `wt list`. Override on command line as needed.
+  #
+  # [list]
+  # summary = false # Enable LLM branch summaries (requires [commit.generation])
+  #
+  # full = false # Show CI, main…± diffstat, and LLM summaries (--full)
+  # branches = false # Include branches without worktrees (--branches)
+  # remotes = false # Include remote-only branches (--remotes)
+  #
+  # ### Commit
+  #
+  # Shared by `wt step commit`, `wt step squash`, and `wt merge`.
+  #
+  # [commit]
+  # stage = "all" # What to stage before commit: "all", "tracked", or "none"
+  #
+  # ### Merge
+  #
+  # All flags are on by default. Set to false to change default behavior.
+  #
+  # [merge]
+  # squash = true # Squash commits into one (--no-squash to preserve history)
+  # commit = true # Commit uncommitted changes first (--no-commit to skip)
+  # rebase = true # Rebase onto target before merge (--no-rebase to skip)
+  # remove = true # Remove worktree after merge (--no-remove to keep)
+  # verify = true # Run project hooks (--no-verify to skip)
+  #
+  # ### Switch picker
+  #
+  # Configuration for `wt switch` interactive picker.
+  #
+  # [switch.picker]
+  # # Pager command for diff preview (overrides git's core.pager)
+  # # pager = "delta --paging=never"
+  #
+  # # Timeout (ms) for git commands during picker loading (default: 200)
+  # # Lower values show the TUI faster; 0 disables timeouts
+  # # timeout-ms = 200
+  #
+  # ### Aliases
+  #
+  # Command templates that run with `wt step <name>`. See `wt step` aliases (https://worktrunk.dev/step/#aliases) for usage and flags.
+  #
+  # [aliases]
+  # greet = "echo Hello from {{ branch }}"
+  # url = "echo http://localhost:{{ branch | hash_port }}"
+  #
+  # Aliases defined here apply to all projects. For project-specific aliases, use the project config (https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.
+  #
+  # ### User project-specific settings
+  #
+  # For context:
+  #
+  # - Project config (https://worktrunk.dev/config/#project-configuration) settings are shared with teammates.
+  # - User configs generally apply to all projects.
+  # - User configs _also_ has a `[projects]` table which holds project-specific settings for the user, such as worktree layout and setting overrides. That's what this section covers.
+  #
+  # Entries are keyed by project identifier (e.g., `github.com/user/repo`).
+  #
+  # #### Setting overrides (Experimental)
+  #
+  # Override global user config for a specific project. Scalar values (like `worktree-path`) replace the global value. Hooks append — both global and per-project hooks run. Aliases merge — per-project aliases override global aliases on name collision.
+  #
+  # [projects."github.com/user/repo"]
+  # worktree-path = ".worktrees/{{ branch | sanitize }}"
+  # list.full = true
+  # merge.squash = false
+  # post-create.env = "cp .env.example .env"
+  # aliases.deploy = "make deploy BRANCH={{ branch }}"
+  #
+  # ### Custom prompt templates
+  #
+  # Templates use minijinja (https://docs.rs/minijinja/) syntax.
+  #
+  # #### Commit template
+  #
+  # Available variables:
+  #
+  # - `{{ git_diff }}`, `{{ git_diff_stat }}` — diff content
+  # - `{{ branch }}`, `{{ repo }}` — context
+  # - `{{ recent_commits }}` — recent commit messages
+  #
+  # Default template:
+  #
+  # <!-- DEFAULT_TEMPLATE_START -->
+  # [commit.generation]
+  # template = """
+  # Write a commit message for the staged changes below.
+  #
+  # <format>
+  # - Subject line under 50 chars
+  # - For material changes, add a blank line then a body paragraph explaining the change
+  # - Output only the commit message, no quotes or code blocks
+  # </format>
+  #
+  # <style>
+  # - Imperative mood: "Add feature" not "Added feature"
+  # - Match recent commit style (conventional commits if used)
+  # - Describe the change, not the intent or benefit
+  # </style>
+  #
+  # <diffstat>
+  # {{ git_diff_stat }}
+  # </diffstat>
+  #
+  # <diff>
+  # {{ git_diff }}
+  # </diff>
+  #
+  # <context>
+  # Branch: {{ branch }}
+  # {% if recent_commits %}<recent_commits>
+  # {% for commit in recent_commits %}- {{ commit }}
+  # {% endfor %}</recent_commits>{% endif %}
+  # </context>
+  #
+  # """
+  # <!-- DEFAULT_TEMPLATE_END -->
+  #
+  # #### Squash template
+  #
+  # Available variables (in addition to commit template variables):
+  #
+  # - `{{ commits }}` — list of commits being squashed
+  # - `{{ target_branch }}` — merge target branch
+  #
+  # Default template:
+  #
+  # <!-- DEFAULT_SQUASH_TEMPLATE_START -->
+  # [commit.generation]
+  # squash-template = """
+  # Combine these commits into a single commit message.
+  #
+  # <format>
+  # - Subject line under 50 chars
+  # - For material changes, add a blank line then a body paragraph explaining the change
+  # - Output only the commit message, no quotes or code blocks
+  # </format>
+  #
+  # <style>
+  # - Imperative mood: "Add feature" not "Added feature"
+  # - Match the style of commits being squashed (conventional commits if used)
+  # - Describe the change, not the intent or benefit
+  # </style>
+  #
+  # <commits branch="{{ branch }}" target="{{ target_branch }}">
+  # {% for commit in commits %}- {{ commit }}
+  # {% endfor %}</commits>
+  #
+  # <diffstat>
+  # {{ git_diff_stat }}
+  # </diffstat>
+  #
+  # <diff>
+  # {{ git_diff }}
+  # </diff>
+  #
+  # """
+  # <!-- DEFAULT_SQUASH_TEMPLATE_END -->
Project config
With --project, creates .config/wt.toml in the current repository:
- # Worktrunk Project Configuration
- # Copy to: <repo>/.config/wt.toml
- #
- # Project-specific hooks that run automatically during worktree operations.
- # Check this file into git to share hooks across all developers.
- 
- # ============================================================================
- # Hook Formats
- # ============================================================================
- # All hooks support two formats:
- #
- # Single command:
- # post-create = "npm install"
- #
- # Named table (multiple commands):
- # [post-create]
- # deps = "npm install"
- # build = "npm run build"
- #
- # Named commands appear in output, making it easier to identify failures.
- 
- # ============================================================================
- # Template Variables — see https://worktrunk.dev/hook/#template-variables
- # ============================================================================
- # Common variables:
- # {{ repo }} - Repository directory name (e.g., "myproject")
- # {{ branch }} - Branch name (e.g., "feature/auth")
- # {{ worktree_path }} - Absolute path to worktree
- # {{ primary_worktree_path }} - Main worktree (or default branch worktree for bare repos)
- # {{ default_branch }} - Default branch name (e.g., "main")
- # {{ target }} - Target branch (merge hooks only)
- #
- # Filters:
- # {{ branch | sanitize }} - Replace / and \ with - (e.g., "feature-auth")
- # {{ branch | sanitize_db }} - Database-safe identifier with hash suffix (e.g., "feature_auth_x7k")
- # {{ branch | hash_port }} - Deterministic port 10000-19999
- 
- # ============================================================================
- # Hooks
- # ============================================================================
- 
- # Post-Create: Runs after worktree creation, BLOCKS until complete
- # Use for: installing dependencies, setting up databases, copying configs
- #
- # [post-create]
- # deps = "npm ci"
- # env = "cp .env.example .env"
- 
- # Post-Start: Runs in BACKGROUND after worktree creation (parallel)
- # Use for: dev servers, file watchers, background builds
- # Output logged to .git/wt-logs/{branch}-project-post-start-{name}.log
- #
- # [post-start]
- # server = "npm run dev -- --port {{ branch | hash_port }}"
- # watch = "npm run watch"
- 
- # Post-Switch: Runs in BACKGROUND after every switch (parallel)
- # Use for: terminal tab naming, tmux window titles, IDE notifications
- #
- # post-switch = "echo -ne '\\033]0;{{ branch }}\\007'"
- 
- # Pre-Commit: Runs before committing during merge, BLOCKS (fail-fast)
- # Use for: formatters, linters, quick checks
- #
- # [pre-commit]
- # format = "npm run format:check"
- # lint = "npm run lint"
- 
- # Pre-Merge: Runs before merging to target, BLOCKS (fail-fast)
- # Use for: tests, build verification
- #
- # [pre-merge]
- # test = "npm test"
- # build = "npm run build"
- 
- # Post-Merge: Runs after successful merge, BLOCKS
- # Use for: deployment, notifications
- #
- # post-merge = "echo 'Merged {{ branch }} to {{ target }}'"
- 
- # Pre-Remove: Runs before worktree removal, BLOCKS (fail-fast)
- # Use for: cleanup, stopping services
- #
- # pre-remove = "docker compose down"
- 
- # ============================================================================
- # Aliases (experimental) — run with `wt step <name>`
- # ============================================================================
- # Command templates that support the same variables as hooks.
- # Project-config aliases require command approval on first run.
- #
- # [aliases]
- # deploy = "make deploy BRANCH={{ branch }}"
- # url = "echo http://localhost:{{ branch | hash_port }}"
- 
- # ============================================================================
- # Dev Server URL (shown in `wt list`)
- # ============================================================================
- # [list]
- # url = "http://localhost:{{ branch | hash_port }}"
- 
- # ============================================================================
- # CI Platform Override
- # ============================================================================
- # Override CI platform detection for GitHub Enterprise or self-hosted GitLab
- # with custom domains where URL detection fails.
- #
- # [ci]
- # platform = "github" # or "gitlab"
+  # Worktrunk Project Configuration
+  # Copy to: <repo>/.config/wt.toml
+  #
+  # Project-specific hooks that run automatically during worktree operations.
+  # Check this file into git to share hooks across all developers.
+  
+  # ============================================================================
+  # Hook Formats
+  # ============================================================================
+  # All hooks support two formats:
+  #
+  # Single command:
+  # post-create = "npm install"
+  #
+  # Named table (multiple commands):
+  # [post-create]
+  # deps = "npm install"
+  # build = "npm run build"
+  #
+  # Named commands appear in output, making it easier to identify failures.
+  
+  # ============================================================================
+  # Template Variables — see https://worktrunk.dev/hook/#template-variables
+  # ============================================================================
+  # Common variables:
+  # {{ repo }} - Repository directory name (e.g., "myproject")
+  # {{ branch }} - Branch name (e.g., "feature/auth")
+  # {{ worktree_path }} - Absolute path to worktree
+  # {{ primary_worktree_path }} - Main worktree (or default branch worktree for bare repos)
+  # {{ default_branch }} - Default branch name (e.g., "main")
+  # {{ target }} - Target branch (merge hooks only)
+  #
+  # Filters:
+  # {{ branch | sanitize }} - Replace / and \ with - (e.g., "feature-auth")
+  # {{ branch | sanitize_db }} - Database-safe identifier with hash suffix (e.g., "feature_auth_x7k")
+  # {{ branch | hash_port }} - Deterministic port 10000-19999
+  
+  # ============================================================================
+  # Hooks
+  # ============================================================================
+  
+  # Post-Create: Runs after worktree creation, BLOCKS until complete
+  # Use for: installing dependencies, setting up databases, copying configs
+  #
+  # [post-create]
+  # deps = "npm ci"
+  # env = "cp .env.example .env"
+  
+  # Post-Start: Runs in BACKGROUND after worktree creation (parallel)
+  # Use for: dev servers, file watchers, background builds
+  # Output logged to .git/wt-logs/{branch}-project-post-start-{name}.log
+  #
+  # [post-start]
+  # server = "npm run dev -- --port {{ branch | hash_port }}"
+  # watch = "npm run watch"
+  
+  # Post-Switch: Runs in BACKGROUND after every switch (parallel)
+  # Use for: terminal tab naming, tmux window titles, IDE notifications
+  #
+  # post-switch = "echo -ne '\\033]0;{{ branch }}\\007'"
+  
+  # Pre-Commit: Runs before committing during merge, BLOCKS (fail-fast)
+  # Use for: formatters, linters, quick checks
+  #
+  # [pre-commit]
+  # format = "npm run format:check"
+  # lint = "npm run lint"
+  
+  # Pre-Merge: Runs before merging to target, BLOCKS (fail-fast)
+  # Use for: tests, build verification
+  #
+  # [pre-merge]
+  # test = "npm test"
+  # build = "npm run build"
+  
+  # Post-Merge: Runs after successful merge, BLOCKS
+  # Use for: deployment, notifications
+  #
+  # post-merge = "echo 'Merged {{ branch }} to {{ target }}'"
+  
+  # Pre-Remove: Runs before worktree removal, BLOCKS (fail-fast)
+  # Use for: cleanup, stopping services
+  #
+  # pre-remove = "docker compose down"
+  
+  # ============================================================================
+  # Aliases (experimental) — run with `wt step <name>`
+  # ============================================================================
+  # Command templates that support the same variables as hooks.
+  # Project-config aliases require command approval on first run.
+  #
+  # [aliases]
+  # deploy = "make deploy BRANCH={{ branch }}"
+  # url = "echo http://localhost:{{ branch | hash_port }}"
+  
+  # ============================================================================
+  # Dev Server URL (shown in `wt list`)
+  # ============================================================================
+  # [list]
+  # url = "http://localhost:{{ branch | hash_port }}"
+  
+  # ============================================================================
+  # CI Platform Override
+  # ============================================================================
+  # Override CI platform detection for GitHub Enterprise or self-hosted GitLab
+  # with custom domains where URL detection fails.
+  #
+  # [ci]
+  # platform = "github" # or "gitlab"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
index c13daeea4..24c860841 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -62,45 +62,45 @@ Usage: wt config [OPTIONS] <COMMAND>
Install shell integration (required for directory switching):
- wt config shell install
+  wt config shell install
Create user config file with documented examples:
- wt config create
+  wt config create
Create project config file (.config/wt.toml) for hooks:
- wt config create --project
+  wt config create --project
Show current configuration and file locations:
- wt config show
+  wt config show
Configuration files
- File Location Contains Committed & shared
- ────────────── ─────────────────────────────── ─────────────────────────────────────────────── ──────────────────
- User config ~/.config/worktrunk/config.toml Worktree path template, LLM commit configs, etc ✗
- Project config .config/wt.toml Project hooks, dev server URL ✓
+ File Location Contains Committed & shared
+ ────────────── ─────────────────────────────── ─────────────────────────────────────────────── ──────────────────
+ User config ~/.config/worktrunk/config.toml Worktree path template, LLM commit configs, etc ✗
+ Project config .config/wt.toml Project hooks, dev server URL ✓
Organizations can also deploy a system-wide config file for shared defaults — run wt config show for the platform-specific location.
User config — personal preferences:
- # ~/.config/worktrunk/config.toml
- worktree-path = ".worktrees/{{ branch | sanitize }}"
- 
- [commit.generation]
- command = "MAX_THINKING_TOKENS=0 claude -p --model=haiku --tools='' --disable-slash-commands --setting-sources='' --system-prompt=''"
+  # ~/.config/worktrunk/config.toml
+  worktree-path = ".worktrees/{{ branch | sanitize }}"
+ 
+  [commit.generation]
+  command = "MAX_THINKING_TOKENS=0 claude -p --model=haiku --tools='' --disable-slash-commands --setting-sources='' --system-prompt=''"
Project config — shared team settings:
- # .config/wt.toml
- [post-create]
- deps = "npm ci"
- 
- [pre-merge]
- test = "npm test"
+  # .config/wt.toml
+  [post-create]
+  deps = "npm ci"
+ 
+  [pre-merge]
+  test = "npm test"
USER CONFIGURATION
@@ -125,17 +125,17 @@ Controls where new worktrees are created.
Examples for repo at ~/code/myproject, branch feature/auth:
- # Default — sibling directory
- # Creates: ~/code/myproject.feature-auth
- # worktree-path = "{{ repo_path }}/../{{ repo }}.{{ branch | sanitize }}"
- 
- # Inside the repository
- # Creates: ~/code/myproject/.worktrees/feature-auth
- worktree-path = "{{ repo_path }}/.worktrees/{{ branch | sanitize }}"
- 
- # Centralized worktrees directory
- # Creates: ~/worktrees/myproject/feature-auth
- worktree-path = "~/worktrees/{{ repo }}/{{ branch | sanitize }}"
+  # Default — sibling directory
+  # Creates: ~/code/myproject.feature-auth
+  # worktree-path = "{{ repo_path }}/../{{ repo }}.{{ branch | sanitize }}"
+ 
+  # Inside the repository
+  # Creates: ~/code/myproject/.worktrees/feature-auth
+  worktree-path = "{{ repo_path }}/.worktrees/{{ branch | sanitize }}"
+ 
+  # Centralized worktrees directory
+  # Creates: ~/worktrees/myproject/feature-auth
+  worktree-path = "~/worktrees/{{ repo }}/{{ branch | sanitize }}"
~ expands to the home directory. Relative paths are relative to the repository root.
@@ -151,50 +151,50 @@ See LLM commits docs for setup and Custom prompt templates for template customiz
Persistent flag values for wt list. Override on command line as needed.
- [list]
- summary = false # Enable LLM branch summaries (requires [commit.generation])
- 
- full = false # Show CI, main…± diffstat, and LLM summaries (--full)
- branches = false # Include branches without worktrees (--branches)
- remotes = false # Include remote-only branches (--remotes)
+  [list]
+  summary = false # Enable LLM branch summaries (requires [commit.generation])
+ 
+  full = false # Show CI, main…± diffstat, and LLM summaries (--full)
+  branches = false # Include branches without worktrees (--branches)
+  remotes = false # Include remote-only branches (--remotes)
Commit
Shared by wt step commit, wt step squash, and wt merge.
- [commit]
- stage = "all" # What to stage before commit: "all", "tracked", or "none"
+  [commit]
+  stage = "all" # What to stage before commit: "all", "tracked", or "none"
Merge
All flags are on by default. Set to false to change default behavior.
- [merge]
- squash = true # Squash commits into one (--no-squash to preserve history)
- commit = true # Commit uncommitted changes first (--no-commit to skip)
- rebase = true # Rebase onto target before merge (--no-rebase to skip)
- remove = true # Remove worktree after merge (--no-remove to keep)
- verify = true # Run project hooks (--no-verify to skip)
+  [merge]
+  squash = true # Squash commits into one (--no-squash to preserve history)
+  commit = true # Commit uncommitted changes first (--no-commit to skip)
+  rebase = true # Rebase onto target before merge (--no-rebase to skip)
+  remove = true # Remove worktree after merge (--no-remove to keep)
+  verify = true # Run project hooks (--no-verify to skip)
Switch picker
Configuration for wt switch interactive picker.
- [switch.picker]
- # Pager command for diff preview (overrides git's core.pager)
- # pager = "delta --paging=never"
- 
- # Timeout (ms) for git commands during picker loading (default: 200)
- # Lower values show the TUI faster; 0 disables timeouts
- # timeout-ms = 200
+  [switch.picker]
+  # Pager command for diff preview (overrides git's core.pager)
+  # pager = "delta --paging=never"
+ 
+  # Timeout (ms) for git commands during picker loading (default: 200)
+  # Lower values show the TUI faster; 0 disables timeouts
+  # timeout-ms = 200
Aliases
Command templates that run with wt step <name>. See wt step aliases for usage and flags.
- [aliases]
- greet = "echo Hello from {{ branch }}"
- url = "echo http://localhost:{{ branch | hash_port }}"
+  [aliases]
+  greet = "echo Hello from {{ branch }}"
+  url = "echo http://localhost:{{ branch | hash_port }}"
Aliases defined here apply to all projects. For project-specific aliases, use the project config [aliases] section instead.
@@ -212,12 +212,12 @@ Entries are keyed by project identifier (e.g., github.com/user/repo).
Override global user config for a specific project. Scalar values (like worktree-path) replace the global value. Hooks append — both global and per-project hooks run. Aliases merge — per-project aliases override global aliases on name collision.
- [projects."github.com/user/repo"]
- worktree-path = ".worktrees/{{ branch | sanitize }}"
- list.full = true
- merge.squash = false
- post-create.env = "cp .env.example .env"
- aliases.deploy = "make deploy BRANCH={{ branch }}"
+  [projects."github.com/user/repo"]
+  worktree-path = ".worktrees/{{ branch | sanitize }}"
+  list.full = true
+  merge.squash = false
+  post-create.env = "cp .env.example .env"
+  aliases.deploy = "make deploy BRANCH={{ branch }}"
Custom prompt templates
@@ -233,38 +233,38 @@ Available variables:
Default template:
- [commit.generation]
- template = """
- Write a commit message for the staged changes below.
- 
- <format>
- - Subject line under 50 chars
- - For material changes, add a blank line then a body paragraph explaining the change
- - Output only the commit message, no quotes or code blocks
- </format>
- 
- <style>
- - Imperative mood: "Add feature" not "Added feature"
- - Match recent commit style (conventional commits if used)
- - Describe the change, not the intent or benefit
- </style>
- 
- <diffstat>
- {{ git_diff_stat }}
- </diffstat>
- 
- <diff>
- {{ git_diff }}
- </diff>
- 
- <context>
- Branch: {{ branch }}
- {% if recent_commits %}<recent_commits>
- {% for commit in recent_commits %}- {{ commit }}
- {% endfor %}</recent_commits>{% endif %}
- </context>
- 
- """
+  [commit.generation]
+  template = """
+  Write a commit message for the staged changes below.
+ 
+  <format>
+  - Subject line under 50 chars
+  - For material changes, add a blank line then a body paragraph explaining the change
+  - Output only the commit message, no quotes or code blocks
+  </format>
+ 
+  <style>
+  - Imperative mood: "Add feature" not "Added feature"
+  - Match recent commit style (conventional commits if used)
+  - Describe the change, not the intent or benefit
+  </style>
+ 
+  <diffstat>
+  {{ git_diff_stat }}
+  </diffstat>
+ 
+  <diff>
+  {{ git_diff }}
+  </diff>
+ 
+  <context>
+  Branch: {{ branch }}
+  {% if recent_commits %}<recent_commits>
+  {% for commit in recent_commits %}- {{ commit }}
+  {% endfor %}</recent_commits>{% endif %}
+  </context>
+ 
+  """
Squash template
@@ -275,35 +275,35 @@ Available variables (in addition to commit template variables):
Default template:
- [commit.generation]
- squash-template = """
- Combine these commits into a single commit message.
- 
- <format>
- - Subject line under 50 chars
- - For material changes, add a blank line then a body paragraph explaining the change
- - Output only the commit message, no quotes or code blocks
- </format>
- 
- <style>
- - Imperative mood: "Add feature" not "Added feature"
- - Match the style of commits being squashed (conventional commits if used)
- - Describe the change, not the intent or benefit
- </style>
- 
- <commits branch="{{ branch }}" target="{{ target_branch }}">
- {% for commit in commits %}- {{ commit }}
- {% endfor %}</commits>
- 
- <diffstat>
- {{ git_diff_stat }}
- </diffstat>
- 
- <diff>
- {{ git_diff }}
- </diff>
- 
- """
+  [commit.generation]
+  squash-template = """
+  Combine these commits into a single commit message.
+ 
+  <format>
+  - Subject line under 50 chars
+  - For material changes, add a blank line then a body paragraph explaining the change
+  - Output only the commit message, no quotes or code blocks
+  </format>
+ 
+  <style>
+  - Imperative mood: "Add feature" not "Added feature"
+  - Match the style of commits being squashed (conventional commits if used)
+  - Describe the change, not the intent or benefit
+  </style>
+ 
+  <commits branch="{{ branch }}" target="{{ target_branch }}">
+  {% for commit in commits %}- {{ commit }}
+  {% endfor %}</commits>
+ 
+  <diffstat>
+  {{ git_diff_stat }}
+  </diffstat>
+ 
+  <diff>
+  {{ git_diff }}
+  </diff>
+ 
+  """
PROJECT CONFIGURATION
@@ -313,26 +313,26 @@ See wt hook for hook types, execution order, template variables, and exa
Non-hook settings
- # .config/wt.toml
- 
- # URL column in wt list (dimmed when port not listening)
- [list]
- url = "http://localhost:{{ branch | hash_port }}"
- 
- # Override CI platform detection for self-hosted instances
- [ci]
- platform = "github" # or "gitlab"
- 
- # Command aliases (run with wt step <name>)
- [aliases]
- deploy = "make deploy BRANCH={{ branch }}"
- test = "cargo test"
+  # .config/wt.toml
+ 
+  # URL column in wt list (dimmed when port not listening)
+  [list]
+  url = "http://localhost:{{ branch | hash_port }}"
+ 
+  # Override CI platform detection for self-hosted instances
+  [ci]
+  platform = "github" # or "gitlab"
+ 
+  # Command aliases (run with wt step <name>)
+  [aliases]
+  deploy = "make deploy BRANCH={{ branch }}"
+  test = "cargo test"
SHELL INTEGRATION
Worktrunk needs shell integration to change directories when switching worktrees. Install with:
- wt config shell install
+  wt config shell install
For manual setup, see wt config shell init --help.
@@ -354,11 +354,11 @@ Config keys use kebab-case (worktree-path), while env vars use SCREAMING
For nested config sections, use double underscores to separate levels:
- Config Environment Variable
- ───────────────────────── ─────────────────────────────────────
- worktree-path WORKTRUNK_WORKTREE_PATH
- commit.generation.command WORKTRUNK_COMMIT__GENERATION__COMMAND
- commit.stage WORKTRUNK_COMMIT__STAGE
+ Config Environment Variable
+ ───────────────────────── ─────────────────────────────────────
+ worktree-path WORKTRUNK_WORKTREE_PATH
+ commit.generation.command WORKTRUNK_COMMIT__GENERATION__COMMAND
+ commit.stage WORKTRUNK_COMMIT__STAGE
Note the single underscore after WORKTRUNK and double underscores between nested keys.
@@ -366,18 +366,18 @@ Note the single underscore after WORKTRUNK and double underscores betwee
Override the LLM command in CI to use a mock:
- WORKTRUNK_COMMIT__GENERATION__COMMAND="echo 'test: automated commit'" wt merge
+  WORKTRUNK_COMMIT__GENERATION__COMMAND="echo 'test: automated commit'" wt merge
Other environment variables
- Variable Purpose
- ───────────────────────────────── ─────────────────────────────────────────────────────────────────────────────────
- WORKTRUNK_BIN Override binary path for shell wrappers (useful for testing dev builds)
- WORKTRUNK_CONFIG_PATH Override user config file location
- WORKTRUNK_SYSTEM_CONFIG_PATH Override system config file location
- XDG_CONFIG_DIRS Colon-separated system config directories (default: /etc/xdg)
- WORKTRUNK_DIRECTIVE_FILE Internal: set by shell wrappers to enable directory changes
- WORKTRUNK_SHELL Internal: set by shell wrappers to indicate shell type (e.g., powershell)
- WORKTRUNK_MAX_CONCURRENT_COMMANDS Max parallel git commands (default: 32). Lower if hitting file descriptor limits.
- NO_COLOR Disable colored output (standard)
- CLICOLOR_FORCE Force colored output even when not a TTY
+ Variable Purpose
+ ───────────────────────────────── ─────────────────────────────────────────────────────────────────────────────────
+ WORKTRUNK_BIN Override binary path for shell wrappers (useful for testing dev builds)
+ WORKTRUNK_CONFIG_PATH Override user config file location
+ WORKTRUNK_SYSTEM_CONFIG_PATH Override system config file location
+ XDG_CONFIG_DIRS Colon-separated system config directories (default: /etc/xdg)
+ WORKTRUNK_DIRECTIVE_FILE Internal: set by shell wrappers to enable directory changes
+ WORKTRUNK_SHELL Internal: set by shell wrappers to indicate shell type (e.g., powershell)
+ WORKTRUNK_MAX_CONCURRENT_COMMANDS Max parallel git commands (default: 32). Lower if hitting file descriptor limits.
+ NO_COLOR Disable colored output (standard)
+ CLICOLOR_FORCE Force colored output even when not a TTY
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_show.snap b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
index e87b3ee3c..d4ea22806 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_show.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
@@ -12,15 +12,18 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_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"
---
@@ -59,7 +62,7 @@ If a config file doesn't exist, shows defaults that would be used.
Use --full to run diagnostic checks:
- wt config show --full
+  wt config show --full
This tests:
- CI tool status — Whether gh (GitHub) or glab (GitLab) is installed and authenticated
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state.snap b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
index 4c2b2e5ef..534e450a8 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
@@ -12,14 +12,18 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_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"
---
@@ -70,19 +74,19 @@ Use wt config show to view file-based configuration.
Examples
Get the default branch:
- wt config state default-branch
+  wt config state default-branch
Set the default branch manually:
- wt config state default-branch set main
+  wt config state default-branch set main
Set a marker for current branch:
- wt config state marker set "🚧 WIP"
+  wt config state marker set "🚧 WIP"
Clear all CI status cache:
- wt config state ci-status clear --all
+  wt config state ci-status clear --all
Show all stored state:
- wt config state get
+  wt config state get
Clear all stored state:
- wt config state clear
+  wt config state clear
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
index a61d1509e..145fd5f83 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
@@ -13,6 +13,7 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
@@ -64,14 +65,14 @@ Results cache for 30-60 seconds. Indicators dim when local changes haven't been
Status values
- Status Meaning
- ───────── ───────────────────────────────────────
- passed All checks passed
- running Checks in progress
- failed Checks failed
- conflicts PR has merge conflicts
- no-ci No checks configured
- error Fetch error (rate limit, network, auth)
+ Status Meaning
+ ───────── ───────────────────────────────────────
+ passed All checks passed
+ running Checks in progress
+ failed Checks failed
+ conflicts PR has merge conflicts
+ no-ci No checks configured
+ error Fetch error (rate limit, network, auth)
See wt list CI status for display symbols and colors.
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
index 41d78f63d..13e6721de 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
@@ -13,14 +13,18 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_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"
---
@@ -54,7 +58,7 @@ Usage: wt config state default-branch [OPTIONS] [COMM
Useful in scripts to avoid hardcoding main or master:
- git rebase $(wt config state default-branch)
+  git rebase $(wt config state default-branch)
Without a subcommand, runs get. Use set to override, or clear then get to re-detect.
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
index 60a44bd1c..a688ff327 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
@@ -13,6 +13,7 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
@@ -66,10 +67,10 @@ All hook executions and LLM commands are recorded automatically — one JSON obj
Hook output logs
- Operation Log file
- ────────────────── ───────────────────────────────────────
- post-start hooks {branch}-{source}-post-start-{name}.log
- Background removal {branch}-remove.log
+ Operation Log file
+ ────────────────── ───────────────────────────────────────
+ post-start hooks {branch}-{source}-post-start-{name}.log
+ Background removal {branch}-remove.log
Source is user or project depending on where the hook is defined.
@@ -86,13 +87,13 @@ All logs are stored in .git/wt-logs/ (in the main worktree's git directo
Examples
List all log files:
- wt config state logs get
+  wt config state logs get
Query the command log:
- tail -5 .git/wt-logs/commands.jsonl | jq .
+  tail -5 .git/wt-logs/commands.jsonl | jq .
View a specific hook log:
- cat "$(git rev-parse --git-dir)/wt-logs/feature-project-post-start-build.log"
+  cat "$(git rev-parse --git-dir)/wt-logs/feature-project-post-start-build.log"
Clear all logs:
- wt config state logs clear
+  wt config state logs clear
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
index 128585f10..84751699e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
@@ -13,14 +13,18 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_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"
---
@@ -58,10 +62,10 @@ Custom status text or emoji shown in the wt list Status column.
Markers appear at the start of the Status column:
- Branch Status Path
- main ^ ~/code/myproject
- feature 🚧↑ ~/code/myproject.feature
- bugfix 🤖!↑⇡ ~/code/myproject.bugfix
+  Branch Status Path
+  main ^ ~/code/myproject
+  feature 🚧↑ ~/code/myproject.feature
+  bugfix 🤖!↑⇡ ~/code/myproject.bugfix
Use cases
@@ -73,6 +77,6 @@ Markers appear at the start of the Status column:
Stored in git config as worktrunk.state.<branch>.marker. Set directly with:
- git config worktrunk.state.feature.marker '{"marker":"🚧","set_at":0}'
+  git config worktrunk.state.feature.marker '{"marker":"🚧","set_at":0}'
Without a subcommand, runs get for the current branch. For --branch, use get --branch=NAME.
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
index b5fb9897a..908631227 100644
--- a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
@@ -12,12 +12,14 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
TERM: alacritty
WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
@@ -57,13 +59,13 @@ Project hooks require approval on first run to prevent untrusted projects from r
Examples
Pre-approve all commands for current project:
- wt hook approvals add
+  wt hook approvals add
Clear approvals for current project:
- wt hook approvals clear
+  wt hook approvals clear
Clear global approvals:
- wt hook approvals clear --global
+  wt hook approvals clear --global
How approvals work
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index dede28943..7f9ee27b0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -80,37 +80,37 @@ The table renders progressively: branch names, paths, and commit hashes appear i
List all worktrees:
- $ wt list
+  $ wt list
Include CI status, line diffs, and LLM summaries:
- $ wt list --full
+  $ wt list --full
Include branches that don't have worktrees:
- $ wt list --branches --full
+  $ wt list --branches --full
Output as JSON for scripting:
- $ wt list --format=json
+  $ wt list --format=json
Columns
- Column Shows
- ─────── ─────────────────────────────────────────────────────────────────────────────────────────────────
- Branch Branch name
- Status Compact symbols (see below)
- HEAD± Uncommitted changes: +added -deleted lines
- main↕ Commits ahead/behind default branch
- main…± Line diffs since the merge-base with the default branch (--full)
- Summary LLM-generated branch summary (--full + summary = true, requires commit.generation) (experimental)
- Remote⇅ Commits ahead/behind tracking branch
- CI Pipeline status (--full)
- Path Worktree directory
- URL Dev server URL from project config (dimmed if port not listening)
- Commit Short hash (8 chars)
- Age Time since last commit
- Message Last commit message (truncated)
+ Column Shows
+ ─────── ─────────────────────────────────────────────────────────────────────────────────────────────────
+ Branch Branch name
+ Status Compact symbols (see below)
+ HEAD± Uncommitted changes: +added -deleted lines
+ main↕ Commits ahead/behind default branch
+ main…± Line diffs since the merge-base with the default branch (--full)
+ Summary LLM-generated branch summary (--full + summary = true, requires commit.generation) (experimental)
+ Remote⇅ Commits ahead/behind tracking branch
+ CI Pipeline status (--full)
+ Path Worktree directory
+ URL Dev server URL from project config (dimmed if port not listening)
+ Commit Short hash (8 chars)
+ Age Time since last commit
+ Message Last commit message (truncated)
Note: main↕ and main…± refer to the default branch (header label stays main for compactness). main…± uses a merge-base (three-dot) diff.
@@ -118,15 +118,15 @@ Note: main↕ and main…± refer to the default branch (header
The CI column shows GitHub/GitLab pipeline status:
- Indicator Meaning
- ───────── ─────────────────────────────────
- ● green All checks passed
- ● blue Checks running
- ● red Checks failed
- ● yellow Merge conflicts with base
- ● gray No checks configured
- ⚠ yellow Fetch error (rate limit, network)
- (blank) No upstream or no PR/MR
+ Indicator Meaning
+ ───────── ─────────────────────────────────
+ ● green All checks passed
+ ● blue Checks running
+ ● red Checks failed
+ ● yellow Merge conflicts with base
+ ● gray No checks configured
+ ⚠ yellow Fetch error (rate limit, network)
+ (blank) No upstream or no PR/MR
CI indicators are clickable links to the PR or pipeline page. Any CI dot appears dimmed when there are unpushed local changes (stale status). PRs/MRs are checked first, then branch workflows/pipelines for branches with an upstream. Local-only branches show blank; remote-only branches (visible with --remotes) get CI status detection. Results are cached for 30-60 seconds; use wt config state to view or clear.
@@ -140,31 +140,31 @@ Disabled by default — when enabled, each branch's diff is sent to the configur
The Status column has multiple subcolumns. Within each, only the first matching symbol is shown (listed in priority order):
- Subcolumn Symbol Meaning
- ──────────────── ────── ──────────────────────────────────────────────────────────────────────────────────────────
- Working tree (1) + Staged files
- Working tree (2) ! Modified files (unstaged)
- Working tree (3) ? Untracked files
- Worktree ✘ Merge conflicts
- ⤴ Rebase in progress
- ⤵ Merge in progress
- / Branch without worktree
- ⚑ Branch-worktree mismatch (branch name doesn't match worktree path)
- ⊟ Prunable (directory missing)
- ⊞ Locked worktree
- Default branch ^ Is the default branch
- ∅ Orphan branch (no common ancestor with the default branch)
- ✗ Would conflict if merged to the default branch (with --full, includes uncommitted changes)
- _ Same commit as the default branch, clean
- – Same commit as the default branch, uncommitted changes
- ⊂ Content integrated into the default branch or target
- ↕ Diverged from the default branch
- ↑ Ahead of the default branch
- ↓ Behind the default branch
- Remote | In sync with remote
- ⇅ Diverged from remote
- ⇡ Ahead of remote
- ⇣ Behind remote
+ Subcolumn Symbol Meaning
+ ──────────────── ────── ──────────────────────────────────────────────────────────────────────────────────────────
+ Working tree (1) + Staged files
+ Working tree (2) ! Modified files (unstaged)
+ Working tree (3) ? Untracked files
+ Worktree ✘ Merge conflicts
+ ⤴ Rebase in progress
+ ⤵ Merge in progress
+ / Branch without worktree
+ ⚑ Branch-worktree mismatch (branch name doesn't match worktree path)
+ ⊟ Prunable (directory missing)
+ ⊞ Locked worktree
+ Default branch ^ Is the default branch
+ ∅ Orphan branch (no common ancestor with the default branch)
+ ✗ Would conflict if merged to the default branch (with --full, includes uncommitted changes)
+ _ Same commit as the default branch, clean
+ – Same commit as the default branch, uncommitted changes
+ ⊂ Content integrated into the default branch or target
+ ↕ Diverged from the default branch
+ ↑ Ahead of the default branch
+ ↓ Behind the default branch
+ Remote | In sync with remote
+ ⇅ Diverged from remote
+ ⇡ Ahead of remote
+ ⇣ Behind remote
Rows are dimmed when safe to delete (_ same commit with clean working tree or ⊂ content integrated).
@@ -174,108 +174,108 @@ Rows are dimmed when safe to delete (_ same commit with clean working tr
Query structured data with --format=json:
- # Current worktree path (for scripts)
- wt list --format=json | jq -r '.[] | select(.is_current) | .path'
- 
- # Branches with uncommitted changes
- wt list --format=json | jq '.[] | select(.working_tree.modified)'
- 
- # Worktrees with merge conflicts
- wt list --format=json | jq '.[] | select(.operation_state == "conflicts")'
- 
- # Branches ahead of main (needs merging)
- wt list --format=json | jq '.[] | select(.main.ahead > 0) | .branch'
- 
- # Integrated branches (safe to remove)
- wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_state == "empty") | .branch'
- 
- # Branches without worktrees
- wt list --format=json --branches | jq '.[] | select(.kind == "branch") | .branch'
- 
- # Worktrees ahead of remote (needs pushing)
- wt list --format=json | jq '.[] | select(.remote.ahead > 0) | {branch, ahead: .remote.ahead}'
- 
- # Stale CI (local changes not reflected in CI)
- wt list --format=json --full | jq '.[] | select(.ci.stale) | .branch'
+  # Current worktree path (for scripts)
+  wt list --format=json | jq -r '.[] | select(.is_current) | .path'
+  
+  # Branches with uncommitted changes
+  wt list --format=json | jq '.[] | select(.working_tree.modified)'
+  
+  # Worktrees with merge conflicts
+  wt list --format=json | jq '.[] | select(.operation_state == "conflicts")'
+  
+  # Branches ahead of main (needs merging)
+  wt list --format=json | jq '.[] | select(.main.ahead > 0) | .branch'
+  
+  # Integrated branches (safe to remove)
+  wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_state == "empty") | .branch'
+  
+  # Branches without worktrees
+  wt list --format=json --branches | jq '.[] | select(.kind == "branch") | .branch'
+  
+  # Worktrees ahead of remote (needs pushing)
+  wt list --format=json | jq '.[] | select(.remote.ahead > 0) | {branch, ahead: .remote.ahead}'
+  
+  # Stale CI (local changes not reflected in CI)
+  wt list --format=json --full | jq '.[] | select(.ci.stale) | .branch'
Fields:
- Field Type Description
- ────────────────── ─────────── ───────────────────────────────────────────────────────────────────────
- branch string/null Branch name (null for detached HEAD)
- path string Worktree path (absent for branches without worktrees)
- kind string "worktree" or "branch"
- commit object Commit info (see below)
- working_tree object Working tree state (see below)
- main_state string Relation to the default branch (see below)
- integration_reason string Why branch is integrated (see below)
- operation_state string "conflicts", "rebase", or "merge" (absent when clean)
- main object Relationship to the default branch (see below, absent when is_main)
- remote object Tracking branch info (see below, absent when no tracking)
- worktree object Worktree metadata (see below)
- is_main boolean Is the main worktree
- is_current boolean Is the current worktree
- is_previous boolean Previous worktree from wt switch
- ci object CI status (see below, absent when no CI)
- url string Dev server URL from project config (absent when not configured)
- url_active boolean Whether the URL's port is listening (absent when not configured)
- summary string LLM-generated branch summary (absent when not configured or no summary)
- statusline string Pre-formatted status with ANSI colors
- symbols string Raw status symbols without colors (e.g., "!?↓")
+ Field Type Description
+ ────────────────── ─────────── ───────────────────────────────────────────────────────────────────────
+ branch string/null Branch name (null for detached HEAD)
+ path string Worktree path (absent for branches without worktrees)
+ kind string "worktree" or "branch"
+ commit object Commit info (see below)
+ working_tree object Working tree state (see below)
+ main_state string Relation to the default branch (see below)
+ integration_reason string Why branch is integrated (see below)
+ operation_state string "conflicts", "rebase", or "merge" (absent when clean)
+ main object Relationship to the default branch (see below, absent when is_main)
+ remote object Tracking branch info (see below, absent when no tracking)
+ worktree object Worktree metadata (see below)
+ is_main boolean Is the main worktree
+ is_current boolean Is the current worktree
+ is_previous boolean Previous worktree from wt switch
+ ci object CI status (see below, absent when no CI)
+ url string Dev server URL from project config (absent when not configured)
+ url_active boolean Whether the URL's port is listening (absent when not configured)
+ summary string LLM-generated branch summary (absent when not configured or no summary)
+ statusline string Pre-formatted status with ANSI colors
+ symbols string Raw status symbols without colors (e.g., "!?↓")
Commit object
- Field Type Description
- ───────── ────── ───────────────────────────
- sha string Full commit SHA (40 chars)
- short_sha string Short commit SHA (7 chars)
- message string Commit message (first line)
- timestamp number Unix timestamp
+ Field Type Description
+ ───────── ────── ───────────────────────────
+ sha string Full commit SHA (40 chars)
+ short_sha string Short commit SHA (7 chars)
+ message string Commit message (first line)
+ timestamp number Unix timestamp
working_tree object
- Field Type Description
- ───────── ─────── ───────────────────────────────────────
- staged boolean Has staged files
- modified boolean Has modified files (unstaged)
- untracked boolean Has untracked files
- renamed boolean Has renamed files
- deleted boolean Has deleted files
- diff object Lines changed vs HEAD: {added, deleted}
+ Field Type Description
+ ───────── ─────── ───────────────────────────────────────
+ staged boolean Has staged files
+ modified boolean Has modified files (unstaged)
+ untracked boolean Has untracked files
+ renamed boolean Has renamed files
+ deleted boolean Has deleted files
+ diff object Lines changed vs HEAD: {added, deleted}
main object
- Field Type Description
- ────── ────── ─────────────────────────────────────────────────────
- ahead number Commits ahead of the default branch
- behind number Commits behind the default branch
- diff object Lines changed vs the default branch: {added, deleted}
+ Field Type Description
+ ────── ────── ─────────────────────────────────────────────────────
+ ahead number Commits ahead of the default branch
+ behind number Commits behind the default branch
+ diff object Lines changed vs the default branch: {added, deleted}
remote object
- Field Type Description
- ────── ────── ────────────────────────────
- name string Remote name (e.g., "origin")
- branch string Remote branch name
- ahead number Commits ahead of remote
- behind number Commits behind remote
+ Field Type Description
+ ────── ────── ────────────────────────────
+ name string Remote name (e.g., "origin")
+ branch string Remote branch name
+ ahead number Commits ahead of remote
+ behind number Commits behind remote
worktree object
- Field Type Description
- ──────── ─────── ────────────────────────────────────────────────────────────────────────────────────
- state string "no_worktree", "branch_worktree_mismatch", "prunable", "locked" (absent when normal)
- reason string Reason for locked/prunable state
- detached boolean HEAD is detached
+ Field Type Description
+ ──────── ─────── ────────────────────────────────────────────────────────────────────────────────────
+ state string "no_worktree", "branch_worktree_mismatch", "prunable", "locked" (absent when normal)
+ reason string Reason for locked/prunable state
+ detached boolean HEAD is detached
ci object
- Field Type Description
- ────── ─────── ─────────────────────────────────────────────────
- status string CI status (see below)
- source string "pr" (PR/MR) or "branch" (branch workflow)
- stale boolean Local HEAD differs from remote (unpushed changes)
- url string URL to the PR/MR page
+ Field Type Description
+ ────── ─────── ─────────────────────────────────────────────────
+ status string CI status (see below)
+ source string "pr" (PR/MR) or "branch" (branch workflow)
+ stale boolean Local HEAD differs from remote (unpushed changes)
+ url string URL to the PR/MR page
main_state values
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
index 5aa3e9c2b..305086cca 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
@@ -86,38 +86,38 @@ results arrive.
List all worktrees:
- $ wt list
+  $ wt list
Include CI status, line diffs, and LLM summaries:
- $ wt list --full
+  $ wt list --full
Include branches that don't have worktrees:
- $ wt list --branches --full
+  $ wt list --branches --full
Output as JSON for scripting:
- $ wt list --format=json
+  $ wt list --format=json
Columns
- Column Shows
- ─────── ────────────────────────────────────────────────────────────────────
- Branch Branch name
- Status Compact symbols (see below)
- HEAD± Uncommitted changes: +added -deleted lines
- main↕ Commits ahead/behind default branch
- main…± Line diffs since the merge-base with the default branch (--full)
- Summary LLM-generated branch summary (--full + summary = true, requires
- commit.generation) (experimental)
- Remote⇅ Commits ahead/behind tracking branch
- CI Pipeline status (--full)
- Path Worktree directory
- URL Dev server URL from project config (dimmed if port not listening)
- Commit Short hash (8 chars)
- Age Time since last commit
- Message Last commit message (truncated)
+ Column Shows
+ ─────── ──────────────────────────────────────────────────────────────────────
+ Branch Branch name
+ Status Compact symbols (see below)
+ HEAD± Uncommitted changes: +added -deleted lines
+ main↕ Commits ahead/behind default branch
+ main…± Line diffs since the merge-base with the default branch (--full)
+ Summary LLM-generated branch summary (--full + summary = true, requires
+ commit.generation) (experimental)
+ Remote⇅ Commits ahead/behind tracking branch
+ CI Pipeline status (--full)
+ Path Worktree directory
+ URL Dev server URL from project config (dimmed if port not listening)
+ Commit Short hash (8 chars)
+ Age Time since last commit
+ Message Last commit message (truncated)
Note: main↕ and main…± refer to the default branch (header label stays main for
compactness). main…± uses a merge-base (three-dot) diff.
@@ -126,15 +126,15 @@ compactness). main…± uses a merge-base (three-dot) diff.
The CI column shows GitHub/GitLab pipeline status:
- Indicator Meaning
- ───────── ─────────────────────────────────
- ● green All checks passed
- ● blue Checks running
- ● red Checks failed
- ● yellow Merge conflicts with base
- ● gray No checks configured
- ⚠ yellow Fetch error (rate limit, network)
- (blank) No upstream or no PR/MR
+ Indicator Meaning
+ ───────── ─────────────────────────────────
+ ● green All checks passed
+ ● blue Checks running
+ ● red Checks failed
+ ● yellow Merge conflicts with base
+ ● gray No checks configured
+ ⚠ yellow Fetch error (rate limit, network)
+ (blank) No upstream or no PR/MR
CI indicators are clickable links to the PR or pipeline page. Any CI dot appears
dimmed when there are unpushed local changes (stale status). PRs/MRs are
@@ -157,35 +157,34 @@ Disabled by default — when enabled, each branch's diff is sent to the configur
The Status column has multiple subcolumns. Within each, only the first matching
symbol is shown (listed in priority order):
- Subcolumn Symbol Meaning
- ──────────────── ────── ────────────────────────────────────────────────────
- Working tree (1) + Staged files
- Working tree (2) ! Modified files (unstaged)
- Working tree (3) ? Untracked files
- Worktree ✘ Merge conflicts
- ⤴ Rebase in progress
- ⤵ Merge in progress
- / Branch without worktree
- ⚑ Branch-worktree mismatch (branch name doesn't match
- worktree path)
- ⊟ Prunable (directory missing)
- ⊞ Locked worktree
- Default branch ^ Is the default branch
- ∅ Orphan branch (no common ancestor with the default
- branch)
- ✗ Would conflict if merged to the default branch (with
- --full, includes uncommitted changes)
- _ Same commit as the default branch, clean
- – Same commit as the default branch, uncommitted
- changes
- ⊂ Content integrated into the default branch or target
- ↕ Diverged from the default branch
- ↑ Ahead of the default branch
- ↓ Behind the default branch
- Remote | In sync with remote
- ⇅ Diverged from remote
- ⇡ Ahead of remote
- ⇣ Behind remote
+ Subcolumn Symbol Meaning
+ ──────────────── ────── ──────────────────────────────────────────────────────
+ Working tree (1) + Staged files
+ Working tree (2) ! Modified files (unstaged)
+ Working tree (3) ? Untracked files
+ Worktree ✘ Merge conflicts
+ ⤴ Rebase in progress
+ ⤵ Merge in progress
+ / Branch without worktree
+ ⚑ Branch-worktree mismatch (branch name doesn't match
+ worktree path)
+ ⊟ Prunable (directory missing)
+ ⊞ Locked worktree
+ Default branch ^ Is the default branch
+ ∅ Orphan branch (no common ancestor with the default
+ branch)
+ ✗ Would conflict if merged to the default branch (with
+ --full, includes uncommitted changes)
+ _ Same commit as the default branch, clean
+ – Same commit as the default branch, uncommitted changes
+ ⊂ Content integrated into the default branch or target
+ ↕ Diverged from the default branch
+ ↑ Ahead of the default branch
+ ↓ Behind the default branch
+ Remote | In sync with remote
+ ⇅ Diverged from remote
+ ⇡ Ahead of remote
+ ⇣ Behind remote
Rows are dimmed when safe to delete (_ same commit with clean working tree or ⊂
content integrated).
@@ -196,117 +195,119 @@ content integrated).
Query structured data with --format=json:
- # Current worktree path (for scripts)
- wt list --format=json | jq -r '.[] | select(.is_current) | .path'
- 
- # Branches with uncommitted changes
- wt list --format=json | jq '.[] | select(.working_tree.modified)'
- 
- # Worktrees with merge conflicts
- wt list --format=json | jq '.[] | select(.operation_state == "conflicts")'
- 
- # Branches ahead of main (needs merging)
- wt list --format=json | jq '.[] | select(.main.ahead > 0) | .branch'
- 
- # Integrated branches (safe to remove)
- wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_state == "empty") | .branch'
- 
- # Branches without worktrees
- wt list --format=json --branches | jq '.[] | select(.kind == "branch") | .branch'
- 
- # Worktrees ahead of remote (needs pushing)
- wt list --format=json | jq '.[] | select(.remote.ahead > 0) | {branch, ahead: .remote.ahead}'
- 
- # Stale CI (local changes not reflected in CI)
- wt list --format=json --full | jq '.[] | select(.ci.stale) | .branch'
+  # Current worktree path (for scripts)
+  wt list --format=json | jq -r '.[] | select(.is_current) | .path'
+  
+  # Branches with uncommitted changes
+  wt list --format=json | jq '.[] | select(.working_tree.modified)'
+  
+  # Worktrees with merge conflicts
+  wt list --format=json | jq '.[] | select(.operation_state == "conflicts")'
+  
+  # Branches ahead of main (needs merging)
+  wt list --format=json | jq '.[] | select(.main.ahead > 0) | .branch'
+  
+  # Integrated branches (safe to remove)
+  wt list --format=json | jq '.[] | select(.main_state == "integrated" or 
+  .main_state == "empty") | .branch'
+  
+  # Branches without worktrees
+  wt list --format=json --branches | jq '.[] | select(.kind == "branch") | 
+  .branch'
+  
+  # Worktrees ahead of remote (needs pushing)
+  wt list --format=json | jq '.[] | select(.remote.ahead > 0) | {branch, ahead: 
+  .remote.ahead}'
+  
+  # Stale CI (local changes not reflected in CI)
+  wt list --format=json --full | jq '.[] | select(.ci.stale) | .branch'
Fields:
- Field Type Description
- ────────────────── ─────────── ─────────────────────────────────────────────
- branch string/null Branch name (null for detached HEAD)
- path string Worktree path (absent for branches without
- worktrees)
- kind string "worktree" or "branch"
- commit object Commit info (see below)
- working_tree object Working tree state (see below)
- main_state string Relation to the default branch (see below)
- integration_reason string Why branch is integrated (see below)
- operation_state string "conflicts", "rebase", or "merge" (absent
- when clean)
- main object Relationship to the default branch (see
- below, absent when is_main)
- remote object Tracking branch info (see below, absent when
- no tracking)
- worktree object Worktree metadata (see below)
- is_main boolean Is the main worktree
- is_current boolean Is the current worktree
- is_previous boolean Previous worktree from wt switch
- ci object CI status (see below, absent when no CI)
- url string Dev server URL from project config (absent
- when not configured)
- url_active boolean Whether the URL's port is listening (absent
- when not configured)
- summary string LLM-generated branch summary (absent when not
- configured or no summary)
- statusline string Pre-formatted status with ANSI colors
- symbols string Raw status symbols without colors (e.g.,
- "!?↓")
+ Field Type Description
+ ────────────────── ─────────── ───────────────────────────────────────────────
+ branch string/null Branch name (null for detached HEAD)
+ path string Worktree path (absent for branches without
+ worktrees)
+ kind string "worktree" or "branch"
+ commit object Commit info (see below)
+ working_tree object Working tree state (see below)
+ main_state string Relation to the default branch (see below)
+ integration_reason string Why branch is integrated (see below)
+ operation_state string "conflicts", "rebase", or "merge" (absent when
+ clean)
+ main object Relationship to the default branch (see below,
+ absent when is_main)
+ remote object Tracking branch info (see below, absent when no
+ tracking)
+ worktree object Worktree metadata (see below)
+ is_main boolean Is the main worktree
+ is_current boolean Is the current worktree
+ is_previous boolean Previous worktree from wt switch
+ ci object CI status (see below, absent when no CI)
+ url string Dev server URL from project config (absent when
+ not configured)
+ url_active boolean Whether the URL's port is listening (absent
+ when not configured)
+ summary string LLM-generated branch summary (absent when not
+ configured or no summary)
+ statusline string Pre-formatted status with ANSI colors
+ symbols string Raw status symbols without colors (e.g., "!?↓")
Commit object
- Field Type Description
- ───────── ────── ───────────────────────────
- sha string Full commit SHA (40 chars)
- short_sha string Short commit SHA (7 chars)
- message string Commit message (first line)
- timestamp number Unix timestamp
+ Field Type Description
+ ───────── ────── ───────────────────────────
+ sha string Full commit SHA (40 chars)
+ short_sha string Short commit SHA (7 chars)
+ message string Commit message (first line)
+ timestamp number Unix timestamp
working_tree object
- Field Type Description
- ───────── ─────── ───────────────────────────────────────
- staged boolean Has staged files
- modified boolean Has modified files (unstaged)
- untracked boolean Has untracked files
- renamed boolean Has renamed files
- deleted boolean Has deleted files
- diff object Lines changed vs HEAD: {added, deleted}
+ Field Type Description
+ ───────── ─────── ───────────────────────────────────────
+ staged boolean Has staged files
+ modified boolean Has modified files (unstaged)
+ untracked boolean Has untracked files
+ renamed boolean Has renamed files
+ deleted boolean Has deleted files
+ diff object Lines changed vs HEAD: {added, deleted}
main object
- Field Type Description
- ────── ────── ─────────────────────────────────────────────────────
- ahead number Commits ahead of the default branch
- behind number Commits behind the default branch
- diff object Lines changed vs the default branch: {added, deleted}
+ Field Type Description
+ ────── ────── ─────────────────────────────────────────────────────
+ ahead number Commits ahead of the default branch
+ behind number Commits behind the default branch
+ diff object Lines changed vs the default branch: {added, deleted}
remote object
- Field Type Description
- ────── ────── ────────────────────────────
- name string Remote name (e.g., "origin")
- branch string Remote branch name
- ahead number Commits ahead of remote
- behind number Commits behind remote
+ Field Type Description
+ ────── ────── ────────────────────────────
+ name string Remote name (e.g., "origin")
+ branch string Remote branch name
+ ahead number Commits ahead of remote
+ behind number Commits behind remote
worktree object
- Field Type Description
- ──────── ─────── ───────────────────────────────────────────────────────────
- state string "no_worktree", "branch_worktree_mismatch", "prunable",
- "locked" (absent when normal)
- reason string Reason for locked/prunable state
- detached boolean HEAD is detached
+ Field Type Description
+ ──────── ─────── ─────────────────────────────────────────────────────────────
+ state string "no_worktree", "branch_worktree_mismatch", "prunable",
+ "locked" (absent when normal)
+ reason string Reason for locked/prunable state
+ detached boolean HEAD is detached
ci object
- Field Type Description
- ────── ─────── ─────────────────────────────────────────────────
- status string CI status (see below)
- source string "pr" (PR/MR) or "branch" (branch workflow)
- stale boolean Local HEAD differs from remote (unpushed changes)
- url string URL to the PR/MR page
+ Field Type Description
+ ────── ─────── ─────────────────────────────────────────────────
+ status string CI status (see below)
+ source string "pr" (PR/MR) or "branch" (branch workflow)
+ stale boolean Local HEAD differs from remote (unpushed changes)
+ url string URL to the PR/MR page
main_state values
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index bef60a7a8..361f9638e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -11,14 +11,18 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: /nonexistent/test/approvals.toml
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
+ WORKTRUNK_SYSTEM_CONFIG_PATH: /etc/xdg/worktrunk/config.toml
WORKTRUNK_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"
---
@@ -85,23 +89,23 @@ Unlike git merge, this merges current into target (not target into curre
Merge to the default branch:
- wt merge
+  wt merge
Merge to a different branch:
- wt merge develop
+  wt merge develop
Keep the worktree after merging:
- wt merge --no-remove
+  wt merge --no-remove
Preserve commit history (no squash):
- wt merge --no-squash
+  wt merge --no-squash
Skip committing/squashing (rebase still runs unless --no-rebase):
- wt merge --no-commit
+  wt merge --no-commit
Pipeline
@@ -125,9 +129,9 @@ Historically, ensuring tests ran before merging was difficult to enforce locally
The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run wt merge, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
- [pre-merge]
- test = "cargo test"
- lint = "cargo clippy"
+  [pre-merge]
+  test = "cargo test"
+  lint = "cargo clippy"
See also
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index aae18b84c..bb5f062da 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -11,6 +11,7 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
@@ -78,20 +79,20 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
Remove current worktree:
- wt remove
+  wt remove
Remove specific worktrees:
- wt remove feature-branch
- wt remove old-feature another-branch
+  wt remove feature-branch
+  wt remove old-feature another-branch
Keep the branch:
- wt remove --no-delete-branch feature-branch
+  wt remove --no-delete-branch feature-branch
Force-delete an unmerged branch:
- wt remove -D experimental
+  wt remove -D experimental
Branch cleanup
@@ -113,14 +114,14 @@ Branches showing _ or ⊂ are dimmed as safe to delete.
Worktrunk has two force flags for different situations:
- Flag Scope When to use
- ─────────────────── ──────── ──────────────────────────────────────────────────────────
- --force (-f) Worktree Worktree has untracked files (build artifacts, IDE config)
- --force-delete (-D) Branch Branch has unmerged commits
+ Flag Scope When to use
+ ─────────────────── ──────── ──────────────────────────────────────────────────────────
+ --force (-f) Worktree Worktree has untracked files (build artifacts, IDE config)
+ --force-delete (-D) Branch Branch has unmerged commits
- wt remove feature --force # Remove worktree with untracked files
- wt remove feature -D # Delete unmerged branch
- wt remove feature --force -D # Both
+  wt remove feature --force # Remove worktree with untracked files
+  wt remove feature -D # Delete unmerged branch
+  wt remove feature --force -D # Both
Without --force, removal fails if the worktree contains untracked files. Without -D, removal keeps branches with unmerged changes. Use --no-delete-branch to keep the branch regardless of merge status.
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_long.snap b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
index 6bae8832b..e389ab9c1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
@@ -67,14 +67,14 @@ Usage: wt step [OPTIONS] <COMMAND>
Commit with LLM-generated message:
- wt step commit
+  wt step commit
Manual merge workflow with review between steps:
- wt step commit
- wt step squash
- wt step rebase
- wt step push
+  wt step commit
+  wt step squash
+  wt step rebase
+  wt step push
Operations
@@ -94,15 +94,15 @@ Manual merge workflow with review between steps:
Custom command templates configured in user config (~/.config/worktrunk/config.toml) or project config (.config/wt.toml). Aliases support the same template variables as hooks.
- # .config/wt.toml
- [aliases]
- deploy = "make deploy BRANCH={{ branch }}"
- port = "echo http://localhost:{{ branch | hash_port }}"
+  # .config/wt.toml
+  [aliases]
+  deploy = "make deploy BRANCH={{ branch }}"
+  port = "echo http://localhost:{{ branch | hash_port }}"
- wt step deploy # run the alias
- wt step deploy --dry-run # show expanded command
- wt step deploy --var env=staging # pass extra template variables
- wt step deploy --yes # skip approval prompt
+  wt step deploy # run the alias
+  wt step deploy --dry-run # show expanded command
+  wt step deploy --var env=staging # pass extra template variables
+  wt step deploy --yes # skip approval prompt
When defined in both user and project config, user aliases take precedence. Project-config aliases require command approval on first run (same as project hooks). User-config aliases are trusted.
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
index aa09aaa2f..b8ad717f2 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
@@ -12,6 +12,7 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
@@ -61,20 +62,20 @@ Usage: wt step promote [OPTIONS] [BRANCH]
Example
- # from ~/project (main worktree)
- $ wt step promote feature
+  # from ~/project (main worktree)
+  $ wt step promote feature
Before:
-  Branch Path
- @ main ~/project
- + feature ~/project.feature
+   Branch Path
+  @ main ~/project
+  + feature ~/project.feature
After:
-  Branch Path
- @ feature ~/project
- + main ~/project.feature
+   Branch Path
+  @ feature ~/project
+  + main ~/project.feature
To restore: wt step promote main from anywhere, or just wt step promote from the main worktree.
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 8fb9afab6..894f4f69d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -109,11 +109,11 @@ Worktrees are addressed by branch name; paths are computed from a configurable t
Examples
- wt switch feature-auth # Switch to worktree
- wt switch - # Previous worktree (like cd -)
- wt switch --create new-feature # Create new branch and worktree
- wt switch --create hotfix --base production
- wt switch pr:123 # Switch to PR #123's branch
+  wt switch feature-auth # Switch to worktree
+  wt switch - # Previous worktree (like cd -)
+  wt switch --create new-feature # Create new branch and worktree
+  wt switch --create hotfix --base production
+  wt switch pr:123 # Switch to PR #123's branch
Creating a branch
@@ -134,26 +134,26 @@ When creating a worktree, worktrunk:
3. Runs post-create hooks (blocking)
4. Spawns post-start hooks (background)
- wt switch feature # Existing branch → creates worktree
- wt switch --create feature # New branch and worktree
- wt switch --create fix --base release # New branch from release
- wt switch --create temp --no-verify # Skip hooks
+  wt switch feature # Existing branch → creates worktree
+  wt switch --create feature # New branch and worktree
+  wt switch --create fix --base release # New branch from release
+  wt switch --create temp --no-verify # Skip hooks
Shortcuts
- Shortcut Meaning
- ──────── ─────────────────────────────
- ^ Default branch (main/master)
- @ Current branch/worktree
- - Previous worktree (like cd -)
- pr:{N} GitHub PR #N's branch
- mr:{N} GitLab MR !N's branch
+ Shortcut Meaning
+ ──────── ─────────────────────────────
+ ^ Default branch (main/master)
+ @ Current branch/worktree
+ - Previous worktree (like cd -)
+ pr:{N} GitHub PR #N's branch
+ mr:{N} GitLab MR !N's branch
- wt switch - # Back to previous
- wt switch ^ # Default branch worktree
- wt switch --create fix --base=@ # Branch from current HEAD
- wt switch pr:123 # PR #123's branch
- wt switch mr:101 # MR !101's branch
+  wt switch - # Back to previous
+  wt switch ^ # Default branch worktree
+  wt switch --create fix --base=@ # Branch from current HEAD
+  wt switch pr:123 # PR #123's branch
+  wt switch mr:101 # MR !101's branch
Interactive picker
@@ -161,17 +161,17 @@ When called without arguments, wt switch opens an interactive picker to
Keybindings:
- Key Action
- ───────────── ──────────────────────────────
- ↑/↓ Navigate worktree list
- (type) Filter worktrees
- Enter Switch to selected worktree
- Alt-c Create new worktree from query
- Alt-r Remove selected worktree
- Esc Cancel
- 1–5 Switch preview tab
- Alt-p Toggle preview panel
- Ctrl-u/Ctrl-d Scroll preview up/down
+ Key Action
+ ───────────── ──────────────────────────────
+ ↑/↓ Navigate worktree list
+ (type) Filter worktrees
+ Enter Switch to selected worktree
+ Alt-c Create new worktree from query
+ Alt-r Remove selected worktree
+ Esc Cancel
+ 1–5 Switch preview tab
+ Alt-p Toggle preview panel
+ Ctrl-u/Ctrl-d Scroll preview up/down
Preview tabs (toggle with number keys):
@@ -183,8 +183,8 @@ When called without arguments, wt switch opens an interactive picker to
Pager configuration: The preview panel pipes diff output through git's pager. Override in user config:
- [switch.picker]
- pager = "delta --paging=never --width=$COLUMNS"
+  [switch.picker]
+  pager = "delta --paging=never --width=$COLUMNS"
Available on Unix only (macOS, Linux). On Windows, use wt list or wt switch <branch> directly.
@@ -192,7 +192,7 @@ Available on Unix only (macOS, Linux). On Windows, use wt list or wt
The pr:<number> syntax resolves the branch for a GitHub pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches refs/pull/N/head and configures pushRemote to the fork URL.
- wt switch pr:101 # Checkout PR #101
+  wt switch pr:101 # Checkout PR #101
Requires gh CLI to be installed and authenticated. The --create flag cannot be used with pr: syntax since the branch already exists.
@@ -202,7 +202,7 @@ Requires gh CLI to be installed and authenticated. The --create
The mr:<number> syntax resolves the branch for a GitLab merge request. For same-project MRs, it switches to the branch directly. For fork MRs, it fetches refs/merge-requests/N/head and configures pushRemote to the fork URL.
- wt switch mr:101 # Checkout MR !101
+  wt switch mr:101 # Checkout MR !101
Requires glab CLI to be installed and authenticated. The --create flag cannot be used with mr: syntax since the branch already exists.