worktrunk 0.37.1

A CLI for Git worktree management, designed for parallel AI agent workflows
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
use std::ffi::{OsStr, OsString};

use clap::Subcommand;

use super::config::ApprovalsCommand;

/// Hook subcommands that accept `--var KEY=VALUE` (and the `--KEY=VALUE` shorthand).
///
/// Excludes `show`, `approvals`, and `run-pipeline`, which don't expand
/// template variables. `post-create` is the deprecated alias for `pre-start`.
const HOOK_SUBCOMMANDS_WITH_VARS: &[&str] = &[
    "pre-switch",
    "post-switch",
    "pre-start",
    "post-start",
    "post-create",
    "pre-commit",
    "post-commit",
    "pre-merge",
    "post-merge",
    "pre-remove",
    "post-remove",
];

/// Long flags on hook subcommands that must never be rewritten as template
/// variables. Includes hook-specific flags and global flags (`-C` is a short
/// flag so it's excluded; the `--` prefix check handles that automatically).
const KNOWN_HOOK_LONG_FLAGS: &[&str] = &[
    "--yes",
    "--dry-run",
    "--foreground",
    "--var",
    "--help",
    "--config",
    "--verbose",
];

/// Rewrite `wt hook <type> --KEY=VALUE` into `wt hook <type> --var KEY=VALUE`
/// for unknown `--key=value` flags, matching the ergonomics of the alias
/// variable shorthand (see `AliasOptions::parse`).
///
/// Only args after a `hook <type>` prefix are touched, and only when `<type>`
/// is a hook that accepts `--var`.
///
/// Use the long `--var KEY=VALUE` form when a variable name collides with a
/// built-in flag like `--config` or `--yes`.
pub(crate) fn rewrite_var_shorthand(args: Vec<OsString>) -> Vec<OsString> {
    // Locate `hook` in argv, skipping the program name and guarding against
    // `hook` appearing as the value of `-C` or `--config`.
    let Some(hook_idx) = args.iter().enumerate().find_map(|(i, arg)| {
        if i == 0 || arg.as_os_str() != OsStr::new("hook") {
            return None;
        }
        let prev = args[i - 1].as_os_str();
        if prev == OsStr::new("-C") || prev == OsStr::new("--config") {
            return None;
        }
        Some(i)
    }) else {
        return args;
    };

    let Some(sub_str) = args.get(hook_idx + 1).and_then(|s| s.to_str()) else {
        return args;
    };
    if !HOOK_SUBCOMMANDS_WITH_VARS.contains(&sub_str) {
        return args;
    }

    let rewrite_start = hook_idx + 2;
    let mut out: Vec<OsString> = Vec::with_capacity(args.len());
    out.extend(args[..rewrite_start].iter().cloned());
    let mut past_double_dash = false;
    for token in &args[rewrite_start..] {
        if token == "--" {
            past_double_dash = true;
            out.push(token.clone());
            continue;
        }
        if !past_double_dash
            && let Some(s) = token.to_str()
            && let Some(rest) = s.strip_prefix("--")
            && let Some((key, value)) = rest.split_once('=')
            && !key.is_empty()
        {
            let flag_name = format!("--{key}");
            if !KNOWN_HOOK_LONG_FLAGS.contains(&flag_name.as_str()) {
                out.push(OsString::from("--var"));
                out.push(OsString::from(format!("{key}={value}")));
                continue;
            }
        }
        out.push(token.clone());
    }
    out
}

#[cfg(test)]
mod tests {
    use super::*;

    fn rewrite(args: &[&str]) -> Vec<String> {
        rewrite_var_shorthand(args.iter().map(OsString::from).collect())
            .into_iter()
            .map(|s| s.into_string().unwrap())
            .collect()
    }

    #[test]
    fn test_rewrite_var_shorthand() {
        // Shorthand gets rewritten
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "--branch=feature/test"]),
            vec!["wt", "hook", "pre-start", "--var", "branch=feature/test"]
        );

        // Multiple shorthand args
        assert_eq!(
            rewrite(&[
                "wt",
                "hook",
                "post-merge",
                "--branch=main",
                "--target=develop"
            ]),
            vec![
                "wt",
                "hook",
                "post-merge",
                "--var",
                "branch=main",
                "--var",
                "target=develop"
            ]
        );

        // Shorthand mixed with known flags
        assert_eq!(
            rewrite(&[
                "wt",
                "hook",
                "pre-merge",
                "--yes",
                "--branch=feature",
                "--dry-run"
            ]),
            vec![
                "wt",
                "hook",
                "pre-merge",
                "--yes",
                "--var",
                "branch=feature",
                "--dry-run"
            ]
        );

        // Shorthand mixed with name filter positional
        assert_eq!(
            rewrite(&["wt", "hook", "pre-merge", "test", "--branch=feature"]),
            vec!["wt", "hook", "pre-merge", "test", "--var", "branch=feature"]
        );

        // Deprecated post-create alias still works
        assert_eq!(
            rewrite(&["wt", "hook", "post-create", "--branch=x"]),
            vec!["wt", "hook", "post-create", "--var", "branch=x"]
        );

        // Value containing equals sign
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "--url=http://host?a=1"]),
            vec!["wt", "hook", "pre-start", "--var", "url=http://host?a=1"]
        );

        // Empty value
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "--branch="]),
            vec!["wt", "hook", "pre-start", "--var", "branch="]
        );
    }

    #[test]
    fn test_rewrite_preserves_known_flags() {
        // --var=KEY=VAL is untouched (still handled by clap's parser)
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "--var=branch=feature"]),
            vec!["wt", "hook", "pre-start", "--var=branch=feature"]
        );

        // --config=path is a global flag, not a variable shorthand
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "--config=/tmp/config.toml"]),
            vec!["wt", "hook", "pre-start", "--config=/tmp/config.toml"]
        );

        // --dry-run, --yes, --foreground pass through
        assert_eq!(
            rewrite(&[
                "wt",
                "hook",
                "post-merge",
                "--yes",
                "--dry-run",
                "--foreground"
            ]),
            vec![
                "wt",
                "hook",
                "post-merge",
                "--yes",
                "--dry-run",
                "--foreground"
            ]
        );
    }

    #[test]
    fn test_rewrite_leaves_non_hook_subcommands_alone() {
        // `wt hook show` doesn't accept --var, so pass through unchanged
        assert_eq!(
            rewrite(&["wt", "hook", "show", "--expanded"]),
            vec!["wt", "hook", "show", "--expanded"]
        );

        // `wt hook approvals add --all` passes through unchanged
        assert_eq!(
            rewrite(&["wt", "hook", "approvals", "add", "--all"]),
            vec!["wt", "hook", "approvals", "add", "--all"]
        );

        // `wt switch --foo=bar` is not a hook command, pass through
        assert_eq!(
            rewrite(&["wt", "switch", "--foo=bar"]),
            vec!["wt", "switch", "--foo=bar"]
        );

        // `wt` alone
        assert_eq!(rewrite(&["wt"]), vec!["wt"]);
    }

    #[test]
    fn test_rewrite_skips_hook_in_flag_value_position() {
        // `wt -C hook pre-start` — here `hook` is a path, not the subcommand
        assert_eq!(
            rewrite(&["wt", "-C", "hook", "pre-start", "--branch=x"]),
            vec!["wt", "-C", "hook", "pre-start", "--branch=x"]
        );

        // `wt --config hook pre-start` — same guard
        assert_eq!(
            rewrite(&["wt", "--config", "hook", "pre-start", "--branch=x"]),
            vec!["wt", "--config", "hook", "pre-start", "--branch=x"]
        );
    }

    #[test]
    fn test_rewrite_handles_global_flags_before_hook() {
        // Global flags before `hook` shouldn't interfere
        assert_eq!(
            rewrite(&["wt", "-v", "hook", "pre-start", "--branch=x"]),
            vec!["wt", "-v", "hook", "pre-start", "--var", "branch=x"]
        );
    }

    #[test]
    fn test_rewrite_ignores_bare_hyphen_args() {
        // Bare `--`, single dash, and short flags pass through
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "-y", "--branch=x"]),
            vec!["wt", "hook", "pre-start", "-y", "--var", "branch=x"]
        );

        // `--` with no key portion
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "--=val"]),
            vec!["wt", "hook", "pre-start", "--=val"]
        );

        // `--` stops rewriting — args after it are positional
        assert_eq!(
            rewrite(&["wt", "hook", "pre-start", "--", "--branch=x"]),
            vec!["wt", "hook", "pre-start", "--", "--branch=x"]
        );
    }

    /// Verify HOOK_SUBCOMMANDS_WITH_VARS stays in sync with HookCommand variants
    /// that accept `--var`. If a hook subcommand is added/removed without updating
    /// the list, this test catches the drift.
    ///
    /// `post-create` is a deprecated alias for `pre-start` — it appears in the
    /// list (users can still type `wt hook post-create`) but not as a separate
    /// clap subcommand, so it's excluded from the reverse check.
    #[test]
    fn test_hook_subcommands_with_vars_matches_clap() {
        use crate::cli::Cli;
        use clap::CommandFactory;

        let app = Cli::command();
        let hook_cmd = app
            .get_subcommands()
            .find(|c| c.get_name() == "hook")
            .expect("hook subcommand exists");

        let subs_with_var: Vec<&str> = hook_cmd
            .get_subcommands()
            .filter(|c| c.get_arguments().any(|a| a.get_id() == "vars"))
            .map(|c| c.get_name())
            .collect();

        for name in &subs_with_var {
            assert!(
                HOOK_SUBCOMMANDS_WITH_VARS.contains(name),
                "Hook subcommand '{name}' accepts --var but is missing from \
                 HOOK_SUBCOMMANDS_WITH_VARS. Add it so --KEY=VALUE shorthand works."
            );
        }

        // Deprecated aliases live in the list but not as separate clap subcommands
        let deprecated_aliases: &[&str] = &["post-create"];
        for name in HOOK_SUBCOMMANDS_WITH_VARS {
            if deprecated_aliases.contains(name) {
                continue;
            }
            assert!(
                subs_with_var.contains(name),
                "HOOK_SUBCOMMANDS_WITH_VARS contains '{name}' but that subcommand \
                 doesn't accept --var. Remove it from the list."
            );
        }
    }

    /// Verify KNOWN_HOOK_LONG_FLAGS stays in sync with actual clap flags on
    /// hook subcommands. An unlisted flag would be silently rewritten to
    /// `--var`, which clap then rejects — but the error message would be
    /// confusing rather than helpful.
    #[test]
    fn test_known_hook_long_flags_matches_clap() {
        use crate::cli::Cli;
        use clap::CommandFactory;

        let app = Cli::command();
        let hook_cmd = app
            .get_subcommands()
            .find(|c| c.get_name() == "hook")
            .expect("hook subcommand exists");

        // Collect all long flags from hook subcommands that accept --var
        let mut clap_flags: std::collections::HashSet<String> = std::collections::HashSet::new();
        for sub in hook_cmd.get_subcommands() {
            if !sub.get_arguments().any(|a| a.get_id() == "vars") {
                continue;
            }
            for arg in sub.get_arguments() {
                if let Some(long) = arg.get_long() {
                    clap_flags.insert(format!("--{long}"));
                }
            }
        }
        // Also include global flags that appear after `hook <type>`
        for arg in app.get_arguments() {
            if let Some(long) = arg.get_long() {
                clap_flags.insert(format!("--{long}"));
            }
        }

        for flag in &clap_flags {
            assert!(
                KNOWN_HOOK_LONG_FLAGS.contains(&flag.as_str()),
                "Hook subcommand flag '{flag}' is missing from KNOWN_HOOK_LONG_FLAGS. \
                 Add it so --KEY=VALUE shorthand doesn't rewrite it."
            );
        }
    }
}

// Ordering: worktree lifecycle phases (switch → start → commit → merge →
// remove), with each phase's `pre-` immediately before its `post-`. `show`
// first (read-only introspection), `approvals` last (administration). Hidden
// commands last.
/// Run configured hooks
#[derive(Subcommand)]
pub enum HookCommand {
    /// Show configured hooks
    ///
    /// Lists user and project hooks. Project hooks show approval status (❓ = needs approval).
    Show {
        /// Hook type to show (default: all)
        #[arg(value_parser = ["pre-switch", "post-switch", "pre-start", "post-start", "pre-commit", "post-commit", "pre-merge", "post-merge", "pre-remove", "post-remove"])]
        hook_type: Option<String>,

        /// Show expanded commands with current variables
        #[arg(long)]
        expanded: bool,
    },

    /// Run pre-switch hooks
    ///
    /// Blocking — waits for completion before continuing.
    PreSwitch {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run post-switch hooks
    ///
    /// Background by default. Use `--foreground` to run in foreground for debugging.
    PostSwitch {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Run in foreground (block until complete)
        #[arg(long)]
        foreground: bool,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run pre-start hooks
    ///
    /// Blocking — waits for completion before continuing.
    #[command(alias = "post-create")]
    PreStart {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run post-start hooks
    ///
    /// Background by default. Use `--foreground` to run in foreground for debugging.
    PostStart {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Run in foreground (block until complete)
        #[arg(long)]
        foreground: bool,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run pre-commit hooks
    PreCommit {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run post-commit hooks
    ///
    /// Background by default. Use `--foreground` to run in foreground for debugging.
    PostCommit {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Run in foreground (block until complete)
        #[arg(long)]
        foreground: bool,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run pre-merge hooks
    PreMerge {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run post-merge hooks
    ///
    /// Background by default. Use `--foreground` to run in foreground for debugging.
    PostMerge {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Run in foreground (block until complete)
        #[arg(long)]
        foreground: bool,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run pre-remove hooks
    PreRemove {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Run post-remove hooks
    ///
    /// Background by default. Use `--foreground` to run in foreground for debugging.
    PostRemove {
        /// Filter by command name(s)
        ///
        /// Supports `user:name` or `project:name` to filter by source.
        /// `user:` alone runs all user hooks; `project:` alone runs all project hooks.
        #[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,

        /// Run in foreground (block until complete)
        #[arg(long)]
        foreground: bool,

        /// Set template variable (KEY=VALUE)
        #[arg(long = "var", value_name = "KEY=VALUE", value_parser = super::parse_key_val, action = clap::ArgAction::Append)]
        vars: Vec<(String, String)>,
    },

    /// Internal: run a serialized pipeline from stdin
    #[command(hide = true, name = "run-pipeline")]
    RunPipeline,

    /// Manage command approvals
    #[command(
        after_long_help = r#"Project hooks require approval on first run to prevent untrusted projects from running arbitrary commands.

## Examples

Pre-approve all commands for current project:
```console
$ wt hook approvals add
```

Clear approvals for current project:
```console
$ wt hook approvals clear
```

Clear global approvals:
```console
$ wt hook approvals clear --global
```

## How approvals work

Approved commands are saved to `~/.config/worktrunk/approvals.toml`. Re-approval is required when the command template changes or the project moves. Use `--yes` to bypass prompts in CI."#
    )]
    Approvals {
        #[command(subcommand)]
        action: ApprovalsCommand,
    },
}