Skip to content

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

feat(cli): promote --yes to a global flag (#2279)

Maximilian Roos1a4eea3c0336
diff --git a/docs/content/config.md b/docs/content/config.md
index 29ec4289d..8d7465e11 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -495,6 +495,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
# Subcommands
@@ -553,6 +556,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt config approvals
@@ -601,6 +607,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt config state
@@ -673,6 +682,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt config state default-branch
@@ -728,6 +740,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt config state logs
@@ -830,6 +845,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt config state ci-status
@@ -888,6 +906,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt config state marker
@@ -958,6 +979,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt config state vars
@@ -1030,6 +1054,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
<!-- END AUTO-GENERATED from `wt config --help-page` -->
diff --git a/docs/content/hook.md b/docs/content/hook.md
index 2738c574f..fc5c1f004 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -499,6 +499,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
<!-- END AUTO-GENERATED from `wt hook --help-page` -->
diff --git a/docs/content/list.md b/docs/content/list.md
index dfc72054d..f27542688 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -283,6 +283,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
<!-- END AUTO-GENERATED from `wt list --help-page` -->
diff --git a/docs/content/merge.md b/docs/content/merge.md
index c09da1a18..bc4c39d74 100644
--- a/docs/content/merge.md
+++ b/docs/content/merge.md
@@ -124,9 +124,6 @@ Usage: <b><span class=c>wt merge</span></b> <span class=c>[OPTIONS]</span> <span
Print help (see a summary with &#39;-h&#39;)
<b><span class=g>Automation:</span></b>
- <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
- Skip approval prompts
-
<b><span class=c>--no-hooks</span></b>
Skip hooks
@@ -151,6 +148,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
<!-- END AUTO-GENERATED from `wt merge --help-page` -->
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 80d2689c2..1dedf9812 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -111,9 +111,6 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
Print help (see a summary with &#39;-h&#39;)
<b><span class=g>Automation:</span></b>
- <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
- Skip approval prompts
-
<b><span class=c>--no-hooks</span></b>
Skip hooks
@@ -138,6 +135,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
<!-- END AUTO-GENERATED from `wt remove --help-page` -->
diff --git a/docs/content/step.md b/docs/content/step.md
index 801ec6a86..5c27a72ad 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -78,6 +78,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
# Subcommands
@@ -126,6 +129,9 @@ Usage: <b><span class=c>wt step commit</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-b</span></b>, <b><span class=c>--branch</span></b><span class=c> &lt;BRANCH&gt;</span>
Branch to operate on (defaults to current worktree)
+ <b><span class=c>--no-hooks</span></b>
+ Skip hooks
+
<b><span class=c>--stage</span></b><span class=c> &lt;STAGE&gt;</span>
What to stage before committing [default: all]
@@ -142,13 +148,6 @@ Usage: <b><span class=c>wt step commit</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
-<b><span class=g>Automation:</span></b>
- <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
- Skip approval prompts
-
- <b><span class=c>--no-hooks</span></b>
- Skip hooks
-
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
Working directory for this command
@@ -159,6 +158,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step squash
@@ -210,6 +212,9 @@ Usage: <b><span class=c>wt step squash</span></b> <span class=c>[OPTIONS]</span>
Defaults to default branch.
<b><span class=g>Options:</span></b>
+ <b><span class=c>--no-hooks</span></b>
+ Skip hooks
+
<b><span class=c>--stage</span></b><span class=c> &lt;STAGE&gt;</span>
What to stage before committing [default: all]
@@ -226,13 +231,6 @@ Usage: <b><span class=c>wt step squash</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
-<b><span class=g>Automation:</span></b>
- <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
- Skip approval prompts
-
- <b><span class=c>--no-hooks</span></b>
- Skip hooks
-
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
Working directory for this command
@@ -243,6 +241,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step diff
@@ -301,6 +302,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step copy-ignored
@@ -433,6 +437,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step eval
@@ -508,6 +515,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step for-each
@@ -556,10 +566,6 @@ Usage: <b><span class=c>wt step for-each</span></b> <span class=c>[OPTIONS]</spa
Command template (see --help for all variables)
<b><span class=g>Options:</span></b>
- <b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
- Print help (see a summary with &#39;-h&#39;)
-
-<b><span class=g>Automation:</span></b>
<b><span class=c>--format</span></b><span class=c> &lt;FORMAT&gt;</span>
Output format (text, json)
@@ -569,6 +575,9 @@ Usage: <b><span class=c>wt step for-each</span></b> <span class=c>[OPTIONS]</spa
[default: text]
+ <b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
+ Print help (see a summary with &#39;-h&#39;)
+
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
Working directory for this command
@@ -579,6 +588,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step promote
@@ -653,6 +665,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step prune
@@ -702,13 +717,6 @@ Usage: <b><span class=c>wt step prune</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>--foreground</span></b>
Run removal in foreground (block until complete)
- <b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
- Print help (see a summary with &#39;-h&#39;)
-
-<b><span class=g>Automation:</span></b>
- <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
- Skip approval prompts
-
<b><span class=c>--format</span></b><span class=c> &lt;FORMAT&gt;</span>
Output format (text, json)
@@ -718,6 +726,9 @@ Usage: <b><span class=c>wt step prune</span></b> <span class=c>[OPTIONS]</span>
[default: text]
+ <b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
+ Print help (see a summary with &#39;-h&#39;)
+
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
Working directory for this command
@@ -728,6 +739,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
## wt step relocate
@@ -818,6 +832,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
<!-- END AUTO-GENERATED from `wt step --help-page` -->
diff --git a/docs/content/switch.md b/docs/content/switch.md
index 583166fb8..f3b4f88c9 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -194,9 +194,6 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
Include remote branches
<b><span class=g>Automation:</span></b>
- <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
- Skip approval prompts
-
<b><span class=c>--no-hooks</span></b>
Skip hooks
@@ -222,6 +219,9 @@ 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/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
{% end %}
<!-- END AUTO-GENERATED from `wt switch --help-page` -->
diff --git a/skills/worktrunk/reference/config.md b/skills/worktrunk/reference/config.md
index 8cd38eda6..b2200b09c 100644
--- a/skills/worktrunk/reference/config.md
+++ b/skills/worktrunk/reference/config.md
@@ -498,6 +498,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
# Subcommands
@@ -558,6 +561,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt config approvals
@@ -612,6 +618,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt config state
@@ -698,6 +707,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt config state default-branch
@@ -755,6 +767,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt config state logs
@@ -867,6 +882,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt config state ci-status
@@ -925,6 +943,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt config state marker
@@ -994,6 +1015,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt config state vars
@@ -1077,4 +1101,7 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
diff --git a/skills/worktrunk/reference/hook.md b/skills/worktrunk/reference/hook.md
index 69cfe7d09..677168989 100644
--- a/skills/worktrunk/reference/hook.md
+++ b/skills/worktrunk/reference/hook.md
@@ -492,4 +492,7 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
diff --git a/skills/worktrunk/reference/list.md b/skills/worktrunk/reference/list.md
index 718a6432c..fda349c21 100644
--- a/skills/worktrunk/reference/list.md
+++ b/skills/worktrunk/reference/list.md
@@ -313,4 +313,7 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
diff --git a/skills/worktrunk/reference/merge.md b/skills/worktrunk/reference/merge.md
index f2bb1b477..a2b4f6d7a 100644
--- a/skills/worktrunk/reference/merge.md
+++ b/skills/worktrunk/reference/merge.md
@@ -114,9 +114,6 @@ Options:
Print help (see a summary with '-h')
Automation:
- -y, --yes
- Skip approval prompts
-
--no-hooks
Skip hooks
@@ -141,4 +138,7 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
diff --git a/skills/worktrunk/reference/remove.md b/skills/worktrunk/reference/remove.md
index 6edae7433..4e8723994 100644
--- a/skills/worktrunk/reference/remove.md
+++ b/skills/worktrunk/reference/remove.md
@@ -110,9 +110,6 @@ Options:
Print help (see a summary with '-h')
Automation:
- -y, --yes
- Skip approval prompts
-
--no-hooks
Skip hooks
@@ -137,4 +134,7 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
diff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.md
index ceb03e548..db4c3fabd 100644
--- a/skills/worktrunk/reference/step.md
+++ b/skills/worktrunk/reference/step.md
@@ -70,6 +70,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
# Subcommands
@@ -126,6 +129,9 @@ Options:
-b, --branch <BRANCH>
Branch to operate on (defaults to current worktree)
+ --no-hooks
+ Skip hooks
+
--stage <STAGE>
What to stage before committing [default: all]
@@ -142,13 +148,6 @@ Options:
-h, --help
Print help (see a summary with '-h')
-Automation:
- -y, --yes
- Skip approval prompts
-
- --no-hooks
- Skip hooks
-
Global Options:
-C <path>
Working directory for this command
@@ -159,6 +158,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step squash
@@ -214,6 +216,9 @@ Arguments:
Defaults to default branch.
Options:
+ --no-hooks
+ Skip hooks
+
--stage <STAGE>
What to stage before committing [default: all]
@@ -230,13 +235,6 @@ Options:
-h, --help
Print help (see a summary with '-h')
-Automation:
- -y, --yes
- Skip approval prompts
-
- --no-hooks
- Skip hooks
-
Global Options:
-C <path>
Working directory for this command
@@ -247,6 +245,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step diff
@@ -315,6 +316,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step copy-ignored
@@ -447,6 +451,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step eval
@@ -528,6 +535,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step for-each
@@ -584,10 +594,6 @@ Arguments:
Command template (see --help for all variables)
Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Automation:
--format <FORMAT>
Output format (text, json)
@@ -597,6 +603,9 @@ Automation:
[default: text]
+ -h, --help
+ Print help (see a summary with '-h')
+
Global Options:
-C <path>
Working directory for this command
@@ -607,6 +616,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step promote
@@ -684,6 +696,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step prune
@@ -740,13 +755,6 @@ Options:
--foreground
Run removal in foreground (block until complete)
- -h, --help
- Print help (see a summary with '-h')
-
-Automation:
- -y, --yes
- Skip approval prompts
-
--format <FORMAT>
Output format (text, json)
@@ -756,6 +764,9 @@ Automation:
[default: text]
+ -h, --help
+ Print help (see a summary with '-h')
+
Global Options:
-C <path>
Working directory for this command
@@ -766,6 +777,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
## wt step relocate
@@ -864,4 +878,7 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
diff --git a/skills/worktrunk/reference/switch.md b/skills/worktrunk/reference/switch.md
index 2bd05f90e..59d395496 100644
--- a/skills/worktrunk/reference/switch.md
+++ b/skills/worktrunk/reference/switch.md
@@ -186,9 +186,6 @@ Picker Options:
Include remote branches
Automation:
- -y, --yes
- Skip approval prompts
-
--no-hooks
Skip hooks
@@ -214,4 +211,7 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ trace.log/output.log under .git/wt/logs/)
+
+ -y, --yes
+ Skip approval prompts
```
diff --git a/src/cli/config.rs b/src/cli/config.rs
index 60133047a..ad6085b43 100644
--- a/src/cli/config.rs
+++ b/src/cli/config.rs
@@ -74,10 +74,6 @@ Use --yes to skip confirmation."#
#[arg(value_enum)]
shell: Option<Shell>,
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
-
/// Show what would be changed
#[arg(long)]
dry_run: bool,
@@ -123,10 +119,6 @@ Detects various forms of the integration pattern regardless of:
#[arg(value_enum)]
shell: Option<Shell>,
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
-
/// Show what would be changed
#[arg(long)]
dry_run: bool,
@@ -178,11 +170,7 @@ $ wt config plugins opencode install --yes
The plugin is written to `~/.config/opencode/plugins/worktrunk.ts`.
Override with the `OPENCODE_CONFIG_DIR` environment variable."#
)]
- Install {
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
- },
+ Install,
/// Remove the activity tracking plugin
#[command(
@@ -194,11 +182,7 @@ Override with the `OPENCODE_CONFIG_DIR` environment variable."#
$ wt config plugins opencode uninstall
```"#
)]
- Uninstall {
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
- },
+ Uninstall,
}
// Ordering: action + inverse adjacent (add, clear).
@@ -295,11 +279,7 @@ $ claude plugin install worktrunk@worktrunk
Requires `claude` CLI. Skips gracefully if already installed."#
)]
- Install {
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
- },
+ Install,
/// Remove the Worktrunk plugin
#[command(
@@ -309,11 +289,7 @@ Requires `claude` CLI. Skips gracefully if already installed."#
$ claude plugin uninstall worktrunk@worktrunk
```"#
)]
- Uninstall {
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
- },
+ Uninstall,
/// Configure the Claude Code statusline
#[command(
@@ -328,11 +304,7 @@ Preserves existing settings. Creates the `.claude/` directory and `settings.json
Skips gracefully if the statusline is already configured."#
)]
- InstallStatusline {
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
- },
+ InstallStatusline,
}
// Ordering: user journey — shell (install integration), create (bootstrap
@@ -423,12 +395,8 @@ $ wt config update --print
```"#
)]
Update {
- /// Skip confirmation prompt
- #[arg(short, long)]
- yes: bool,
-
/// Print the migrated config to stdout instead of writing it
- #[arg(long, conflicts_with = "yes")]
+ #[arg(long)]
print: bool,
},
diff --git a/src/cli/hook.rs b/src/cli/hook.rs
index f7fa5f8ab..549ff4df1 100644
--- a/src/cli/hook.rs
+++ b/src/cli/hook.rs
@@ -405,10 +405,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -429,10 +425,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -458,10 +450,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -482,10 +470,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -508,10 +492,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -532,10 +512,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -558,10 +534,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -582,10 +554,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -608,10 +576,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
@@ -632,10 +596,6 @@ pub enum HookCommand {
#[arg(add = crate::completion::hook_command_name_completer())]
name: Vec<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Show what would run without executing
#[arg(long)]
dry_run: bool,
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 7552d6dc3..00c93cb10 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -257,6 +257,16 @@ pub(crate) struct Cli {
)]
pub verbose: u8,
+ /// Skip approval prompts
+ #[arg(
+ long,
+ short = 'y',
+ global = true,
+ display_order = 103,
+ help_heading = "Global Options"
+ )]
+ pub yes: bool,
+
#[command(subcommand)]
pub command: Option<Commands>,
}
@@ -342,10 +352,6 @@ pub(crate) struct SwitchArgs {
#[arg(long, overrides_with = "no_cd", hide = true)]
pub(crate) cd: bool,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- pub(crate) yes: bool,
-
/// Skip hooks
#[arg(long = "no-hooks", action = clap::ArgAction::SetFalse, default_value_t = true, help_heading = "Automation")]
pub(crate) verify: bool,
@@ -414,10 +420,6 @@ pub(crate) struct RemoveArgs {
#[arg(long)]
pub(crate) foreground: bool,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- pub(crate) yes: bool,
-
/// Skip hooks
#[arg(long = "no-hooks", action = clap::ArgAction::SetFalse, default_value_t = true, help_heading = "Automation")]
pub(crate) verify: bool,
@@ -488,10 +490,6 @@ pub(crate) struct MergeArgs {
#[arg(long, overrides_with = "no_ff", hide = true)]
pub(crate) ff: bool,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- pub(crate) yes: bool,
-
/// Force running hooks
#[arg(long, overrides_with_all = ["no_hooks", "no_verify"], hide = true)]
pub(crate) verify: bool,
diff --git a/src/cli/step.rs b/src/cli/step.rs
index 4253e22e6..3c0fc697f 100644
--- a/src/cli/step.rs
+++ b/src/cli/step.rs
@@ -6,12 +6,8 @@ pub struct CommitArgs {
#[arg(short, long, add = crate::completion::worktree_only_completer())]
pub(crate) branch: Option<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- pub(crate) yes: bool,
-
/// Skip hooks
- #[arg(long = "no-hooks", action = clap::ArgAction::SetFalse, default_value_t = true, help_heading = "Automation")]
+ #[arg(long = "no-hooks", action = clap::ArgAction::SetFalse, default_value_t = true)]
pub(crate) verify: bool,
/// Skip hooks (deprecated alias for --no-hooks)
@@ -37,12 +33,8 @@ pub struct SquashArgs {
#[arg(add = crate::completion::branch_value_completer())]
pub(crate) target: Option<String>,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- pub(crate) yes: bool,
-
/// Skip hooks
- #[arg(long = "no-hooks", action = clap::ArgAction::SetFalse, default_value_t = true, help_heading = "Automation")]
+ #[arg(long = "no-hooks", action = clap::ArgAction::SetFalse, default_value_t = true)]
pub(crate) verify: bool,
/// Skip hooks (deprecated alias for --no-hooks)
@@ -458,7 +450,7 @@ Note: This command is experimental and may change in future versions.
)]
ForEach {
/// Output format (text, json)
- #[arg(long, default_value = "text", help_heading = "Automation")]
+ #[arg(long, default_value = "text")]
format: crate::cli::SwitchFormat,
/// Command template (see --help for all variables)
@@ -556,10 +548,6 @@ $ wt step prune
#[arg(long)]
dry_run: bool,
- /// Skip approval prompts
- #[arg(short, long, help_heading = "Automation")]
- yes: bool,
-
/// Skip worktrees younger than this
#[arg(long, default_value = "1h")]
min_age: String,
@@ -569,7 +557,7 @@ $ wt step prune
foreground: bool,
/// Output format (text, json)
- #[arg(long, default_value = "text", help_heading = "Automation")]
+ #[arg(long, default_value = "text")]
format: crate::cli::SwitchFormat,
},
diff --git a/src/commands/alias.rs b/src/commands/alias.rs
index 6b317c0f5..810e72c5d 100644
--- a/src/commands/alias.rs
+++ b/src/commands/alias.rs
@@ -271,12 +271,15 @@ fn load_merged_aliases(
/// non-alias `rest` (positional args meant for a `wt-<name>` PATH binary)
/// doesn't surface as a parse error.
///
+/// `global_yes` is the top-level `--yes`/`-y` flag, passed through to
+/// `run_alias`.
+///
/// Alias execution needs a git repository; without one this returns `Ok(None)`
/// so the caller falls through to PATH lookup. Config load errors propagate —
/// a broken `wt.toml` should fail loudly here just as it does for `wt list`,
/// rather than silently turning into an "unrecognized subcommand" once we
/// fall through to PATH lookup.
-pub fn try_alias(name: String, rest: Vec<String>) -> anyhow::Result<Option<()>> {
+pub fn try_alias(name: String, rest: Vec<String>, global_yes: bool) -> anyhow::Result<Option<()>> {
let Ok(repo) = Repository::current() else {
return Ok(None);
};
@@ -290,12 +293,15 @@ pub fn try_alias(name: String, rest: Vec<String>) -> anyhow::Result<Option<()>>
alias_args.push(name);
alias_args.extend(rest);
let opts = AliasOptions::parse(alias_args)?;
- run_alias(opts, repo, user_config, project_config, aliases).map(Some)
+ run_alias(opts, repo, user_config, project_config, aliases, global_yes).map(Some)
}
/// Run a configured alias from `wt step <name>`. Errors with a clap-style
/// "unrecognized subcommand" if the alias isn't configured.
-pub fn step_alias(opts: AliasOptions) -> anyhow::Result<()> {
+///
+/// `global_yes` is the top-level `--yes`/`-y` flag, passed through to
+/// `run_alias`.
+pub fn step_alias(opts: AliasOptions, global_yes: bool) -> anyhow::Result<()> {
let repo = Repository::current()?;
let user_config = UserConfig::load()?;
let project_config = ProjectConfig::load(&repo, true)?;
@@ -314,7 +320,7 @@ pub fn step_alias(opts: AliasOptions) -> anyhow::Result<()> {
.collect();
unknown_step_command_exit(&opts.name, &alias_names);
}
- run_alias(opts, repo, user_config, project_config, aliases)
+ run_alias(opts, repo, user_config, project_config, aliases, global_yes)
}
/// Return alias names for use as suggestions when a top-level subcommand is
@@ -339,17 +345,25 @@ pub fn alias_names_for_suggestions() -> Vec<String> {
/// Execute `cmd_config` for `opts.name`. Caller must have already verified
/// `aliases.contains_key(&opts.name)`.
+///
+/// `global_yes` is the top-level `--yes`/`-y` flag; it OR's with `opts.yes`
+/// (the post-alias `--yes` parsed by `AliasOptions`) so either form skips
+/// approval. The post-alias form is kept intact for now — removing it is a
+/// separate cleanup.
fn run_alias(
opts: AliasOptions,
repo: Repository,
user_config: UserConfig,
project_config: Option<ProjectConfig>,
aliases: BTreeMap<String, CommandConfig>,
+ global_yes: bool,
) -> anyhow::Result<()> {
let cmd_config = aliases
.get(&opts.name)
.expect("caller verified alias is configured");
+ let skip_approval = global_yes || opts.yes;
+
// Check if this alias needs project-config approval (skip for --dry-run).
// project_id is required for approval — re-derive with error propagation
// rather than relying on `.ok()`.
@@ -360,7 +374,7 @@ fn run_alias(
.project_identifier()
.context("Cannot determine project identifier for alias approval")?;
let approved =
- approve_alias_commands(&project_commands, &opts.name, &project_id, opts.yes)?;
+ approve_alias_commands(&project_commands, &opts.name, &project_id, skip_approval)?;
if !approved {
return Ok(());
}
diff --git a/src/commands/custom.rs b/src/commands/custom.rs
index 1a9f30035..d58051772 100644
--- a/src/commands/custom.rs
+++ b/src/commands/custom.rs
@@ -39,7 +39,9 @@ use crate::enhance_and_exit_error;
/// `args[0]` is the subcommand name; `args[1..]` are the arguments to pass
/// through. `working_dir`, if set, is the value of the top-level `-C <path>`
/// flag — applied as the child's current directory so global `-C` works the
-/// same for custom subcommands as it does for built-ins.
+/// same for custom subcommands as it does for built-ins. `yes` is the global
+/// `--yes`/`-y` flag, passed to alias dispatch so it can skip approval prompts
+/// for project-config aliases.
///
/// On success (child exit code 0), returns `Ok(())`. On non-zero exit, returns
/// `WorktrunkError::AlreadyDisplayed` with the child's exit code so `main`
@@ -49,6 +51,7 @@ use crate::enhance_and_exit_error;
pub(crate) fn handle_custom_command(
args: Vec<OsString>,
working_dir: Option<PathBuf>,
+ yes: bool,
) -> Result<()> {
let mut iter = args.into_iter();
let name_os = iter
@@ -77,7 +80,7 @@ pub(crate) fn handle_custom_command(
.map(|a| a.to_str().map(|s| s.to_owned()))
.collect();
if let Some(alias_args) = alias_args
- && let Some(()) = try_alias(name.clone(), alias_args)?
+ && let Some(()) = try_alias(name.clone(), alias_args, yes)?
{
return Ok(());
}
@@ -241,7 +244,7 @@ mod tests {
// with a non-UTF-8 argv could in principle reach this path. We
// construct the same `Vec<OsString>` shape directly.
let bad_name = OsString::from_vec(vec![0xFF, 0xFE]);
- let err = handle_custom_command(vec![bad_name], None).unwrap_err();
+ let err = handle_custom_command(vec![bad_name], None, false).unwrap_err();
let msg = err.to_string();
assert!(
msg.contains("not valid UTF-8"),
diff --git a/src/main.rs b/src/main.rs
index cb248c77d..47be93df5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -158,7 +158,7 @@ fn resolve_verify(verify: bool, no_verify_deprecated: bool) -> bool {
}
}
-fn handle_hook_command(action: HookCommand) -> anyhow::Result<()> {
+fn handle_hook_command(action: HookCommand, yes: bool) -> anyhow::Result<()> {
match action {
HookCommand::Show {
hook_type,
@@ -166,65 +166,55 @@ fn handle_hook_command(action: HookCommand) -> anyhow::Result<()> {
} => handle_hook_show(hook_type.as_deref(), expanded),
HookCommand::PreSwitch {
name,
- yes,
dry_run,
vars,
} => run_non_toggle_hook(HookType::PreSwitch, yes, dry_run, &name, &vars),
HookCommand::PostSwitch {
name,
- yes,
dry_run,
foreground,
vars,
} => run_toggleable_hook(HookType::PostSwitch, yes, dry_run, foreground, &name, &vars),
HookCommand::PreStart {
name,
- yes,
dry_run,
vars,
} => run_non_toggle_hook(HookType::PreStart, yes, dry_run, &name, &vars),
HookCommand::PostStart {
name,
- yes,
dry_run,
foreground,
vars,
} => run_toggleable_hook(HookType::PostStart, yes, dry_run, foreground, &name, &vars),
HookCommand::PreCommit {
name,
- yes,
dry_run,
vars,
} => run_non_toggle_hook(HookType::PreCommit, yes, dry_run, &name, &vars),
HookCommand::PostCommit {
name,
- yes,
dry_run,
foreground,
vars,
} => run_toggleable_hook(HookType::PostCommit, yes, dry_run, foreground, &name, &vars),
HookCommand::PreMerge {
name,
- yes,
dry_run,
vars,
} => run_non_toggle_hook(HookType::PreMerge, yes, dry_run, &name, &vars),
HookCommand::PostMerge {
name,
- yes,
dry_run,
foreground,
vars,
} => run_toggleable_hook(HookType::PostMerge, yes, dry_run, foreground, &name, &vars),
HookCommand::PreRemove {
name,
- yes,
dry_run,
vars,
} => run_non_toggle_hook(HookType::PreRemove, yes, dry_run, &name, &vars),
HookCommand::PostRemove {
name,
- yes,
dry_run,
foreground,
vars,
@@ -250,11 +240,11 @@ fn handle_hook_command(action: HookCommand) -> anyhow::Result<()> {
}
}
-fn handle_step_command(action: StepCommand) -> anyhow::Result<()> {
+fn handle_step_command(action: StepCommand, yes: bool) -> anyhow::Result<()> {
match action {
StepCommand::Commit(args) => {
let verify = resolve_verify(args.verify, args.no_verify_deprecated);
- step_commit(args.branch, args.yes, verify, args.stage, args.show_prompt)
+ step_commit(args.branch, yes, verify, args.stage, args.show_prompt)
}
StepCommand::Squash(args) => {
let verify = resolve_verify(args.verify, args.no_verify_deprecated);
@@ -263,7 +253,7 @@ fn handle_step_command(action: StepCommand) -> anyhow::Result<()> {
commands::step_show_squash_prompt(args.target.as_deref())
} else {
// Approval is handled inside handle_squash (like step_commit)
- handle_squash(args.target.as_deref(), args.yes, verify, args.stage).map(|result| {
+ handle_squash(args.target.as_deref(), yes, verify, args.stage).map(|result| {
match result {
SquashResult::Squashed | SquashResult::NoNetChanges => {}
SquashResult::NoCommitsAhead(branch) => {
@@ -328,7 +318,6 @@ fn handle_step_command(action: StepCommand) -> anyhow::Result<()> {
}
StepCommand::Prune {
dry_run,
- yes,
min_age,
foreground,
format,
@@ -340,7 +329,7 @@ fn handle_step_command(action: StepCommand) -> anyhow::Result<()> {
clobber,
} => step_relocate(branches, dry_run, commit, clobber),
StepCommand::External(args) => {
- commands::AliasOptions::parse(args).and_then(commands::step_alias)
+ commands::AliasOptions::parse(args).and_then(|opts| commands::step_alias(opts, yes))
}
}
}
@@ -446,7 +435,7 @@ fn handle_state_command(action: StateCommand) -> anyhow::Result<()> {
}
}
-fn handle_config_shell_command(action: ConfigShellCommand) -> anyhow::Result<()> {
+fn handle_config_shell_command(action: ConfigShellCommand, yes: bool) -> anyhow::Result<()> {
match action {
ConfigShellCommand::Init { shell, cmd } => {
// Generate shell code to stdout
@@ -455,7 +444,6 @@ fn handle_config_shell_command(action: ConfigShellCommand) -> anyhow::Result<()>
}
ConfigShellCommand::Install {
shell,
- yes,
dry_run,
cmd,
} => {
@@ -480,11 +468,7 @@ fn handle_config_shell_command(action: ConfigShellCommand) -> anyhow::Result<()>
crate::output::print_shell_install_result(&scan_result)
})
}
- ConfigShellCommand::Uninstall {
- shell,
- yes,
- dry_run,
- } => {
+ ConfigShellCommand::Uninstall { shell, dry_run } => {
let explicit_shell = shell.is_some();
handle_unconfigure_shell(shell, yes, dry_run, &binary_name())
.map_err(|e| anyhow::anyhow!("{}", e))
@@ -502,33 +486,31 @@ fn handle_config_shell_command(action: ConfigShellCommand) -> anyhow::Result<()>
}
}
-fn handle_config_command(action: ConfigCommand) -> anyhow::Result<()> {
+fn handle_config_command(action: ConfigCommand, yes: bool) -> anyhow::Result<()> {
match action {
- ConfigCommand::Shell { action } => handle_config_shell_command(action),
+ ConfigCommand::Shell { action } => handle_config_shell_command(action, yes),
ConfigCommand::Create { project } => handle_config_create(project),
ConfigCommand::Show { full, format } => handle_config_show(full, format),
- ConfigCommand::Update { yes, print } => handle_config_update(yes, print),
+ ConfigCommand::Update { print } => handle_config_update(yes, print),
ConfigCommand::Approvals { action } => match action {
ApprovalsCommand::Add { all } => add_approvals(all),
ApprovalsCommand::Clear { global } => clear_approvals(global),
},
- ConfigCommand::Plugins { action } => handle_plugins_command(action),
+ ConfigCommand::Plugins { action } => handle_plugins_command(action, yes),
ConfigCommand::State { action } => handle_state_command(action),
}
}
-fn handle_plugins_command(action: ConfigPluginsCommand) -> anyhow::Result<()> {
+fn handle_plugins_command(action: ConfigPluginsCommand, yes: bool) -> anyhow::Result<()> {
match action {
ConfigPluginsCommand::Claude { action } => match action {
- ConfigPluginsClaudeCommand::Install { yes } => handle_claude_install(yes),
- ConfigPluginsClaudeCommand::Uninstall { yes } => handle_claude_uninstall(yes),
- ConfigPluginsClaudeCommand::InstallStatusline { yes } => {
- handle_claude_install_statusline(yes)
- }
+ ConfigPluginsClaudeCommand::Install => handle_claude_install(yes),
+ ConfigPluginsClaudeCommand::Uninstall => handle_claude_uninstall(yes),
+ ConfigPluginsClaudeCommand::InstallStatusline => handle_claude_install_statusline(yes),
},
ConfigPluginsCommand::Opencode { action } => match action {
- ConfigPluginsOpencodeCommand::Install { yes } => handle_opencode_install(yes),
- ConfigPluginsOpencodeCommand::Uninstall { yes } => handle_opencode_uninstall(yes),
+ ConfigPluginsOpencodeCommand::Install => handle_opencode_install(yes),
+ ConfigPluginsOpencodeCommand::Uninstall => handle_opencode_uninstall(yes),
},
}
}
@@ -579,7 +561,7 @@ fn handle_select_command(_branches: bool, _remotes: bool) -> anyhow::Result<()>
Err(WorktrunkError::AlreadyDisplayed { exit_code: 1 }.into())
}
-fn handle_switch_command(args: SwitchArgs) -> anyhow::Result<()> {
+fn handle_switch_command(args: SwitchArgs, yes: bool) -> anyhow::Result<()> {
let verify = resolve_verify(args.verify, args.no_verify_deprecated);
// With no branch argument, `wt switch` opens a TUI picker — config
@@ -619,7 +601,7 @@ fn handle_switch_command(args: SwitchArgs) -> anyhow::Result<()> {
base: args.base.as_deref(),
execute: args.execute.as_deref(),
execute_args: &args.execute_args,
- yes: args.yes,
+ yes,
clobber: args.clobber,
change_dir: change_dir_flag,
verify,
@@ -782,7 +764,7 @@ fn validate_remove_targets(
/// in `.git/wt/trash/` older than 24 hours are removed by a detached
/// `rm -rf`. Runs last so it never delays the user-visible progress or
/// success message. See [`commands::process::sweep_stale_trash`].
-fn handle_remove_command(args: RemoveArgs) -> anyhow::Result<()> {
+fn handle_remove_command(args: RemoveArgs, yes: bool) -> anyhow::Result<()> {
let json_mode = args.format == SwitchFormat::Json;
let verify = resolve_verify(args.verify, args.no_verify_deprecated);
UserConfig::load()
@@ -850,7 +832,7 @@ fn handle_remove_command(args: RemoveArgs) -> anyhow::Result<()> {
}
// "Approve at the Gate": approval happens AFTER validation passes
- let run_hooks = verify && approve_remove(args.yes)?;
+ let run_hooks = verify && approve_remove(yes)?;
handle_remove_output(&result, args.foreground, run_hooks, false, false)?;
if json_mode {
@@ -885,7 +867,7 @@ fn handle_remove_command(args: RemoveArgs) -> anyhow::Result<()> {
// Approve hooks (only if we have valid plans)
// TODO(pre-remove-context): Approval context uses current worktree,
// but hooks execute in each target worktree.
- let run_hooks = verify && approve_remove(args.yes)?;
+ let run_hooks = verify && approve_remove(yes)?;
// Execute all validated plans: others first, branch-only next, current last
let show_branch =
@@ -1132,7 +1114,7 @@ fn init_logging(verbose_level: u8) {
.init();
}
-fn handle_merge_command(args: MergeArgs) -> anyhow::Result<()> {
+fn handle_merge_command(args: MergeArgs, yes: bool) -> anyhow::Result<()> {
if args.no_verify {
eprintln!(
"{}",
@@ -1147,7 +1129,7 @@ fn handle_merge_command(args: MergeArgs) -> anyhow::Result<()> {
remove: flag_pair(args.remove, args.no_remove),
ff: flag_pair(args.ff, args.no_ff),
verify: flag_pair(args.verify, args.no_hooks || args.no_verify),
- yes: args.yes,
+ yes,
stage: args.stage,
format: args.format,
})
@@ -1156,20 +1138,21 @@ fn handle_merge_command(args: MergeArgs) -> anyhow::Result<()> {
fn dispatch_command(
command: Commands,
working_dir: Option<std::path::PathBuf>,
+ yes: bool,
) -> anyhow::Result<()> {
match command {
- Commands::Config { action } => handle_config_command(action),
- Commands::Step { action } => handle_step_command(action),
- Commands::Hook { action } => handle_hook_command(action),
+ Commands::Config { action } => handle_config_command(action, yes),
+ Commands::Step { action } => handle_step_command(action, yes),
+ Commands::Hook { action } => handle_hook_command(action, yes),
Commands::Select { branches, remotes } => handle_select_command(branches, remotes),
Commands::List(args) => handle_list_command(args),
- Commands::Switch(args) => handle_switch_command(args),
- Commands::Remove(args) => handle_remove_command(args),
- Commands::Merge(args) => handle_merge_command(args),
+ Commands::Switch(args) => handle_switch_command(args, yes),
+ Commands::Remove(args) => handle_remove_command(args, yes),
+ Commands::Merge(args) => handle_merge_command(args, yes),
// `working_dir` is the top-level `-C <path>` flag, applied as the
// child's current directory so global `-C` works for custom
// subcommands the same way it does for built-ins.
- Commands::Custom(args) => handle_custom_command(args, working_dir),
+ Commands::Custom(args) => handle_custom_command(args, working_dir, yes),
}
}
@@ -1272,6 +1255,7 @@ fn main() {
directory,
config,
verbose,
+ yes,
command,
} = cli;
// Globals were already applied in `parse_cli` before help rendering;
@@ -1288,7 +1272,7 @@ fn main() {
return;
};
- let result = dispatch_command(command, directory);
+ let result = dispatch_command(command, directory, yes);
match result {
Ok(()) => finish_command(verbose, &command_line, None),
diff --git a/tests/integration_tests/approval_ui.rs b/tests/integration_tests/approval_ui.rs
index 1401f20bf..94b753423 100644
--- a/tests/integration_tests/approval_ui.rs
+++ b/tests/integration_tests/approval_ui.rs
@@ -583,3 +583,158 @@ fn test_step_hook_run_all_commands(repo: TestRepo) {
"All commands should have run in order"
);
}
+
+/// The global `-y` / `--yes` flag skips approval when placed before the
+/// subcommand (e.g. `wt -y switch --create …`), not only in the per-command
+/// position where it used to live. Non-TTY invocations would fail on an
+/// approval prompt, so a clean exit confirms `-y` was honored.
+#[rstest]
+fn test_global_yes_before_subcommand(repo: TestRepo) {
+ repo.write_project_config(r#"post-create = "echo 'test command'""#);
+ repo.commit("Add config");
+
+ // Place `-y` before the subcommand name.
+ let output = repo
+ .wt_command()
+ .args(["-y", "switch", "--create", "feature-global-y"])
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("Failed to run wt -y switch");
+
+ assert!(
+ output.status.success(),
+ "wt -y switch failed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+}
+
+/// The global `--yes` flag skips approval for `wt hook <type>`, matching the
+/// per-command form at the same position.
+#[rstest]
+fn test_global_yes_for_hook(repo: TestRepo) {
+ repo.write_project_config(r#"pre-merge = "echo 'ran' > marker.txt""#);
+ repo.commit("Add pre-merge hook");
+
+ let output = repo
+ .wt_command()
+ .args(["--yes", "hook", "pre-merge"])
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("Failed to run wt --yes hook pre-merge");
+
+ assert!(
+ output.status.success(),
+ "wt --yes hook pre-merge failed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+
+ let marker = repo.root_path().join("marker.txt");
+ let content = std::fs::read_to_string(&marker).expect("marker.txt should exist");
+ assert_eq!(content.trim(), "ran");
+}
+
+/// The global `-y` flag skips approval for project-config aliases, matching
+/// the post-alias `--yes` form.
+#[rstest]
+fn test_global_yes_for_alias(repo: TestRepo) {
+ repo.write_project_config(
+ r#"[aliases]
+deploy = "echo 'ran' > marker.txt"
+"#,
+ );
+ repo.commit("Add alias");
+
+ let output = repo
+ .wt_command()
+ .args(["-y", "deploy"])
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("Failed to run wt -y deploy");
+
+ assert!(
+ output.status.success(),
+ "wt -y deploy failed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+
+ let marker = repo.root_path().join("marker.txt");
+ let content = std::fs::read_to_string(&marker).expect("marker.txt should exist");
+ assert_eq!(content.trim(), "ran");
+}
+
+/// The post-alias `--yes` form (`wt deploy --yes`) still works via
+/// `AliasOptions::parse`, intentionally preserved for backwards compatibility
+/// until the hand-rolled parser is removed in a later cleanup.
+#[rstest]
+fn test_post_alias_yes_still_works(repo: TestRepo) {
+ repo.write_project_config(
+ r#"[aliases]
+deploy = "echo 'ran' > marker.txt"
+"#,
+ );
+ repo.commit("Add alias");
+
+ let output = repo
+ .wt_command()
+ .args(["deploy", "--yes"])
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("Failed to run wt deploy --yes");
+
+ assert!(
+ output.status.success(),
+ "wt deploy --yes failed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+
+ let marker = repo.root_path().join("marker.txt");
+ let content = std::fs::read_to_string(&marker).expect("marker.txt should exist");
+ assert_eq!(content.trim(), "ran");
+}
+
+/// The global `-y` flag skips approval when dispatched through
+/// `wt step <alias>`, covering the `step_alias` threading path.
+#[rstest]
+fn test_global_yes_for_step_alias(repo: TestRepo) {
+ repo.write_project_config(
+ r#"[aliases]
+deploy = "echo 'ran' > marker.txt"
+"#,
+ );
+ repo.commit("Add alias");
+
+ let output = repo
+ .wt_command()
+ .args(["-y", "step", "deploy"])
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("Failed to run wt -y step deploy");
+
+ assert!(
+ output.status.success(),
+ "wt -y step deploy failed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+
+ let marker = repo.root_path().join("marker.txt");
+ let content = std::fs::read_to_string(&marker).expect("marker.txt should exist");
+ assert_eq!(content.trim(), "ran");
+}
+
+/// Commands without approval prompts accept `-y` without erroring — e.g.
+/// `wt -y list` is a valid no-op.
+#[rstest]
+fn test_global_yes_on_command_without_approval(repo: TestRepo) {
+ let output = repo
+ .wt_command()
+ .args(["-y", "list"])
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("Failed to run wt -y list");
+
+ assert!(
+ output.status.success(),
+ "wt -y list failed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+}
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 0cd9ae7b5..79ae57076 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals.snap
@@ -53,6 +53,9 @@ Usage: wt config approvals [OPTIONS] <COMMAND>
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Project hooks and project aliases prompt for approval on first run to prevent untrusted projects from running arbitrary commands. Approvals from both flows are stored together.
Examples
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 b3a1d59db..2206e38ac 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
@@ -53,6 +53,9 @@ Usage: wt config approvals add [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Prompts for approval of all project commands and saves them to approvals.toml.
By default, shows only unapproved commands. Use --all to review all commands
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 405f577dd..dd97db76f 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
@@ -53,6 +53,9 @@ Usage: wt config approvals clear [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Removes saved approvals, requiring re-approval on next command run.
By default, clears approvals for the current project. Use --global to clear
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 85830b5a9..c524420b3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -52,6 +52,9 @@ Usage: wt config create [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
User config
Creates ~/.config/worktrunk/config.toml with the following content:
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 8aac1b594..624a13359 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -59,6 +59,9 @@ Usage: wt config [OPTIONS] <COMMAND>
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Examples
Install shell integration (required for directory switching):
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 5912a15e6..fafe00785 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
@@ -48,5 +48,6 @@ Usage: wt config shell [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 17ebd0fe6..761d6f543 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
@@ -50,5 +50,6 @@ Usage: wt config [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 77b04636f..ba866c888 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_show.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
@@ -62,6 +62,9 @@ Usage: wt config show [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Shows location and contents of user config (~/.config/worktrunk/config.toml)
and project config (.config/wt.toml). Also shows system config if present.
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 8925a1a9e..2fd1cadb9 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
@@ -60,6 +60,9 @@ Usage: wt config state [OPTIONS] <COMMAND>
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
State is stored in .git/ (config entries and log files), separate from configuration files.
Keys
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 d4f9e9ff5..0724e2791 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
@@ -58,6 +58,9 @@ Usage: wt config state ci-status [OPTIONS] [COMMAND]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Caches GitHub/GitLab CI status for display in wt list.
Requires gh (GitHub) or glab (GitLab) CLI, authenticated. Platform auto-detects from remote URL; override with forge.platform = "github" in .config/wt.toml for SSH host aliases or self-hosted instances. For GitHub Enterprise or self-hosted GitLab, also set forge.hostname.
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 96ade39d7..814525830 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
@@ -50,6 +50,9 @@ Usage: wt config state clear [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Clears all stored state:
- Default branch cache
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 7ccd2d3c0..6aa0ab2f9 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
@@ -55,6 +55,9 @@ Usage: wt config state default-branch [OPTIONS] [COMM
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Useful in scripts to avoid hardcoding main or master:
  git rebase $(wt config state default-branch)
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 d037b62b9..8eef642a5 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
@@ -55,6 +55,9 @@ Usage: wt config state get [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Shows all stored state including:
- Default branch: Cached result of querying remote for default branch
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 061ff0b92..29a5fcb69 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
@@ -58,6 +58,9 @@ Usage: wt config state logs [OPTIONS] [COMMAND]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
View and manage log files — hook output, command audit trail, and debug diagnostics.
What's logged
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 9ba6b96c0..dcfdfd892 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
@@ -59,6 +59,9 @@ Usage: wt config state marker [OPTIONS] [COMMAND]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Custom status text or emoji shown in the wt list Status column.
Display
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 4b1a1f1a3..ef20df7f7 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
@@ -55,6 +55,9 @@ Usage: wt config state previous-branch [OPTIONS] [COM
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Enables wt switch - to return to the previous worktree, similar to cd - or git checkout -.
How it works
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 92c32a85e..7f266986f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -71,6 +71,9 @@ Usage: wt list [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Shows uncommitted changes, divergence from the default branch and remote, and optional CI status and LLM summaries.
The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as background git operations complete.
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 1d144ea7c..10c9c0ed9 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
@@ -74,6 +74,9 @@ Usage: wt list [OPTIONS]
Verbose output (-v: info logs + hook/template output; -vv: debug logs
+ diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Shows uncommitted changes, divergence from the default branch and remote, and
optional CI status and LLM summaries.
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 4aeeed95c..c930a7b4b 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
@@ -50,5 +50,6 @@ Usage: wt list [OPTIONS]
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 a077744c3..acddd5aab 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -70,9 +70,6 @@ Options:
Print help (see a summary with '-h')
Automation:
- -y, --yes
- Skip approval prompts
-
--no-hooks
Skip hooks
@@ -97,6 +94,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Unlike `git merge`, this merges the current branch into the target branch — not the target into current. Similar to clicking "Merge pull request" on GitHub, but locally. The target defaults to the default branch.
<!-- demo: wt-merge.gif 1600x900 -->
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 d36becb48..ee628b1aa 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
@@ -59,6 +59,9 @@ Global Options:
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Getting started
wt switch --create feature # Create worktree and branch
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 ef60c37d1..683cc6a4b 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -70,9 +70,6 @@ Usage: wt merge [OPTIONS] [TARGET]
Print help (see a summary with '-h')
Automation:
- -y, --yes
- Skip approval prompts
-
--no-hooks
Skip hooks
@@ -97,6 +94,9 @@ Usage: wt merge [OPTIONS] [TARGET]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Unlike git merge, this merges the current branch into the target branch — not the target into current. Similar to clicking "Merge pull request" on GitHub, but locally. The target defaults to the default branch.
Examples
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 e6f2d349f..4768b83f9 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
@@ -47,7 +47,6 @@ Usage: wt merge [OPTIONS] [TARGET]
-h, --help Print help (see more with '--help')
Automation:
- -y, --yes Skip approval prompts
--no-hooks Skip hooks
--format <FORMAT> Output format [default: text] [possible values: text, json]
@@ -55,5 +54,6 @@ Usage: wt merge [OPTIONS] [TARGET]
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 34847d6c6..35d9a9bdb 100644
--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
@@ -49,5 +49,6 @@ Usage: wt [OPTIONS] [COMMAND]
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 ee8bbd7cb..006d79ab3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -59,9 +59,6 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
Print help (see a summary with '-h')
Automation:
- -y, --yes
- Skip approval prompts
-
--no-hooks
Skip hooks
@@ -86,6 +83,9 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Examples
Remove current worktree:
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 8ef83db44..8115f4bd1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -45,7 +45,6 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
-h, --help Print help (see more with '--help')
Automation:
- -y, --yes Skip approval prompts
--no-hooks Skip hooks
--format <FORMAT> Output format [default: text] [possible values: text, json]
@@ -53,5 +52,6 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 97c468992..c864a69c1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -59,6 +59,9 @@ Usage: wt [OPTIONS] [COMMAND]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Getting started
wt switch --create feature # Create worktree and branch
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 f21d4586a..bbfff4af4 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
@@ -50,5 +50,6 @@ Usage: wt [OPTIONS] [COMMAND]
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 15454bee1..dc58a7db9 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
@@ -63,6 +63,9 @@ Usage: wt step [OPTIONS] <COMMAND>
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Examples
Commit with LLM-generated message:
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 bbd1dcf5f..6ea1525af 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
@@ -57,6 +57,9 @@ Usage: wt step promote [OPTIONS] [BRANCH]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Experimental. Use promote for temporary testing when the main worktree has special significance (Docker Compose, IDE configs, heavy build artifacts anchored to project root), and hooks & tools aren't yet set up to run on arbitrary worktrees. The idiomatic Worktrunk workflow does not use promote; instead each worktree has a full environment. promote is the only Worktrunk command which changes a branch in an existing worktree.
Example
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 8b3b433ee..40240ddc6 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
@@ -54,5 +54,6 @@ Usage: wt step [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 d3bc71c6c..6e8c037e7 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -91,9 +91,6 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
Include remote branches
Automation:
- -y, --yes
- Skip approval prompts
-
--no-hooks
Skip hooks
@@ -118,6 +115,9 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes
+ Skip approval prompts
+
Worktrees are addressed by branch name; paths are computed from a configurable template. Unlike git switch, this navigates between worktrees rather than changing branches in place.
Examples
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 0b4cf9154..9df4d17ca 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -51,7 +51,6 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
--remotes Include remote branches
Automation:
- -y, --yes Skip approval prompts
--no-hooks Skip hooks
--format <FORMAT> Output format [default: text] [possible values: text, json]
@@ -59,5 +58,6 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 5b3511a69..07d00f2a1 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
@@ -69,5 +69,6 @@ Usage: wt step [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 6ecfe12fe..827a33dc3 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
@@ -65,5 +65,6 @@ Usage: wt step [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -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 bdb14cb34..2e5c9c407 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
@@ -70,5 +70,6 @@ Usage: wt step [OPTIONS] <COMMAND>
-C <path> Working directory for this command
--config <path> User config file path
-v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
+ -y, --yes Skip approval prompts
----- stderr -----