Skip to content

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

Add WORKTRUNK_VERBOSE env var equivalent to -v/-vv (#3166)

Maximilian Roos3d0b99e072e6
diff --git a/docs/content/config.md b/docs/content/config.md
index 024391213..65d39a015 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -611,6 +611,8 @@ Override the LLM command in CI to use a mock:
| `WORKTRUNK_DIRECTIVE_EXEC_FILE` | Internal: set by shell wrappers. wt writes shell commands; the wrapper sources the file |
| `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. |
+| `WORKTRUNK_VERBOSE` | Verbosity level (`0`/`1`/`2`), like `-v`/`-vv` but applied everywhere — including shell completion, which no flag can reach |
+| `RUST_LOG` | Logging directive (e.g. `worktrunk=debug`); overrides the verbosity baseline for what reaches stderr |
| `NO_COLOR` | Disable colored output ([standard](https://no-color.org/)) |
| `CLICOLOR_FORCE` | Force colored output even when not a TTY |
@@ -657,7 +659,8 @@ Usage: <b><span class=c>wt config</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -718,7 +721,8 @@ Usage: <b><span class=c>wt config show</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -772,7 +776,8 @@ Usage: <b><span class=c>wt config approvals</span></b> <span class=c>[OPTIONS]</
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -822,7 +827,8 @@ Usage: <b><span class=c>wt config alias</span></b> <span class=c>[OPTIONS]</span
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -897,7 +903,8 @@ Usage: <b><span class=c>wt config state</span></b> <span class=c>[OPTIONS]</span
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -960,7 +967,8 @@ Usage: <b><span class=c>wt config state cache</span></b> <span class=c>[OPTIONS]
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -1027,7 +1035,8 @@ Usage: <b><span class=c>wt config state default-branch</span></b> <span class=c>
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -1135,7 +1144,8 @@ Usage: <b><span class=c>wt config state logs</span></b> <span class=c>[OPTIONS]<
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -1201,7 +1211,8 @@ Usage: <b><span class=c>wt config state ci-status</span></b> <span class=c>[OPTI
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -1273,7 +1284,8 @@ Usage: <b><span class=c>wt config state marker</span></b> <span class=c>[OPTIONS
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -1351,7 +1363,8 @@ Usage: <b><span class=c>wt config state vars</span></b> <span class=c>[OPTIONS]<
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
diff --git a/docs/content/faq.md b/docs/content/faq.md
index a3543f715..8bf125456 100644
--- a/docs/content/faq.md
+++ b/docs/content/faq.md
@@ -107,6 +107,8 @@ The three `-vv` files have distinct audiences:
`RUST_LOG` overrides the flag baseline when set (`RUST_LOG=debug wt -v` lifts `-v` to debug-on-stderr).
+The flags only reach a command you type; shell completion runs as its own process with nowhere to pass one. Set `WORKTRUNK_VERBOSE=0|1|2` to apply the level to *every* invocation, completion included — it's the env-var equivalent of `-v`/`-vv`, so level 2 writes the same `trace.log`/`subprocess.log`/`diagnostic.md` files. An explicit `-v`/`-vv` on a command raises the level further but never lowers this baseline. To profile a slow tab-completion, run it the way your shell does — e.g. `WORKTRUNK_VERBOSE=2 COMPLETE=fish wt -- wt switch ''` — then read `trace.log`.
+
## What files does Worktrunk create?
### 1. Worktree directories
diff --git a/docs/content/hook.md b/docs/content/hook.md
index b890e27d0..6acb38b40 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -372,7 +372,8 @@ Usage: <b><span class=c>wt hook</span></b> <span class=c>[OPTIONS]</span> <span
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
diff --git a/docs/content/list.md b/docs/content/list.md
index aee840338..aef634527 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -401,7 +401,8 @@ Usage: <b><span class=c>wt list</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
diff --git a/docs/content/merge.md b/docs/content/merge.md
index e7a94682a..6b9ab1c94 100644
--- a/docs/content/merge.md
+++ b/docs/content/merge.md
@@ -159,7 +159,8 @@ Usage: <b><span class=c>wt merge</span></b> <span class=c>[OPTIONS]</span> <span
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 91a82eeab..57ce43ab0 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -142,7 +142,8 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
diff --git a/docs/content/step.md b/docs/content/step.md
index 3142bbb77..a871689df 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -87,7 +87,8 @@ Usage: <b><span class=c>wt step</span></b> <span class=c>[OPTIONS]</span> <span
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -179,7 +180,8 @@ Usage: <b><span class=c>wt step commit</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -274,7 +276,8 @@ Usage: <b><span class=c>wt step squash</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -349,7 +352,8 @@ Usage: <b><span class=c>wt step diff</span></b> <span class=c>[OPTIONS]</span> <
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -502,7 +506,8 @@ Usage: <b><span class=c>wt step copy-ignored</span></b> <span class=c>[OPTIONS]<
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -594,7 +599,8 @@ Usage: <b><span class=c>wt step eval</span></b> <span class=c>[OPTIONS]</span> <
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -669,7 +675,8 @@ Usage: <b><span class=c>wt step for-each</span></b> <span class=c>[OPTIONS]</spa
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -749,7 +756,8 @@ Usage: <b><span class=c>wt step promote</span></b> <span class=c>[OPTIONS]</span
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -823,7 +831,8 @@ Usage: <b><span class=c>wt step prune</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -937,7 +946,8 @@ Usage: <b><span class=c>wt step relocate</span></b> <span class=c>[OPTIONS]</spa
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
@@ -1011,7 +1021,8 @@ Usage: <b><span class=c>wt step tether</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
diff --git a/docs/content/switch.md b/docs/content/switch.md
index 8e375afd2..f8622a74c 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -224,7 +224,8 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
<b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
diff --git a/skills/worktrunk/reference/config.md b/skills/worktrunk/reference/config.md
index 5f60aa042..808a8465f 100644
--- a/skills/worktrunk/reference/config.md
+++ b/skills/worktrunk/reference/config.md
@@ -608,6 +608,8 @@ $ WORKTRUNK_COMMIT__GENERATION__COMMAND="echo 'test: automated commit'" wt merge
| `WORKTRUNK_DIRECTIVE_EXEC_FILE` | Internal: set by shell wrappers. wt writes shell commands; the wrapper sources the file |
| `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. |
+| `WORKTRUNK_VERBOSE` | Verbosity level (`0`/`1`/`2`), like `-v`/`-vv` but applied everywhere — including shell completion, which no flag can reach |
+| `RUST_LOG` | Logging directive (e.g. `worktrunk=debug`); overrides the verbosity baseline for what reaches stderr |
| `NO_COLOR` | Disable colored output ([standard](https://no-color.org/)) |
| `CLICOLOR_FORCE` | Force colored output even when not a TTY |
@@ -657,7 +659,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -720,7 +723,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -780,7 +784,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -837,7 +842,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -926,7 +932,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -993,7 +1000,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -1062,7 +1070,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -1180,7 +1189,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -1246,7 +1256,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -1321,7 +1332,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -1410,7 +1422,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/skills/worktrunk/reference/faq.md b/skills/worktrunk/reference/faq.md
index d5d148226..ca1f05e30 100644
--- a/skills/worktrunk/reference/faq.md
+++ b/skills/worktrunk/reference/faq.md
@@ -100,6 +100,8 @@ The three `-vv` files have distinct audiences:
`RUST_LOG` overrides the flag baseline when set (`RUST_LOG=debug wt -v` lifts `-v` to debug-on-stderr).
+The flags only reach a command you type; shell completion runs as its own process with nowhere to pass one. Set `WORKTRUNK_VERBOSE=0|1|2` to apply the level to *every* invocation, completion included — it's the env-var equivalent of `-v`/`-vv`, so level 2 writes the same `trace.log`/`subprocess.log`/`diagnostic.md` files. An explicit `-v`/`-vv` on a command raises the level further but never lowers this baseline. To profile a slow tab-completion, run it the way your shell does — e.g. `WORKTRUNK_VERBOSE=2 COMPLETE=fish wt -- wt switch ''` — then read `trace.log`.
+
## What files does Worktrunk create?
### 1. Worktree directories
diff --git a/skills/worktrunk/reference/hook.md b/skills/worktrunk/reference/hook.md
index c35660e53..7956c5dcb 100644
--- a/skills/worktrunk/reference/hook.md
+++ b/skills/worktrunk/reference/hook.md
@@ -368,7 +368,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/skills/worktrunk/reference/list.md b/skills/worktrunk/reference/list.md
index 13e4ae53d..ac8052df2 100644
--- a/skills/worktrunk/reference/list.md
+++ b/skills/worktrunk/reference/list.md
@@ -406,7 +406,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/skills/worktrunk/reference/merge.md b/skills/worktrunk/reference/merge.md
index be6e4633a..e114fb1e9 100644
--- a/skills/worktrunk/reference/merge.md
+++ b/skills/worktrunk/reference/merge.md
@@ -148,7 +148,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/skills/worktrunk/reference/remove.md b/skills/worktrunk/reference/remove.md
index e97f91eea..c5b103f8a 100644
--- a/skills/worktrunk/reference/remove.md
+++ b/skills/worktrunk/reference/remove.md
@@ -140,7 +140,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.md
index 44f827137..2c6b9d1fc 100644
--- a/skills/worktrunk/reference/step.md
+++ b/skills/worktrunk/reference/step.md
@@ -78,7 +78,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -174,7 +175,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -273,7 +275,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -360,7 +363,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -513,7 +517,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -611,7 +616,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -696,7 +702,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -779,7 +786,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -860,7 +868,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -982,7 +991,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -1060,7 +1070,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/skills/worktrunk/reference/switch.md b/skills/worktrunk/reference/switch.md
index 17562bdc3..862598deb 100644
--- a/skills/worktrunk/reference/switch.md
+++ b/skills/worktrunk/reference/switch.md
@@ -219,7 +219,8 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
- logs and raw subprocess output written to .git/wt/logs/)
+ logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
+ apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index f3ffddf13..03cfb0acf 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -267,7 +267,7 @@ pub(crate) struct Cli {
)]
pub config_override: Vec<String>,
- /// Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ /// Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach.
#[arg(
long,
short = 'v',
@@ -2302,6 +2302,8 @@ $ WORKTRUNK_COMMIT__GENERATION__COMMAND="echo 'test: automated commit'" wt merge
| `WORKTRUNK_DIRECTIVE_EXEC_FILE` | Internal: set by shell wrappers. wt writes shell commands; the wrapper sources the file |
| `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. |
+| `WORKTRUNK_VERBOSE` | Verbosity level (`0`/`1`/`2`), like `-v`/`-vv` but applied everywhere — including shell completion, which no flag can reach |
+| `RUST_LOG` | Logging directive (e.g. `worktrunk=debug`); overrides the verbosity baseline for what reaches stderr |
| `NO_COLOR` | Disable colored output ([standard](https://no-color.org/)) |
| `CLICOLOR_FORCE` | Force colored output even when not a TTY |
diff --git a/src/completion.rs b/src/completion.rs
index 737706df6..46014e412 100644
--- a/src/completion.rs
+++ b/src/completion.rs
@@ -27,6 +27,18 @@ pub(crate) fn maybe_handle_env_completion() -> bool {
// warnings for the duration of this process.
worktrunk::config::suppress_warnings();
+ // Completion exits before `main`'s `logging::init`, so the normal
+ // `-v`/`-vv` pipeline never runs here. `WORKTRUNK_VERBOSE` opts this
+ // short-lived subprocess into the same logging as a flagged command — the
+ // env-var equivalent of `-vv` — so `[wt-trace]` timing and `$ git …`
+ // records for a slow completion land in `.git/wt/logs/` just as `-vv`
+ // writes them. Left unset, completion stays silent so stray stderr never
+ // lands above the user's prompt.
+ let completion_verbose = crate::logging::env_verbose_level();
+ if completion_verbose > 0 {
+ crate::logging::init(completion_verbose);
+ }
+
let mut args: Vec<OsString> = std::env::args_os().collect();
CONTEXT.with(|ctx| *ctx.borrow_mut() = Some(CompletionContext { args: args.clone() }));
@@ -649,10 +661,17 @@ fn try_forward_completion_to_custom(
if let Some(idx) = index {
cmd.env("_CLAP_COMPLETE_INDEX", idx.to_string());
}
-
- // Capture stdout from the custom binary. Using std::process::Command
- // directly (not shell_exec::Cmd) because this runs during completion —
- // a short-lived subprocess where logging/tracing is unwanted.
+ // Don't propagate `WORKTRUNK_VERBOSE` to the forwarded binary: at level 2 a
+ // worktrunk-family child would re-run `logging::init` and truncate the
+ // repo-wide `.git/wt/logs/` trace files this completion just wrote — wasted
+ // work at best, the parent's trace lost at worst (the child's stderr is
+ // discarded below, so it can't surface anything useful anyway).
+ cmd.env_remove(crate::logging::VERBOSE_ENV);
+
+ // Capture the custom binary's stdout — it carries the forwarded completion
+ // candidates. Uses `std::process::Command` rather than `shell_exec::Cmd`
+ // because we only need that captured stdout, not `Cmd`'s tracing/streaming;
+ // stderr is discarded so the child can't write above the user's prompt.
let result = cmd
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null())
diff --git a/src/logging.rs b/src/logging.rs
index d542b09f2..facff7686 100644
--- a/src/logging.rs
+++ b/src/logging.rs
@@ -433,6 +433,29 @@ fn rust_log_level() -> Option<log::LevelFilter> {
.max()
}
+/// Environment variable mirroring the `-v`/`-vv` flags as a level
+/// (`0`/`1`/`2`) — the env-var equivalent of the flag. Unlike the flag it is
+/// read everywhere, including shell completion, which exits before `main`
+/// parses the CLI; that is the only way to drive completion's logging (and, at
+/// level 2, the `-vv` trace files). Combined with the flag via `max`: the env
+/// sets a baseline the flag can raise but never lower.
+pub(crate) const VERBOSE_ENV: &str = "WORKTRUNK_VERBOSE";
+
+/// Read [`VERBOSE_ENV`] from the process environment into a verbosity count.
+/// See [`parse_verbose_level`] for the grammar.
+pub(crate) fn env_verbose_level() -> u8 {
+ parse_verbose_level(std::env::var(VERBOSE_ENV).ok().as_deref())
+}
+
+/// Pure parse of a [`VERBOSE_ENV`] value into a `0`/`1`/`2…` count. Unset,
+/// empty, or unparsable values yield `0`; the parse is lossy (never errors) so
+/// a stray value can't break a command — least of all completion, where it
+/// would corrupt the candidate list. Extracted as a pure function so it can be
+/// unit-tested without mutating the process env (which races parallel tests).
+fn parse_verbose_level(raw: Option<&str>) -> u8 {
+ raw.and_then(|v| v.trim().parse::<u8>().ok()).unwrap_or(0)
+}
+
/// Stderr layer: the flag sets a baseline (`Off` / `Info` / `Info`) and
/// `RUST_LOG`, when set, overrides via the standard directive grammar —
/// matching the env-wins-when-set convention (see PR #2901). At `-vv`
@@ -550,7 +573,7 @@ mod tests {
use super::{
WT_TRACE_TARGET, WtTraceFields, effective_log_max_level, format_wt_trace,
- label_for_thread_index, style_stderr_line,
+ label_for_thread_index, parse_verbose_level, style_stderr_line,
};
/// Branch coverage for `label_for_thread_index` — `thread_label` never
@@ -783,4 +806,25 @@ mod tests {
// suppress, not just raise):
assert_eq!(effective_log_max_level(2, Some(Warn)), Warn);
}
+
+ /// `WORKTRUNK_VERBOSE` parses like the `-v`/`-vv` count. Anything that
+ /// isn't a clean integer (including the empty string a bare `export`
+ /// leaves) falls back to `0` rather than erroring — a panic here would
+ /// corrupt the completion candidate list.
+ #[test]
+ fn parse_verbose_level_is_lossy() {
+ assert_eq!(parse_verbose_level(None), 0);
+ assert_eq!(parse_verbose_level(Some("")), 0);
+ assert_eq!(parse_verbose_level(Some("0")), 0);
+ assert_eq!(parse_verbose_level(Some("1")), 1);
+ assert_eq!(parse_verbose_level(Some("2")), 2);
+ assert_eq!(parse_verbose_level(Some(" 2 ")), 2);
+ // Higher counts pass through (treated like `-vvv`, which the layer
+ // builders already collapse to the `>= 2` behavior).
+ assert_eq!(parse_verbose_level(Some("3")), 3);
+ // Garbage and out-of-range values are dropped, not errored.
+ assert_eq!(parse_verbose_level(Some("abc")), 0);
+ assert_eq!(parse_verbose_level(Some("-1")), 0);
+ assert_eq!(parse_verbose_level(Some("999")), 0);
+ }
}
diff --git a/src/main.rs b/src/main.rs
index cd8c9b1ae..34ea44872 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1062,6 +1062,11 @@ fn main() {
yes,
command,
} = cli;
+ // `WORKTRUNK_VERBOSE` provides a baseline verbosity the `-v`/`-vv` flags
+ // raise but never lower (`max`). It also drives shell completion, which
+ // exits in `parse_cli` before reaching here — see
+ // `completion::maybe_handle_env_completion`.
+ let verbose = verbose.max(logging::env_verbose_level());
// Globals were already applied in `parse_cli` before help rendering;
// OnceLock makes this call a no-op, but keeping it avoids touching the
// existing destructure pattern.
diff --git a/tests/integration_tests/completion.rs b/tests/integration_tests/completion.rs
index c4c0315c9..14b72538e 100644
--- a/tests/integration_tests/completion.rs
+++ b/tests/integration_tests/completion.rs
@@ -54,6 +54,63 @@ fn test_complete_switch_shows_branches(repo: TestRepo) {
});
}
+/// `WORKTRUNK_VERBOSE` reaches the completion subprocess, which exits before
+/// `main`'s `logging::init` and is otherwise silent. It is the env-var
+/// equivalent of `-v`/`-vv`, so at level 2 completion writes the same
+/// `[wt-trace]` timing and `$ git …` records to `.git/wt/logs/trace.log` that
+/// `-vv` produces — the only way to profile a slow tab-completion, since the
+/// shell invokes completion with nowhere to pass `-vv`. Unset, completion
+/// writes nothing and keeps the candidate output clean.
+#[rstest]
+fn test_completion_honors_worktrunk_verbose(repo: TestRepo) {
+ repo.commit("initial");
+ repo.run_git(&["branch", "feature/new"]);
+
+ let logs_dir = repo.root_path().join(".git").join("wt/logs");
+ let trace_log = logs_dir.join("trace.log");
+
+ // Control: a normal completion logs nothing and still emits candidates.
+ let _ = std::fs::remove_dir_all(&logs_dir);
+ let output = repo
+ .completion_cmd(&["wt", "switch", ""])
+ .env_remove("WORKTRUNK_VERBOSE")
+ .output()
+ .unwrap();
+ assert!(output.status.success());
+ assert!(
+ String::from_utf8_lossy(&output.stdout).contains("feature/new"),
+ "completion should produce candidates"
+ );
+ assert!(
+ !trace_log.exists(),
+ "completion must not log without WORKTRUNK_VERBOSE"
+ );
+
+ // WORKTRUNK_VERBOSE=2 == -vv: completion writes the trace files, without
+ // disturbing the candidate list.
+ let _ = std::fs::remove_dir_all(&logs_dir);
+ let output = repo
+ .completion_cmd(&["wt", "switch", ""])
+ .env("WORKTRUNK_VERBOSE", "2")
+ .output()
+ .unwrap();
+ assert!(output.status.success());
+ assert!(
+ String::from_utf8_lossy(&output.stdout).contains("feature/new"),
+ "logging must not disturb the candidate list"
+ );
+ let trace = std::fs::read_to_string(&trace_log)
+ .expect("WORKTRUNK_VERBOSE=2 should write trace.log during completion");
+ assert!(
+ trace.contains("[wt-trace]"),
+ "completion trace should capture [wt-trace] timing: {trace}"
+ );
+ assert!(
+ trace.contains("$ git"),
+ "completion trace should capture the git subprocesses it runs: {trace}"
+ );
+}
+
#[rstest]
fn test_complete_switch_shows_all_branches_including_worktrees(mut repo: TestRepo) {
repo.commit("initial");
diff --git a/tests/integration_tests/diagnostic.rs b/tests/integration_tests/diagnostic.rs
index 37fcf1309..0e6983e81 100644
--- a/tests/integration_tests/diagnostic.rs
+++ b/tests/integration_tests/diagnostic.rs
@@ -584,6 +584,66 @@ fn test_rust_log_debug_fallback_without_vv(repo: TestRepo) {
);
}
+/// `WORKTRUNK_VERBOSE` sets the verbosity level from the environment, mirroring
+/// the `-v`/`-vv` flags so logging can be turned on with no CLI flag — the only
+/// way to reach shell completion, which has nowhere to pass `-vv` (see the
+/// completion suite). The env and the flag combine via `max`: the env is a
+/// baseline the flags raise but never lower. Level 2 opens the on-disk trace
+/// files exactly like `-vv`; level 1 does not, proving the count is threaded
+/// rather than collapsed to a boolean "verbose on".
+#[rstest]
+fn test_worktrunk_verbose_env_sets_level(repo: TestRepo) {
+ let logs_dir = repo.root_path().join(".git").join("wt/logs");
+ let trace_log = logs_dir.join("trace.log");
+
+ // Level 2 with no flag opens the trace files, just like `-vv`.
+ let _ = fs::remove_dir_all(&logs_dir);
+ let out = repo
+ .wt_command()
+ .args(["list"])
+ .env("WORKTRUNK_VERBOSE", "2")
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("wt list");
+ assert!(out.status.success());
+ assert!(
+ trace_log.exists(),
+ "WORKTRUNK_VERBOSE=2 should open trace.log like -vv"
+ );
+
+ // Level 1 with no flag does NOT — the trace files are a level-2 artifact,
+ // so the env must carry the count, not just a boolean.
+ let _ = fs::remove_dir_all(&logs_dir);
+ let out = repo
+ .wt_command()
+ .args(["list"])
+ .env("WORKTRUNK_VERBOSE", "1")
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("wt list");
+ assert!(out.status.success());
+ assert!(
+ !trace_log.exists(),
+ "WORKTRUNK_VERBOSE=1 should not open the -vv trace files"
+ );
+
+ // An explicit `-vv` wins over a lower env baseline (`max`, not env-wins):
+ // env 0 + `-vv` still writes the files.
+ let _ = fs::remove_dir_all(&logs_dir);
+ let out = repo
+ .wt_command()
+ .args(["list", "-vv"])
+ .env("WORKTRUNK_VERBOSE", "0")
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("wt list -vv");
+ assert!(out.status.success());
+ assert!(
+ trace_log.exists(),
+ "an explicit -vv must win over WORKTRUNK_VERBOSE=0"
+ );
+}
+
// =============================================================================
// Tests for -vv verbosity level (always write diagnostic)
// =============================================================================
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap b/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
index 9ade3fb8e..5dc26dc23 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
@@ -56,7 +56,7 @@ Usage: wt config approvals [OPTIONS] <COMMAND>
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap b/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
index a95e94d22..84344925a 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
@@ -56,7 +56,7 @@ Usage: wt config approvals add [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap
index 17c7fa393..605224fcb 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals_clear.snap
@@ -56,7 +56,7 @@ Usage: wt config approvals clear [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 38f063b69..e9004b2e0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -55,7 +55,7 @@ Usage: wt config create [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 865233ca0..09b24db32 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -63,7 +63,7 @@ Usage: wt config [OPTIONS] <COMMAND>
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
@@ -575,19 +575,21 @@ Override the LLM command in CI to use a mock:
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
- WORKTRUNK_PROJECT_CONFIG_PATH Override project config file location (defaults to .config/wt.toml)
- XDG_CONFIG_DIRS Colon-separated system config directories (default: /etc/xdg)
- WORKTRUNK_DIRECTIVE_CD_FILE Internal: set by shell wrappers. wt writes a raw path; the wrapper cds to it
- WORKTRUNK_DIRECTIVE_EXEC_FILE Internal: set by shell wrappers. wt writes shell commands; the wrapper sources the file
- 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
+ WORKTRUNK_PROJECT_CONFIG_PATH Override project config file location (defaults to .config/wt.toml)
+ XDG_CONFIG_DIRS Colon-separated system config directories (default: /etc/xdg)
+ WORKTRUNK_DIRECTIVE_CD_FILE Internal: set by shell wrappers. wt writes a raw path; the wrapper cds to it
+ WORKTRUNK_DIRECTIVE_EXEC_FILE Internal: set by shell wrappers. wt writes shell commands; the wrapper sources the file
+ 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.
+ WORKTRUNK_VERBOSE Verbosity level (0/1/2), like -v/-vv but applied everywhere — including shell completion, which no flag can reach
+ RUST_LOG Logging directive (e.g. worktrunk=debug); overrides the verbosity baseline for what reaches stderr
+ NO_COLOR Disable colored output (standard)
+ CLICOLOR_FORCE Force colored output even when not a TTY
Inline config overrides (--config-set)
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap
index e1c5ba421..2e44e26e7 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap
@@ -57,7 +57,7 @@ Usage: wt config plugins [OPTIONS] <COMMAND>
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex.snap
index 464ec252e..0edccb45f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex.snap
@@ -57,7 +57,7 @@ Usage: wt config plugins codex [OPTIONS] <COMMAND>[0
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex_install.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex_install.snap
index adc1f341a..3d4c4737c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex_install.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_codex_install.snap
@@ -54,7 +54,7 @@ Usage: wt config plugins codex install [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
index 66c37def3..529ed6bdb 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
@@ -50,7 +50,7 @@ Usage: wt config shell [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_short.snap b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
index 6048f4895..3ba66e882 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
@@ -53,7 +53,7 @@ Usage: wt config [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
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 8e1e79823..fc23ec18c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_show.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
@@ -62,7 +62,7 @@ Usage: wt config show [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 79c339ace..9c64c2117 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
@@ -61,7 +61,7 @@ Usage: wt config state [OPTIONS] <COMMAND>
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_cache.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_cache.snap
index c73fd5542..0fa67439e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_cache.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_cache.snap
@@ -61,7 +61,7 @@ Usage: wt config state cache [OPTIONS] [COMMAND]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 037e9a853..6a96cdc30 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
@@ -61,7 +61,7 @@ Usage: wt config state ci-status [OPTIONS] [COMMAND]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
index a65a36d89..ef290c49a 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
@@ -53,7 +53,7 @@ Usage: wt config state clear [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 7ce088ff4..55353ad52 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
@@ -58,7 +58,7 @@ Usage: wt config state default-branch [OPTIONS] [COMM
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
index ee5c8a9b1..4478adff2 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
@@ -59,7 +59,7 @@ Usage: wt config state get [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 015aa8c41..f180cf283 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
@@ -61,7 +61,7 @@ Usage: wt config state logs [OPTIONS] [COMMAND]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 7f098b034..b47dcad42 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
@@ -62,7 +62,7 @@ Usage: wt config state marker [OPTIONS] [COMMAND]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
index 09055cec1..7d2810062 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
@@ -58,7 +58,7 @@ Usage: wt config state previous-branch [OPTIONS] [COM
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 7a1b5b7a4..0b45acb54 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -75,7 +75,7 @@ Usage: wt list [OPTIONS]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 365ff9392..ab7d27639 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
@@ -80,7 +80,8 @@ Usage: wt list [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on
stderr; -vv: also debug logs and raw subprocess output written to
- .git/wt/logs/)
+ .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level
+ everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_short.snap b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
index bf7202529..8c2cfbcb7 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
@@ -52,7 +52,7 @@ Usage: wt list [OPTIONS]
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
index a85aa66d5..5efaef565 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -94,7 +94,7 @@ Global Options:
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_root.snap b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
index 8bedf314e..9f7265310 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
@@ -62,7 +62,7 @@ Global Options:
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 5d57b40eb..e66beab69 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -94,7 +94,7 @@ Usage: wt merge [OPTIONS] [TARGET]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
index 798974f7e..c8b1c953c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
@@ -56,7 +56,7 @@ Usage: wt merge [OPTIONS] [TARGET]
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_no_args.snap b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
index ba39db4ce..a7c88340d 100644
--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
@@ -51,7 +51,7 @@ Usage: wt [OPTIONS] [COMMAND]
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
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 833a1ca27..465f3f56c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -83,7 +83,7 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
index 237b636aa..fd8137d97 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -54,7 +54,7 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_long.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
index 8aae6836f..8a5486795 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -62,7 +62,7 @@ Usage: wt [OPTIONS] [COMMAND]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_short.snap b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
index 86fcf7022..c9c9eeb07 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
@@ -52,7 +52,7 @@ Usage: wt [OPTIONS] [COMMAND]
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
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 d7dd7b63e..662a199ae 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
@@ -67,7 +67,7 @@ Usage: wt step [OPTIONS] <COMMAND>
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
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 17c29c227..1bb3a4ccb 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
@@ -60,7 +60,7 @@ Usage: wt step promote [OPTIONS] [BRANCH]
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_short.snap b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
index 2aa929d54..c33d355b2 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
@@ -57,7 +57,7 @@ Usage: wt step [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
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 d7875e463..c889aadc9 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -113,7 +113,7 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
- Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
index d089cc0be..8a9e4b0cc 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -60,7 +60,7 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
index 52ce5150f..18cb594cf 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
@@ -74,7 +74,7 @@ Run wt config alias show for the full definitions.
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap
index 5663be754..56621b315 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap
@@ -68,7 +68,7 @@ Usage: wt step [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
index d625eb37d..f9c6cb618 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
@@ -73,7 +73,7 @@ Run wt config alias show for the full definitions.
-C <path> Working directory for this command
--config <path> User config file path
--config-set <toml> Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
- -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/)
+ -v, --verbose... Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes Skip approval prompts
----- stderr -----