Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/step.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ feature_auth_oauth2_a1b
List 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-oauth2
worktree_path = /home/user/projects/myapp-feature-auth-oauth2
○ eval source
Expand Down
2 changes: 1 addition & 1 deletion plugins/worktrunk/skills/worktrunk/reference/step.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-oauth2
worktree_path = /home/user/projects/myapp-feature-auth-oauth2
○ eval source
Expand Down
2 changes: 1 addition & 1 deletion skills/worktrunk/reference/step.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cli/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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-oauth2
worktree_path = /home/user/projects/myapp-feature-auth-oauth2
○ eval source
Expand Down
5 changes: 4 additions & 1 deletion src/commands/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
5 changes: 4 additions & 1 deletion src/commands/command_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
5 changes: 4 additions & 1 deletion src/commands/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
5 changes: 4 additions & 1 deletion src/commands/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ fn print_background_variable_table(pipelines: &[PendingPipeline], hook_type: Hoo
PreparedStep::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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -54,7 +56,7 @@ exit_code: 0
}

----- stderr -----
○ Available template variables
○ eval template variables:
  branch = main
  commit = 05a4a45d0b981dad5c27db59dca482836d59f89e
  cwd = _REPO_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -49,7 +51,7 @@ exit_code: 0
12107

----- stderr -----
○ Available template variables
○ eval template variables:
  branch = main
  commit = 05a4a45d0b981dad5c27db59dca482836d59f89e
  cwd = _REPO_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ info:
- feature
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
CLICOLOR_FORCE: "1"
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
Expand Down Expand Up @@ -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"
Expand All @@ -56,7 +58,7 @@ exit_code: 0
↳ To customize worktree locations, run wt config create
▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
○ template variables:
○ post-start template variables:
  branch = feature
  worktree_path = _REPO_.feature
  worktree_name = repo.feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ info:
- verbose-hooks
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
CLICOLOR_FORCE: "1"
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
Expand Down Expand Up @@ -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"
Expand All @@ -56,7 +58,7 @@ exit_code: 0
  echo 'Setting up {{ branch | sanitize }} in {{ worktree_path }}'
○ project:setup result
  echo 'Setting up verbose-hooks in _REPO_.verbose-hooks'
○ template variables:
○ pre-start template variables:
  branch = verbose-hooks
  worktree_path = _REPO_.verbose-hooks
  worktree_name = repo.verbose-hooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ info:
- bar baz
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
CLICOLOR_FORCE: "1"
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
Expand Down Expand Up @@ -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"
Expand All @@ -49,7 +51,7 @@ exit_code: 0
hello foo bar baz

----- stderr -----
○ template variables:
○ greet template variables:
  branch = feature
  worktree_path = _REPO_.feature
  worktree_name = repo.feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ info:
- world
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
CLICOLOR_FORCE: "1"
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
Expand Down Expand Up @@ -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"
Expand All @@ -48,7 +50,7 @@ exit_code: 0
hello world

----- stderr -----
○ template variables:
○ greet template variables:
  branch = feature
  worktree_path = _REPO_.feature
  worktree_name = repo.feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -52,7 +53,7 @@ exit_code: 0
◎ Removing feature worktree & branch in background (--force-delete)
▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
○ template variables:
○ post-remove template variables:
  branch = feature
  worktree_path = _REPO_.feature
  worktree_name = repo.feature
Expand All @@ -71,7 +72,7 @@ exit_code: 0
  cwd = _REPO_
  hook_type = post-remove
  hook_name = cleanup
○ template variables:
○ post-switch template variables:
  branch = main
  worktree_path = _REPO_
  worktree_name = repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ info:
- feature
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
CLICOLOR_FORCE: "1"
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
Expand Down Expand Up @@ -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"
Expand All @@ -56,7 +58,7 @@ exit_code: 0
↳ To customize worktree locations, run wt config create
▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
○ template variables:
○ post-start template variables:
  branch = feature
  worktree_path = _REPO_.feature
  worktree_name = repo.feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -52,7 +53,7 @@ exit_code: 0
  true
○ user:noop result
  true
○ template variables:
○ pre-switch template variables:
  branch = feature
  worktree_path = _REPO_.feature
  worktree_name = repo.feature
Expand Down
Loading