Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Name the template owner in the -v variables block (#3495)
Maximilian Roos85c9241cb18b
diff --git a/docs/content/step.md b/docs/content/step.mdindex 8f05a6078..e7629361d 100644--- a/docs/content/step.md+++ b/docs/content/step.md@@ -551,7 +551,7 @@ feature_auth_oauth2_a1bList the available template variables with `-v` (alongside the expansion, on stderr):{% terminal(cmd="wt step eval -v '__WT_OPEN__ branch __WT_CLOSE__'") %}-○ Available template variables+○ eval template variables:branch = feature/auth-oauth2worktree_path = /home/user/projects/myapp-feature-auth-oauth2○ eval sourcediff --git a/plugins/worktrunk/skills/worktrunk/reference/step.md b/plugins/worktrunk/skills/worktrunk/reference/step.mdindex 85d72b08e..82fa91d43 100644--- a/plugins/worktrunk/skills/worktrunk/reference/step.md+++ b/plugins/worktrunk/skills/worktrunk/reference/step.md@@ -568,7 +568,7 @@ List the available template variables with `-v` (alongside the expansion, on std```bash$ wt step eval -v '{{ branch }}'-○ Available template variables+○ eval template variables:branch = feature/auth-oauth2worktree_path = /home/user/projects/myapp-feature-auth-oauth2○ eval sourcediff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.mdindex 85d72b08e..82fa91d43 100644--- a/skills/worktrunk/reference/step.md+++ b/skills/worktrunk/reference/step.md@@ -568,7 +568,7 @@ List the available template variables with `-v` (alongside the expansion, on std```bash$ wt step eval -v '{{ branch }}'-○ Available template variables+○ eval template variables:branch = feature/auth-oauth2worktree_path = /home/user/projects/myapp-feature-auth-oauth2○ eval sourcediff --git a/src/cli/step.rs b/src/cli/step.rsindex 084cb8db2..a4d9d67e5 100644--- a/src/cli/step.rs+++ b/src/cli/step.rs@@ -439,7 +439,7 @@ List the available template variables with `-v` (alongside the expansion, on std```console$ wt step eval -v '{{ branch }}'-○ Available template variables+○ eval template variables:branch = feature/auth-oauth2worktree_path = /home/user/projects/myapp-feature-auth-oauth2○ eval sourcediff --git a/src/commands/alias.rs b/src/commands/alias.rsindex cc2dcd350..a321ff8c0 100644--- a/src/commands/alias.rs+++ b/src/commands/alias.rs@@ -618,7 +618,10 @@ fn run_alias(if verbosity() >= 1 {let vars = format_alias_variables(&context_map, Some(&referenced));- eprintln!("{}", info_message("template variables:"));+ eprintln!(+ "{}",+ info_message(cformat!("<bold>{}</> template variables:", opts.name))+ );eprintln!("{}", format_with_gutter(&vars, None));}diff --git a/src/commands/command_executor.rs b/src/commands/command_executor.rsindex 7bf2b21a2..885fc97f1 100644--- a/src/commands/command_executor.rs+++ b/src/commands/command_executor.rs@@ -628,7 +628,10 @@ fn announce_command(cmd: &PreparedCommand, kind: &PipelineKind, command_str: &st};if verbosity() >= 1 {let vars = format_hook_variables(*hook_type, &cmd.context);- eprintln!("{}", info_message("template variables:"));+ eprintln!(+ "{}",+ info_message(cformat!("<bold>{hook_type}</> template variables:"))+ );eprintln!("{}", format_with_gutter(&vars, None));}eprintln!("{}", progress_message(message));diff --git a/src/commands/eval.rs b/src/commands/eval.rsindex 277ec7f88..1fe01fb82 100644--- a/src/commands/eval.rs+++ b/src/commands/eval.rs@@ -51,7 +51,10 @@ pub fn step_eval(template: &str, format: SwitchFormat) -> anyhow::Result<()> {}).collect::<Vec<_>>().join("\n");- eprintln!("{}", info_message("Available template variables"));+ eprintln!(+ "{}",+ info_message(cformat!("<bold>{EVAL_NAME}</> template variables:"))+ );eprintln!("{}", format_with_gutter(&listing, None));}diff --git a/src/commands/hooks.rs b/src/commands/hooks.rsindex 9b9d9078c..39da3cfbd 100644--- a/src/commands/hooks.rs+++ b/src/commands/hooks.rs@@ -465,7 +465,10 @@ fn print_background_variable_table(pipelines: &[PendingPipeline], hook_type: HooPreparedStep::Single(cmd) => cmd,PreparedStep::Concurrent(cmds) => &cmds[0],};- eprintln!("{}", info_message("template variables:"));+ eprintln!(+ "{}",+ info_message(cformat!("<bold>{hook_type}</> template variables:"))+ );eprintln!("{}",format_with_gutter(&format_hook_variables(hook_type, &cmd.context), None)diff --git a/tests/snapshots/integration__integration_tests__eval__eval_format_json_verbose.snap b/tests/snapshots/integration__integration_tests__eval__eval_format_json_verbose.snapindex e58a3161f..18a1cf9bf 100644--- a/tests/snapshots/integration__integration_tests__eval__eval_format_json_verbose.snap+++ b/tests/snapshots/integration__integration_tests__eval__eval_format_json_verbose.snap@@ -10,6 +10,7 @@ info:- "{{ branch | hash_port }}"env:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -38,6 +39,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -54,7 +56,7 @@ exit_code: 0}----- stderr ------[2m○[22m Available template variables+[2m○[22m [1meval[22m template variables:[107m [0m [1mbranch[22m = main[107m [0m [1mcommit[22m = 05a4a45d0b981dad5c27db59dca482836d59f89e[107m [0m [1mcwd[22m = _REPO_diff --git a/tests/snapshots/integration__integration_tests__eval__eval_verbose.snap b/tests/snapshots/integration__integration_tests__eval__eval_verbose.snapindex 6331f4e6e..031080134 100644--- a/tests/snapshots/integration__integration_tests__eval__eval_verbose.snap+++ b/tests/snapshots/integration__integration_tests__eval__eval_verbose.snap@@ -9,6 +9,7 @@ info:- "{{ branch | hash_port }}"env:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -37,6 +38,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -49,7 +51,7 @@ exit_code: 012107----- stderr ------[2m○[22m Available template variables+[2m○[22m [1meval[22m template variables:[107m [0m [1mbranch[22m = main[107m [0m [1mcommit[22m = 05a4a45d0b981dad5c27db59dca482836d59f89e[107m [0m [1mcwd[22m = _REPO_diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_output.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_output.snapindex 43d4a6fcc..ed0d68051 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_output.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_output.snap@@ -9,6 +9,7 @@ info:- featureenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -37,6 +38,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -56,7 +58,7 @@ exit_code: 0[2m↳[22m [2mTo customize worktree locations, run [4mwt config create[24m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [4mwt config shell install[24m[22m-[2m○[22m template variables:+[2m○[22m [1mpost-start[22m template variables:[107m [0m branch = feature[107m [0m worktree_path = _REPO_.feature[107m [0m worktree_name = repo.featurediff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_template_expansion.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_template_expansion.snapindex 801da48b3..f4626fe73 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_template_expansion.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_verbose_template_expansion.snap@@ -9,6 +9,7 @@ info:- verbose-hooksenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -37,6 +38,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -56,7 +58,7 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Setting up {{ branch | sanitize }} in {{ worktree_path }}'[0m[2m○[22m [1mproject:setup[22m result[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Setting up verbose-hooks in _REPO_.verbose-hooks'[0m-[2m○[22m template variables:+[2m○[22m [1mpre-start[22m template variables:[107m [0m branch = verbose-hooks[107m [0m worktree_path = _REPO_.verbose-hooks[107m [0m worktree_name = repo.verbose-hooksdiff --git a/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_args_shell_escaped.snap b/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_args_shell_escaped.snapindex 4bd1f29c2..3c2c86673 100644--- a/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_args_shell_escaped.snap+++ b/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_args_shell_escaped.snap@@ -9,6 +9,7 @@ info:- bar bazenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -37,6 +38,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -49,7 +51,7 @@ exit_code: 0hello foo bar baz----- stderr ------[2m○[22m template variables:+[2m○[22m [1mgreet[22m template variables:[107m [0m branch = feature[107m [0m worktree_path = _REPO_.feature[107m [0m worktree_name = repo.featurediff --git a/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_variable_table.snap b/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_variable_table.snapindex 133928cef..8f1787f5d 100644--- a/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_variable_table.snap+++ b/tests/snapshots/integration__integration_tests__step_alias__alias_verbose_variable_table.snap@@ -8,6 +8,7 @@ info:- worldenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -36,6 +37,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -48,7 +50,7 @@ exit_code: 0hello world----- stderr ------[2m○[22m template variables:+[2m○[22m [1mgreet[22m template variables:[107m [0m branch = feature[107m [0m worktree_path = _REPO_.feature[107m [0m worktree_name = repo.featurediff --git a/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snap b/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snapindex cb272a0f5..36e8cc153 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__combined_post_remove_and_post_switch_verbose.snap@@ -38,6 +38,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -52,7 +53,7 @@ exit_code: 0[36m◎[39m [36mRemoving [1mfeature[22m worktree & branch in background (--force-delete)[39m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [4mwt config shell install[24m[22m-[2m○[22m template variables:+[2m○[22m [1mpost-remove[22m template variables:[107m [0m branch = feature[107m [0m worktree_path = _REPO_.feature[107m [0m worktree_name = repo.feature@@ -71,7 +72,7 @@ exit_code: 0[107m [0m cwd = _REPO_[107m [0m hook_type = post-remove[107m [0m hook_name = cleanup-[2m○[22m template variables:+[2m○[22m [1mpost-switch[22m template variables:[107m [0m branch = main[107m [0m worktree_path = _REPO_[107m [0m worktree_name = repodiff --git a/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_background_dedup.snap b/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_background_dedup.snapindex 848d57dfd..e55a5cc95 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_background_dedup.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_background_dedup.snap@@ -9,6 +9,7 @@ info:- featureenv:APPDATA: "[TEST_CONFIG_HOME]"+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"CLICOLOR_FORCE: "1"COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"@@ -37,6 +38,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -56,7 +58,7 @@ exit_code: 0[2m↳[22m [2mTo customize worktree locations, run [4mwt config create[24m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [4mwt config shell install[24m[22m-[2m○[22m template variables:+[2m○[22m [1mpost-start[22m template variables:[107m [0m branch = feature[107m [0m worktree_path = _REPO_.feature[107m [0m worktree_name = repo.featurediff --git a/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snap b/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snapindex a92b95513..398447a0b 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__hook_verbose_variable_table.snap@@ -37,6 +37,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -52,7 +53,7 @@ exit_code: 0[107m [0m [2m[0m[2m[34mtrue[0m[2m○[22m [1muser:noop[22m result[107m [0m [2m[0m[2m[34mtrue[0m-[2m○[22m template variables:+[2m○[22m [1mpre-switch[22m template variables:[107m [0m branch = feature[107m [0m worktree_path = _REPO_.feature[107m [0m worktree_name = repo.feature