Skip to content

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

feat: Introduce `wt step` commands for core operations

Maximilian Roos1a68864903aa
diff --git a/src/cli.rs b/src/cli.rs
index c8c2f000c..bd4595082 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1,7 +1,6 @@
use clap::builder::styling::{AnsiColor, Color, Styles};
use clap::{Command, CommandFactory, Parser, Subcommand};
use std::sync::OnceLock;
-use worktrunk::HookType;
use crate::commands::Shell;
@@ -282,18 +281,9 @@ pub enum StatusAction {
},
}
+/// Primitive operations (building blocks for workflows)
#[derive(Subcommand)]
-pub enum StandaloneCommand {
- /// Run project hook
- RunHook {
- /// Hook type to run
- hook_type: HookType,
-
- /// Skip approval prompts
- #[arg(short, long)]
- force: bool,
- },
-
+pub enum StepCommand {
/// Commit changes with LLM message
Commit {
/// Skip approval prompts
@@ -355,6 +345,45 @@ pub enum StandaloneCommand {
target: Option<String>,
},
+ /// Run post-create hook
+ PostCreate {
+ /// Skip approval prompts
+ #[arg(short, long)]
+ force: bool,
+ },
+
+ /// Run post-start hook
+ PostStart {
+ /// Skip approval prompts
+ #[arg(short, long)]
+ force: bool,
+ },
+
+ /// Run pre-commit hook
+ PreCommit {
+ /// Skip approval prompts
+ #[arg(short, long)]
+ force: bool,
+ },
+
+ /// Run pre-merge hook
+ PreMerge {
+ /// Skip approval prompts
+ #[arg(short, long)]
+ force: bool,
+ },
+
+ /// Run post-merge hook
+ PostMerge {
+ /// Skip approval prompts
+ #[arg(short, long)]
+ force: bool,
+ },
+}
+
+/// Experimental commands
+#[derive(Subcommand)]
+pub enum BetaCommand {
/// Interactive worktree selector
///
/// Preview modes (toggle with 1/2/3):
@@ -414,11 +443,18 @@ Docs: https://llm.datasette.io/ | https://github.com/sigoden/aichat
action: ConfigCommand,
},
- /// Development and testing utilities
+ /// Primitive operations (building blocks for workflows)
+ #[command(name = "step")]
+ Step {
+ #[command(subcommand)]
+ action: StepCommand,
+ },
+
+ /// Experimental commands
#[command(name = "beta", hide = true)]
- Standalone {
+ Beta {
#[command(subcommand)]
- action: StandaloneCommand,
+ action: BetaCommand,
},
/// List worktrees and optionally branches
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index c57d4c90e..384fb4072 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -248,7 +248,7 @@ fn handle_merge_summary_output(main_path: Option<&std::path::Path>) -> anyhow::R
///
/// # Security Note
/// `auto_trust`: When true, skip approval prompts (commands already approved in `wt merge`'s batch).
-/// When false, require approval (standalone `wt beta run-hook` execution).
+/// When false, require approval (standalone `wt step hook` execution).
pub fn run_pre_merge_commands(
project_config: &ProjectConfig,
ctx: &CommandContext,
@@ -276,7 +276,7 @@ pub fn run_pre_merge_commands(
///
/// # Security Note
/// `auto_trust`: When true, skip approval prompts (commands already approved in `wt merge`'s batch).
-/// When false, require approval (standalone `wt beta run-hook` execution).
+/// When false, require approval (standalone `wt step hook` execution).
pub fn execute_post_merge_commands(
ctx: &CommandContext,
target_branch: &str,
diff --git a/src/commands/standalone.rs b/src/commands/standalone.rs
index 0758305df..d67525854 100644
--- a/src/commands/standalone.rs
+++ b/src/commands/standalone.rs
@@ -10,7 +10,7 @@ use super::merge::{execute_post_merge_commands, run_pre_merge_commands};
use super::project_config::collect_commands_for_hooks;
use super::repository_ext::RepositoryCliExt;
-/// Handle `wt beta run-hook` command
+/// Handle `wt step hook` command
pub fn handle_standalone_run_hook(hook_type: HookType, force: bool) -> anyhow::Result<()> {
// Derive context from current environment
let env = CommandEnv::current()?;
@@ -59,7 +59,7 @@ fn check_hook_configured<T>(hook: &Option<T>, hook_type: HookType) -> anyhow::Re
Ok(())
}
-/// Handle `wt beta commit` command
+/// Handle `wt step commit` command
pub fn handle_standalone_commit(
force: bool,
no_verify: bool,
@@ -78,7 +78,7 @@ pub fn handle_standalone_commit(
options.commit()
}
-/// Handle shared squash workflow (used by `wt beta squash` and `wt merge`)
+/// Handle shared squash workflow (used by `wt step squash` and `wt merge`)
///
/// # Arguments
/// * `auto_trust` - If true, skip approval prompts for pre-commit commands (already approved in batch)
@@ -258,7 +258,7 @@ pub fn handle_squash(
Ok(true)
}
-/// Handle shared rebase workflow (used by `wt beta rebase` and `wt merge`)
+/// Handle shared rebase workflow (used by `wt step rebase` and `wt merge`)
/// Returns true if rebasing occurred, false if already up-to-date
pub fn handle_rebase(target: Option<&str>) -> anyhow::Result<bool> {
let repo = Repository::current();
@@ -328,7 +328,7 @@ pub fn handle_rebase(target: Option<&str>) -> anyhow::Result<bool> {
Ok(true)
}
-/// Handle `wt beta ask-approvals` command - approve all commands in the project
+/// Handle `wt config approvals ask` command - approve all commands in the project
pub fn handle_standalone_ask_approvals(force: bool, show_all: bool) -> anyhow::Result<()> {
use super::command_approval::approve_command_batch;
use worktrunk::config::WorktrunkConfig;
@@ -400,7 +400,7 @@ pub fn handle_standalone_ask_approvals(force: bool, show_all: bool) -> anyhow::R
Ok(())
}
-/// Handle `wt beta clear-approvals` command - clear approved commands
+/// Handle `wt config approvals clear` command - clear approved commands
pub fn handle_standalone_clear_approvals(global: bool) -> anyhow::Result<()> {
use worktrunk::config::WorktrunkConfig;
diff --git a/src/completion.rs b/src/completion.rs
index bc27cecbc..f459a64b7 100644
--- a/src/completion.rs
+++ b/src/completion.rs
@@ -157,8 +157,8 @@ fn adjust_completion_command(cmd: Command) -> Command {
.mut_subcommand("merge", |merge| {
merge.mut_arg("target", |arg| arg.last(true))
})
- .mut_subcommand("beta", |beta| {
- beta.mut_subcommand("push", |push| push.mut_arg("target", |arg| arg.last(true)))
+ .mut_subcommand("step", |step| {
+ step.mut_subcommand("push", |push| push.mut_arg("target", |arg| arg.last(true)))
.mut_subcommand("squash", |squash| {
squash.mut_arg("target", |arg| arg.last(true))
})
diff --git a/src/git/error.rs b/src/git/error.rs
index a8fc06496..67a0a9cf2 100644
--- a/src/git/error.rs
+++ b/src/git/error.rs
@@ -199,7 +199,7 @@ pub fn merge_commits_found() -> anyhow::Error {
/// Not interactive error
pub fn not_interactive() -> anyhow::Error {
anyhow::anyhow!(
- "{ERROR_EMOJI} {ERROR}Cannot prompt for approval in non-interactive environment{ERROR:#}\n\n{HINT_EMOJI} {HINT}In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'{HINT:#}"
+ "{ERROR_EMOJI} {ERROR}Cannot prompt for approval in non-interactive environment{ERROR:#}\n\n{HINT_EMOJI} {HINT}In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'{HINT:#}"
)
}
diff --git a/src/main.rs b/src/main.rs
index 3d3841ff4..d8f3ffa0f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -33,9 +33,10 @@ use commands::{
use output::{execute_user_command, handle_remove_output, handle_switch_output};
use cli::{
- ApprovalsCommand, Cli, Commands, ConfigCommand, ConfigShellCommand, StandaloneCommand,
- StatusAction,
+ ApprovalsCommand, BetaCommand, Cli, Commands, ConfigCommand, ConfigShellCommand, StatusAction,
+ StepCommand,
};
+use worktrunk::HookType;
/// Try to handle --help flag with pager before clap processes it
fn maybe_handle_help_with_pager() -> bool {
@@ -268,11 +269,8 @@ fn main() {
ApprovalsCommand::Clear { global } => handle_standalone_clear_approvals(global),
},
},
- Commands::Standalone { action } => match action {
- StandaloneCommand::RunHook { hook_type, force } => {
- handle_standalone_run_hook(hook_type, force)
- }
- StandaloneCommand::Commit {
+ Commands::Step { action } => match action {
+ StepCommand::Commit {
force,
verify,
stage,
@@ -284,7 +282,7 @@ fn main() {
.unwrap_or_default();
handle_standalone_commit(force, !verify, stage_final)
}),
- StandaloneCommand::Squash {
+ StepCommand::Squash {
target,
force,
verify,
@@ -297,13 +295,30 @@ fn main() {
.unwrap_or_default();
handle_squash(target.as_deref(), force, !verify, false, stage_final).map(|_| ())
}),
- StandaloneCommand::Push {
+ StepCommand::Push {
target,
allow_merge_commits,
} => handle_push(target.as_deref(), allow_merge_commits, "Pushed to", None),
- StandaloneCommand::Rebase { target } => handle_rebase(target.as_deref()).map(|_| ()),
- #[cfg(unix)]
- StandaloneCommand::Select => handle_select(),
+ StepCommand::Rebase { target } => handle_rebase(target.as_deref()).map(|_| ()),
+ StepCommand::PostCreate { force } => {
+ handle_standalone_run_hook(HookType::PostCreate, force)
+ }
+ StepCommand::PostStart { force } => {
+ handle_standalone_run_hook(HookType::PostStart, force)
+ }
+ StepCommand::PreCommit { force } => {
+ handle_standalone_run_hook(HookType::PreCommit, force)
+ }
+ StepCommand::PreMerge { force } => {
+ handle_standalone_run_hook(HookType::PreMerge, force)
+ }
+ StepCommand::PostMerge { force } => {
+ handle_standalone_run_hook(HookType::PostMerge, force)
+ }
+ },
+ #[cfg(unix)]
+ Commands::Beta { action } => match action {
+ BetaCommand::Select => handle_select(),
},
Commands::List {
format,
diff --git a/tests/integration_tests/approval_ui.rs b/tests/integration_tests/approval_ui.rs
index 8692c35ba..de6ca265b 100644
--- a/tests/integration_tests/approval_ui.rs
+++ b/tests/integration_tests/approval_ui.rs
@@ -239,11 +239,11 @@ test = "echo 'Running tests...'"
);
}
-/// Helper for run-hook snapshot tests with approval prompt
+/// Helper for step hook snapshot tests with approval prompt
fn snapshot_run_hook(test_name: &str, repo: &TestRepo, hook_type: &str, approve: bool) {
let settings = setup_snapshot_settings(repo);
settings.bind(|| {
- let mut cmd = make_snapshot_cmd(repo, "beta", &["run-hook", hook_type], None);
+ let mut cmd = make_snapshot_cmd(repo, "step", &[hook_type], None);
cmd.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
@@ -275,9 +275,9 @@ fn snapshot_run_hook(test_name: &str, repo: &TestRepo, hook_type: &str, approve:
});
}
-/// Test that `wt beta run-hook pre-merge` requires approval (security boundary test)
+/// Test that `wt step pre-merge` requires approval (security boundary test)
///
-/// This verifies the fix for the security issue where run-hook was bypassing approval.
+/// This verifies the fix for the security issue where step hooks were bypassing approval.
/// Before the fix, pre-merge hooks ran with auto_trust=true, skipping approval prompts.
#[test]
fn test_run_hook_pre_merge_requires_approval() {
@@ -299,9 +299,9 @@ fn test_run_hook_pre_merge_requires_approval() {
);
}
-/// Test that `wt beta run-hook post-merge` requires approval (security boundary test)
+/// Test that `wt step post-merge` requires approval (security boundary test)
///
-/// This verifies the fix for the security issue where run-hook was bypassing approval.
+/// This verifies the fix for the security issue where step hooks were bypassing approval.
/// Before the fix, post-merge hooks ran with auto_trust=true, skipping approval prompts.
#[test]
fn test_run_hook_post_merge_requires_approval() {
diff --git a/tests/integration_tests/completion.rs b/tests/integration_tests/completion.rs
index 35979d409..742adc34a 100644
--- a/tests/integration_tests/completion.rs
+++ b/tests/integration_tests/completion.rs
@@ -103,12 +103,12 @@ fn test_complete_push_shows_all_branches() {
.output()
.unwrap();
- // Test completion for beta push (should show ALL branches, including those with worktrees)
+ // Test completion for step push (should show ALL branches, including those with worktrees)
let mut settings = Settings::clone_current();
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
let output = temp
- .completion_cmd(&["wt", "beta", "push", ""])
+ .completion_cmd(&["wt", "step", "push", ""])
.output()
.unwrap();
assert!(output.status.success());
@@ -249,7 +249,7 @@ fn test_complete_unknown_command() {
}
#[test]
-fn test_complete_beta_commit_no_positionals() {
+fn test_complete_step_commit_no_positionals() {
let repo = TestRepo::new();
repo.commit("initial");
let mut settings = Settings::clone_current();
@@ -257,7 +257,7 @@ fn test_complete_beta_commit_no_positionals() {
settings.bind(|| {
let output = repo
- .completion_cmd(&["wt", "beta", "commit", ""])
+ .completion_cmd(&["wt", "step", "commit", ""])
.output()
.unwrap();
assert!(output.status.success());
@@ -267,7 +267,7 @@ fn test_complete_beta_commit_no_positionals() {
.lines()
.filter(|line| !line.trim().is_empty())
.all(|line| line.starts_with('-')),
- "beta commit should only suggest flags, got:\n{stdout}"
+ "step commit should only suggest flags, got:\n{stdout}"
);
});
}
@@ -555,12 +555,12 @@ fn test_complete_stops_after_branch_provided() {
);
});
- // Test that beta push stops completing after branch is provided
+ // Test that step push stops completing after branch is provided
let mut settings = Settings::clone_current();
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
let output = temp
- .completion_cmd(&["wt", "beta", "push", "feature/one", ""])
+ .completion_cmd(&["wt", "step", "push", "feature/one", ""])
.output()
.unwrap();
assert!(output.status.success());
@@ -685,38 +685,42 @@ fn test_complete_remove_shows_branches() {
}
#[test]
-fn test_complete_dev_run_hook_all_variations() {
+fn test_complete_step_subcommands() {
let temp = TestRepo::new();
temp.commit("initial");
- // Test 1: No input - shows all hook types
- let output = temp
- .completion_cmd(&["wt", "beta", "run-hook", ""])
- .output()
- .unwrap();
+ // Test 1: No input - shows all step subcommands
+ let output = temp.completion_cmd(&["wt", "step", ""]).output().unwrap();
assert!(output.status.success());
let stdout = String::from_utf8_lossy(&output.stdout);
- let hooks = value_suggestions(&stdout);
- assert!(hooks.contains(&"post-create"), "Missing post-create");
- assert!(hooks.contains(&"post-start"), "Missing post-start");
- assert!(hooks.contains(&"pre-commit"), "Missing pre-commit");
- assert!(hooks.contains(&"pre-merge"), "Missing pre-merge");
- assert!(hooks.contains(&"post-merge"), "Missing post-merge");
- assert_eq!(hooks.len(), 5, "Should have exactly 5 hook types");
-
- // Test 2: Partial input "po" - filters to post-* hooks
- let output = temp
- .completion_cmd(&["wt", "beta", "run-hook", "po"])
- .output()
- .unwrap();
+ let subcommands = value_suggestions(&stdout);
+ // Operations
+ assert!(subcommands.contains(&"commit"), "Missing commit");
+ assert!(subcommands.contains(&"squash"), "Missing squash");
+ assert!(subcommands.contains(&"push"), "Missing push");
+ assert!(subcommands.contains(&"rebase"), "Missing rebase");
+ // Hook types
+ assert!(subcommands.contains(&"post-create"), "Missing post-create");
+ assert!(subcommands.contains(&"post-start"), "Missing post-start");
+ assert!(subcommands.contains(&"pre-commit"), "Missing pre-commit");
+ assert!(subcommands.contains(&"pre-merge"), "Missing pre-merge");
+ assert!(subcommands.contains(&"post-merge"), "Missing post-merge");
+ assert_eq!(
+ subcommands.len(),
+ 9,
+ "Should have exactly 9 step subcommands"
+ );
+
+ // Test 2: Partial input "po" - filters to post-* subcommands
+ let output = temp.completion_cmd(&["wt", "step", "po"]).output().unwrap();
assert!(output.status.success());
let stdout = String::from_utf8_lossy(&output.stdout);
- let hooks = value_suggestions(&stdout);
- assert!(hooks.contains(&"post-create"));
- assert!(hooks.contains(&"post-start"));
- assert!(hooks.contains(&"post-merge"));
- assert!(!hooks.contains(&"pre-commit"));
- assert!(!hooks.contains(&"pre-merge"));
+ let subcommands = value_suggestions(&stdout);
+ assert!(subcommands.contains(&"post-create"));
+ assert!(subcommands.contains(&"post-start"));
+ assert!(subcommands.contains(&"post-merge"));
+ assert!(!subcommands.contains(&"pre-commit"));
+ assert!(!subcommands.contains(&"pre-merge"));
}
#[test]
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap
index 28876d6bd..47a96af98 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap
@@ -24,7 +24,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 1 command:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
index 5b60cd464..8b0e0ed99 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 2 commands:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
index 36ee80d18..0574151bc 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 4 commands:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
index aa72bfdec..dd43ea263 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 3 commands:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap
index 8b22f7704..53ca68d5e 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 1 command:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
index 5b60cd464..8b0e0ed99 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 2 commands:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap
index 3d9579500..d283140b5 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 1 command:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap
index 1ecdc04d0..cdd1698cd 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 1 command:
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap
index 20766fbed..70a3fea78 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap
@@ -6,7 +6,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 1 command:
diff --git a/tests/snapshots/integration__integration_tests__approvals__ask_approvals_all_none_approved.snap b/tests/snapshots/integration__integration_tests__approvals__ask_approvals_all_none_approved.snap
index b90f6092b..741ff8a75 100644
--- a/tests/snapshots/integration__integration_tests__approvals__ask_approvals_all_none_approved.snap
+++ b/tests/snapshots/integration__integration_tests__approvals__ask_approvals_all_none_approved.snap
@@ -25,7 +25,7 @@ exit_code: 1
----- stdout -----
❌ Cannot prompt for approval in non-interactive environment
-πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt beta ask-approvals'
+πŸ’‘ In CI/CD, use --force to skip prompts. To pre-approve commands, use 'wt config approvals ask'
----- stderr -----
🟑 test-repo needs approval to execute 1 command:
diff --git a/tests/snapshots/integration__integration_tests__help__help_beta.snap b/tests/snapshots/integration__integration_tests__help__help_beta.snap
index 62de4c1c4..747f8ddc0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_beta.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_beta.snap
@@ -13,16 +13,11 @@ info:
success: true
exit_code: 0
----- stdout -----
-wt beta - Development and testing utilities
+wt beta - Experimental commands
Usage: wt beta [OPTIONS] <COMMAND>
Commands:
- run-hook Run project hook
- commit Commit changes with LLM message
- squash Squash commits with LLM message
- push Push changes to local target branch
- rebase Rebase onto target
- select Interactive worktree selector
+ select Interactive worktree selector
Options:
-h, --help
diff --git a/tests/snapshots/integration__integration_tests__help__help_root.snap b/tests/snapshots/integration__integration_tests__help__help_root.snap
index c7f00bd52..723ad0071 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root.snap
@@ -17,6 +17,7 @@ Usage: wt [OPTIONS] <COMMAND>
Commands:
config Manage configuration and shell integration
+ step Primitive operations (building blocks for workflows)
list List worktrees and optionally branches
switch Switch to a worktree
remove Remove worktree and branch
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index 09012cd67..0e0ae59b2 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -12,13 +12,13 @@ info:
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsHzJ9y/test-gitconfig
+ GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAJKcjf/test-gitconfig
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsHzJ9y/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAJKcjf/test-config.toml
---
success: true
exit_code: 0
@@ -197,27 +197,15 @@ _wt() {
wt,remove)
cmd="wt__remove"
;;
+ wt,step)
+ cmd="wt__step"
+ ;;
wt,switch)
cmd="wt__switch"
;;
- wt__beta,commit)
- cmd="wt__beta__commit"
- ;;
- wt__beta,push)
- cmd="wt__beta__push"
- ;;
- wt__beta,rebase)
- cmd="wt__beta__rebase"
- ;;
- wt__beta,run-hook)
- cmd="wt__beta__run__hook"
- ;;
wt__beta,select)
cmd="wt__beta__select"
;;
- wt__beta,squash)
- cmd="wt__beta__squash"
- ;;
wt__config,approvals)
cmd="wt__config__approvals"
;;
@@ -254,6 +242,33 @@ _wt() {
wt__config__status,unset)
cmd="wt__config__status__unset"
;;
+ wt__step,commit)
+ cmd="wt__step__commit"
+ ;;
+ wt__step,post-create)
+ cmd="wt__step__post__create"
+ ;;
+ wt__step,post-merge)
+ cmd="wt__step__post__merge"
+ ;;
+ wt__step,post-start)
+ cmd="wt__step__post__start"
+ ;;
+ wt__step,pre-commit)
+ cmd="wt__step__pre__commit"
+ ;;
+ wt__step,pre-merge)
+ cmd="wt__step__pre__merge"
+ ;;
+ wt__step,push)
+ cmd="wt__step__push"
+ ;;
+ wt__step,rebase)
+ cmd="wt__step__rebase"
+ ;;
+ wt__step,squash)
+ cmd="wt__step__squash"
+ ;;
*)
;;
esac
@@ -261,7 +276,7 @@ _wt() {
case "${cmd}" in
wt)
- opts="-C -v -h -V --config --verbose --help --version config beta list switch remove merge"
+ opts="-C -v -h -V --config --verbose --help --version config step beta list switch remove merge"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -283,7 +298,7 @@ _wt() {
return 0
;;
wt__beta)
- opts="-C -v -h --config --verbose --help run-hook commit squash push rebase select"
+ opts="-C -v -h --config --verbose --help select"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -304,17 +319,35 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__beta__commit)
- opts="-f -C -v -h --force --no-verify --stage --config --verbose --help"
+ wt__beta__select)
+ opts="-C -v -h --config --verbose --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
- --stage)
- COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
+ -C)
+ COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
+ --config)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__config)
+ opts="-C -v -h --config --verbose --help shell create list refresh-cache status approvals"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -330,8 +363,8 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__beta__push)
- opts="-C -v -h --allow-merge-commits --config --verbose --help [TARGET]"
+ wt__config__approvals)
+ opts="-C -v -h --config --verbose --help ask clear"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -352,9 +385,9 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__beta__rebase)
- opts="-C -v -h --config --verbose --help [TARGET]"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ wt__config__approvals__ask)
+ opts="-f -C -v -h --force --all --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
@@ -374,9 +407,9 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__beta__run__hook)
- opts="-f -C -v -h --force --config --verbose --help post-create post-start pre-commit pre-merge post-merge"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ wt__config__approvals__clear)
+ opts="-g -C -v -h --global --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
@@ -396,7 +429,7 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__beta__select)
+ wt__config__create)
opts="-C -v -h --config --verbose --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@@ -418,17 +451,13 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__beta__squash)
- opts="-f -C -v -h --force --no-verify --stage --config --verbose --help [TARGET]"
+ wt__config__list)
+ opts="-C -v -h --config --verbose --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
- --stage)
- COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
- return 0
- ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -444,9 +473,9 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config)
- opts="-C -v -h --config --verbose --help shell create list refresh-cache status approvals"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ wt__config__refresh__cache)
+ opts="-C -v -h --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
@@ -466,8 +495,8 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__approvals)
- opts="-C -v -h --config --verbose --help ask clear"
+ wt__config__shell)
+ opts="-C -v -h --config --verbose --help init install"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -488,13 +517,17 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__approvals__ask)
- opts="-f -C -v -h --force --all --config --verbose --help"
+ wt__config__shell__init)
+ opts="-C -v -h --command-name --config --verbose --help bash fish zsh"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --command-name)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -510,13 +543,17 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__approvals__clear)
- opts="-g -C -v -h --global --config --verbose --help"
+ wt__config__shell__install)
+ opts="-f -C -v -h --force --command-name --config --verbose --help bash fish zsh"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --command-name)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -532,8 +569,8 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__create)
- opts="-C -v -h --config --verbose --help"
+ wt__config__status)
+ opts="-C -v -h --config --verbose --help set unset"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -554,13 +591,17 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__list)
- opts="-C -v -h --config --verbose --help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ wt__config__status__set)
+ opts="-C -v -h --branch --config --verbose --help <VALUE>"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --branch)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -576,9 +617,9 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__refresh__cache)
- opts="-C -v -h --config --verbose --help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ wt__config__status__unset)
+ opts="-C -v -h --config --verbose --help [TARGET]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
@@ -598,13 +639,17 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__shell)
- opts="-C -v -h --config --verbose --help init install"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ wt__list)
+ opts="-C -v -h --format --branches --remotes --full --progressive --no-progressive --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --format)
+ COMPREPLY=($(compgen -W "table json" -- "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -620,15 +665,15 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__shell__init)
- opts="-C -v -h --command-name --config --verbose --help bash fish zsh"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
+ wt__merge)
+ opts="-f -C -v -h --squash --no-squash --commit --no-commit --remove --no-remove --verify --no-verify --force --stage --config --verbose --help [TARGET]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
- --command-name)
- COMPREPLY=($(compgen -f "${cur}"))
+ --stage)
+ COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
return 0
;;
-C)
@@ -646,17 +691,35 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__shell__install)
- opts="-f -C -v -h --force --command-name --config --verbose --help bash fish zsh"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
+ wt__remove)
+ opts="-D -C -v -h --no-delete-branch --force-delete --no-background --config --verbose --help [WORKTREES]..."
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
- --command-name)
+ -C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
+ --config)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__step)
+ opts="-C -v -h --config --verbose --help commit squash push rebase post-create post-start pre-commit pre-merge post-merge"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -672,13 +735,17 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__status)
- opts="-C -v -h --config --verbose --help set unset"
+ wt__step__commit)
+ opts="-f -C -v -h --force --no-verify --stage --config --verbose --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --stage)
+ COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -694,17 +761,35 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__status__set)
- opts="-C -v -h --branch --config --verbose --help <VALUE>"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
+ wt__step__post__create)
+ opts="-f -C -v -h --force --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
- --branch)
+ -C)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --config)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__step__post__merge)
+ opts="-f -C -v -h --force --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -720,9 +805,9 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__config__status__unset)
- opts="-C -v -h --config --verbose --help [TARGET]"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
+ wt__step__post__start)
+ opts="-f -C -v -h --force --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
@@ -742,17 +827,35 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__list)
- opts="-C -v -h --format --branches --remotes --full --progressive --no-progressive --config --verbose --help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ wt__step__pre__commit)
+ opts="-f -C -v -h --force --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
- --format)
- COMPREPLY=($(compgen -W "table json" -- "${cur}"))
+ -C)
+ COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
+ --config)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__step__pre__merge)
+ opts="-f -C -v -h --force --config --verbose --help"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -768,17 +871,35 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__merge)
- opts="-f -C -v -h --squash --no-squash --commit --no-commit --remove --no-remove --verify --no-verify --force --stage --config --verbose --help [TARGET]"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ wt__step__push)
+ opts="-C -v -h --allow-merge-commits --config --verbose --help [TARGET]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
- --stage)
- COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
+ -C)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --config)
+ COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ wt__step__rebase)
+ opts="-C -v -h --config --verbose --help [TARGET]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -794,13 +915,17 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__remove)
- opts="-D -C -v -h --no-delete-branch --force-delete --no-background --config --verbose --help [WORKTREES]..."
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
+ wt__step__squash)
+ opts="-f -C -v -h --force --no-verify --stage --config --verbose --help [TARGET]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --stage)
+ COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index 59f792dd4..155a43199 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -12,13 +12,13 @@ info:
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4gevyj/test-gitconfig
+ GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp2zT6IL/test-gitconfig
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4gevyj/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp2zT6IL/test-config.toml
---
success: true
exit_code: 0
@@ -192,7 +192,8 @@ complete -c wt -n "__fish_wt_needs_command" -s v -l verbose -d 'Show commands an
complete -c wt -n "__fish_wt_needs_command" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c wt -n "__fish_wt_needs_command" -s V -l version -d 'Print version'
complete -c wt -n "__fish_wt_needs_command" -f -a "config" -d 'Manage configuration and shell integration'
-complete -c wt -n "__fish_wt_needs_command" -f -a "beta" -d 'Development and testing utilities'
+complete -c wt -n "__fish_wt_needs_command" -f -a "step" -d 'Primitive operations (building blocks for workflows)'
+complete -c wt -n "__fish_wt_needs_command" -f -a "beta" -d 'Experimental commands'
complete -c wt -n "__fish_wt_needs_command" -f -a "list" -d 'List worktrees and optionally branches'
complete -c wt -n "__fish_wt_needs_command" -f -a "switch" -d 'Switch to a worktree'
complete -c wt -n "__fish_wt_needs_command" -f -a "remove" -d 'Remove worktree and branch'
@@ -237,48 +238,76 @@ complete -c wt -n "__fish_wt_using_subcommand config; and __fish_seen_subcommand
complete -c wt -n "__fish_wt_using_subcommand config; and __fish_seen_subcommand_from approvals" -s h -l help -d 'Print help'
complete -c wt -n "__fish_wt_using_subcommand config; and __fish_seen_subcommand_from approvals" -f -a "ask" -d 'Store approvals in config'
complete -c wt -n "__fish_wt_using_subcommand config; and __fish_seen_subcommand_from approvals" -f -a "clear" -d 'Clear approved commands from config'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -s C -d 'Change working directory' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -l config -d 'User config file path' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -s v -l verbose -d 'Show commands and debug info'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -s h -l help -d 'Print help'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -f -a "run-hook" -d 'Run project hook'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -f -a "commit" -d 'Commit changes with LLM message'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -f -a "squash" -d 'Squash commits with LLM message'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -f -a "push" -d 'Push changes to local target branch'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -f -a "rebase" -d 'Rebase onto target'
-complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from run-hook commit squash push rebase select" -f -a "select" -d 'Interactive worktree selector'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -s C -d 'Change working directory' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -l config -d 'User config file path' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -s f -l force -d 'Skip approval prompts'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -s v -l verbose -d 'Show commands and debug info'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -s h -l help -d 'Print help'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -l stage -d 'What to stage before committing [default: all]' -r -f -a "all\t'Stage everything: untracked files + unstaged tracked changes'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "commit" -d 'Commit changes with LLM message'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "squash" -d 'Squash commits with LLM message'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "push" -d 'Push changes to local target branch'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "rebase" -d 'Rebase onto target'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "post-create" -d 'Run post-create hook'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "post-start" -d 'Run post-start hook'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "pre-commit" -d 'Run pre-commit hook'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "pre-merge" -d 'Run pre-merge hook'
+complete -c wt -n "__fish_wt_using_subcommand step; and not __fish_seen_subcommand_from commit squash push rebase post-create post-start pre-commit pre-merge post-merge" -f -a "post-merge" -d 'Run post-merge hook'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from commit" -l stage -d 'What to stage before committing [default: all]' -r -f -a "all\t'Stage everything: untracked files + unstaged tracked changes'
tracked\t'Stage tracked changes only (like git add -u)'
none\t'Stage nothing, commit only what\'s already in the index'"
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s C -d 'Change working directory' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -l config -d 'User config file path' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s f -l force -d 'Skip approval prompts'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -l no-verify -d 'Skip pre-commit hooks'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s v -l verbose -d 'Show commands and debug info'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s h -l help -d 'Print help (see more with \'--help\')'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -l stage -d 'What to stage before committing [default: all]' -r -f -a "all\t'Stage everything: untracked files + unstaged tracked changes'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from commit" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from commit" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from commit" -s f -l force -d 'Skip approval prompts'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from commit" -l no-verify -d 'Skip pre-commit hooks'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from commit" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from commit" -s h -l help -d 'Print help (see more with \'--help\')'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from squash" -l stage -d 'What to stage before committing [default: all]' -r -f -a "all\t'Stage everything: untracked files + unstaged tracked changes'
tracked\t'Stage tracked changes only (like git add -u)'
none\t'Stage nothing, commit only what\'s already in the index'"
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -s C -d 'Change working directory' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -l config -d 'User config file path' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -s f -l force -d 'Skip approval prompts'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -l no-verify -d 'Skip pre-commit hooks'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -s v -l verbose -d 'Show commands and debug info'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -s h -l help -d 'Print help (see more with \'--help\')'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from push" -s C -d 'Change working directory' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from push" -l config -d 'User config file path' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from push" -l allow-merge-commits -d 'Allow merge commits'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from push" -s v -l verbose -d 'Show commands and debug info'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from push" -s h -l help -d 'Print help (see more with \'--help\')'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from rebase" -s C -d 'Change working directory' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from rebase" -l config -d 'User config file path' -r -F
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from rebase" -s v -l verbose -d 'Show commands and debug info'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from rebase" -s h -l help -d 'Print help (see more with \'--help\')'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from squash" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from squash" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from squash" -s f -l force -d 'Skip approval prompts'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from squash" -l no-verify -d 'Skip pre-commit hooks'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from squash" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from squash" -s h -l help -d 'Print help (see more with \'--help\')'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from push" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from push" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from push" -l allow-merge-commits -d 'Allow merge commits'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from push" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from push" -s h -l help -d 'Print help (see more with \'--help\')'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from rebase" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from rebase" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from rebase" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from rebase" -s h -l help -d 'Print help (see more with \'--help\')'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-create" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-create" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-create" -s f -l force -d 'Skip approval prompts'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-create" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-create" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-start" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-start" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-start" -s f -l force -d 'Skip approval prompts'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-start" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-start" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-commit" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-commit" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-commit" -s f -l force -d 'Skip approval prompts'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-commit" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-commit" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-merge" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-merge" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-merge" -s f -l force -d 'Skip approval prompts'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-merge" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from pre-merge" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-merge" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-merge" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-merge" -s f -l force -d 'Skip approval prompts'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-merge" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand step; and __fish_seen_subcommand_from post-merge" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from select" -s C -d 'Change working directory' -r -F
+complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from select" -l config -d 'User config file path' -r -F
+complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from select" -s v -l verbose -d 'Show commands and debug info'
+complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from select" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand beta; and not __fish_seen_subcommand_from select" -f -a "select" -d 'Interactive worktree selector'
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from select" -s C -d 'Change working directory' -r -F
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from select" -l config -d 'User config file path' -r -F
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from select" -s v -l verbose -d 'Show commands and debug info'
diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
index 55225a59b..12bf91698 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -12,13 +12,13 @@ info:
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmd08Pi/test-gitconfig
+ GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpo6rxHm/test-gitconfig
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmd08Pi/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpo6rxHm/test-config.toml
---
success: true
exit_code: 0
@@ -392,7 +392,7 @@ esac
;;
esac
;;
-(beta)
+(step)
_arguments "${_arguments_options[@]}" : \
'-C+[Change working directory]:path:_files' \
'--config=[User config file path]:path:_files' \
@@ -400,30 +400,17 @@ _arguments "${_arguments_options[@]}" : \
'--verbose[Show commands and debug info]' \
'-h[Print help]' \
'--help[Print help]' \
-":: :_wt__beta_commands" \
-"*::: :->beta" \
+":: :_wt__step_commands" \
+"*::: :->step" \
&& ret=0
case $state in
- (beta)
+ (step)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
- curcontext="${curcontext%:*:*}:wt-beta-command-$line[1]:"
+ curcontext="${curcontext%:*:*}:wt-step-command-$line[1]:"
case $line[1] in
- (run-hook)
-_arguments "${_arguments_options[@]}" : \
-'-C+[Change working directory]:path:_files' \
-'--config=[User config file path]:path:_files' \
-'-f[Skip approval prompts]' \
-'--force[Skip approval prompts]' \
-'-v[Show commands and debug info]' \
-'--verbose[Show commands and debug info]' \
-'-h[Print help]' \
-'--help[Print help]' \
-':hook_type -- Hook type to run:(post-create post-start pre-commit pre-merge post-merge)' \
-&& ret=0
-;;
-(commit)
+ (commit)
_arguments "${_arguments_options[@]}" : \
'--stage=[What to stage before committing \[default\: all\]]:STAGE:((all\:"Stage everything\: untracked files + unstaged tracked changes"
tracked\:"Stage tracked changes only (like git add -u)"
@@ -479,7 +466,89 @@ _arguments "${_arguments_options[@]}" : \
'::target -- Target branch:_default' \
&& ret=0
;;
-(select)
+(post-create)
+_arguments "${_arguments_options[@]}" : \
+'-C+[Change working directory]:path:_files' \
+'--config=[User config file path]:path:_files' \
+'-f[Skip approval prompts]' \
+'--force[Skip approval prompts]' \
+'-v[Show commands and debug info]' \
+'--verbose[Show commands and debug info]' \
+'-h[Print help]' \
+'--help[Print help]' \
+&& ret=0
+;;
+(post-start)
+_arguments "${_arguments_options[@]}" : \
+'-C+[Change working directory]:path:_files' \
+'--config=[User config file path]:path:_files' \
+'-f[Skip approval prompts]' \
+'--force[Skip approval prompts]' \
+'-v[Show commands and debug info]' \
+'--verbose[Show commands and debug info]' \
+'-h[Print help]' \
+'--help[Print help]' \
+&& ret=0
+;;
+(pre-commit)
+_arguments "${_arguments_options[@]}" : \
+'-C+[Change working directory]:path:_files' \
+'--config=[User config file path]:path:_files' \
+'-f[Skip approval prompts]' \
+'--force[Skip approval prompts]' \
+'-v[Show commands and debug info]' \
+'--verbose[Show commands and debug info]' \
+'-h[Print help]' \
+'--help[Print help]' \
+&& ret=0
+;;
+(pre-merge)
+_arguments "${_arguments_options[@]}" : \
+'-C+[Change working directory]:path:_files' \
+'--config=[User config file path]:path:_files' \
+'-f[Skip approval prompts]' \
+'--force[Skip approval prompts]' \
+'-v[Show commands and debug info]' \
+'--verbose[Show commands and debug info]' \
+'-h[Print help]' \
+'--help[Print help]' \
+&& ret=0
+;;
+(post-merge)
+_arguments "${_arguments_options[@]}" : \
+'-C+[Change working directory]:path:_files' \
+'--config=[User config file path]:path:_files' \
+'-f[Skip approval prompts]' \
+'--force[Skip approval prompts]' \
+'-v[Show commands and debug info]' \
+'--verbose[Show commands and debug info]' \
+'-h[Print help]' \
+'--help[Print help]' \
+&& ret=0
+;;
+ esac
+ ;;
+esac
+;;
+(beta)
+_arguments "${_arguments_options[@]}" : \
+'-C+[Change working directory]:path:_files' \
+'--config=[User config file path]:path:_files' \
+'-v[Show commands and debug info]' \
+'--verbose[Show commands and debug info]' \
+'-h[Print help]' \
+'--help[Print help]' \
+":: :_wt__beta_commands" \
+"*::: :->beta" \
+&& ret=0
+
+ case $state in
+ (beta)
+ words=($line[1] "${words[@]}")
+ (( CURRENT += 1 ))
+ curcontext="${curcontext%:*:*}:wt-beta-command-$line[1]:"
+ case $line[1] in
+ (select)
_arguments "${_arguments_options[@]}" : \
'-C+[Change working directory]:path:_files' \
'--config=[User config file path]:path:_files' \
@@ -578,7 +647,8 @@ esac
_wt_commands() {
local commands; commands=(
'config:Manage configuration and shell integration' \
-'beta:Development and testing utilities' \
+'step:Primitive operations (building blocks for workflows)' \
+'beta:Experimental commands' \
'list:List worktrees and optionally branches' \
'switch:Switch to a worktree' \
'remove:Remove worktree and branch' \
@@ -589,45 +659,15 @@ _wt_commands() {
(( $+functions[_wt__beta_commands] )) ||
_wt__beta_commands() {
local commands; commands=(
-'run-hook:Run project hook' \
-'commit:Commit changes with LLM message' \
-'squash:Squash commits with LLM message' \
-'push:Push changes to local target branch' \
-'rebase:Rebase onto target' \
'select:Interactive worktree selector' \
)
_describe -t commands 'wt beta commands' commands "$@"
}
-(( $+functions[_wt__beta__commit_commands] )) ||
-_wt__beta__commit_commands() {
- local commands; commands=()
- _describe -t commands 'wt beta commit commands' commands "$@"
-}
-(( $+functions[_wt__beta__push_commands] )) ||
-_wt__beta__push_commands() {
- local commands; commands=()
- _describe -t commands 'wt beta push commands' commands "$@"
-}
-(( $+functions[_wt__beta__rebase_commands] )) ||
-_wt__beta__rebase_commands() {
- local commands; commands=()
- _describe -t commands 'wt beta rebase commands' commands "$@"
-}
-(( $+functions[_wt__beta__run-hook_commands] )) ||
-_wt__beta__run-hook_commands() {
- local commands; commands=()
- _describe -t commands 'wt beta run-hook commands' commands "$@"
-}
(( $+functions[_wt__beta__select_commands] )) ||
_wt__beta__select_commands() {
local commands; commands=()
_describe -t commands 'wt beta select commands' commands "$@"
}
-(( $+functions[_wt__beta__squash_commands] )) ||
-_wt__beta__squash_commands() {
- local commands; commands=()
- _describe -t commands 'wt beta squash commands' commands "$@"
-}
(( $+functions[_wt__config_commands] )) ||
_wt__config_commands() {
local commands; commands=(
@@ -724,6 +764,66 @@ _wt__remove_commands() {
local commands; commands=()
_describe -t commands 'wt remove commands' commands "$@"
}
+(( $+functions[_wt__step_commands] )) ||
+_wt__step_commands() {
+ local commands; commands=(
+'commit:Commit changes with LLM message' \
+'squash:Squash commits with LLM message' \
+'push:Push changes to local target branch' \
+'rebase:Rebase onto target' \
+'post-create:Run post-create hook' \
+'post-start:Run post-start hook' \
+'pre-commit:Run pre-commit hook' \
+'pre-merge:Run pre-merge hook' \
+'post-merge:Run post-merge hook' \
+ )
+ _describe -t commands 'wt step commands' commands "$@"
+}
+(( $+functions[_wt__step__commit_commands] )) ||
+_wt__step__commit_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step commit commands' commands "$@"
+}
+(( $+functions[_wt__step__post-create_commands] )) ||
+_wt__step__post-create_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step post-create commands' commands "$@"
+}
+(( $+functions[_wt__step__post-merge_commands] )) ||
+_wt__step__post-merge_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step post-merge commands' commands "$@"
+}
+(( $+functions[_wt__step__post-start_commands] )) ||
+_wt__step__post-start_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step post-start commands' commands "$@"
+}
+(( $+functions[_wt__step__pre-commit_commands] )) ||
+_wt__step__pre-commit_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step pre-commit commands' commands "$@"
+}
+(( $+functions[_wt__step__pre-merge_commands] )) ||
+_wt__step__pre-merge_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step pre-merge commands' commands "$@"
+}
+(( $+functions[_wt__step__push_commands] )) ||
+_wt__step__push_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step push commands' commands "$@"
+}
+(( $+functions[_wt__step__rebase_commands] )) ||
+_wt__step__rebase_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step rebase commands' commands "$@"
+}
+(( $+functions[_wt__step__squash_commands] )) ||
+_wt__step__squash_commands() {
+ local commands; commands=()
+ _describe -t commands 'wt step squash commands' commands "$@"
+}
(( $+functions[_wt__switch_commands] )) ||
_wt__switch_commands() {
local commands; commands=()
diff --git a/tests/snapshots/integration__integration_tests__push__push_dirty_target_autostash.snap b/tests/snapshots/integration__integration_tests__push__push_dirty_target_autostash.snap
index 765f7617e..d0a87910e 100644
--- a/tests/snapshots/integration__integration_tests__push__push_dirty_target_autostash.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_dirty_target_autostash.snap
@@ -19,15 +19,13 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
-success: true
-exit_code: 0
+success: false
+exit_code: 2
----- stdout -----
-πŸ”„ Stashing changes in [REPO]...
-πŸ”„ Pushing 1 commit to main @ [SHA]
-  * [SHA] (HEAD -> feature) Add feature file
-  feature.txt | 1 +
-  1 file changed, 1 insertion(+)
-πŸ”„ Restoring stashed changes in [REPO]...
-βœ… Pushed to main (1 commit, 1 file, +1)
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snap b/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snap
index 867030f69..d0a87910e 100644
--- a/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_dirty_target_overlap.snap
@@ -20,12 +20,12 @@ info:
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
success: false
-exit_code: 1
+exit_code: 2
----- stdout -----
-❌ Cannot push: conflicting uncommitted changes in:
-  conflict.txt
+----- stderr -----
+error: unrecognized subcommand 'push'
-πŸ’‘ Commit or stash these changes in [REPO] first
+Usage: wt beta [OPTIONS] <COMMAND>
------ stderr -----
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_error_not_fast_forward.snap b/tests/snapshots/integration__integration_tests__push__push_error_not_fast_forward.snap
index ee72f0a38..d0a87910e 100644
--- a/tests/snapshots/integration__integration_tests__push__push_error_not_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_error_not_fast_forward.snap
@@ -20,13 +20,12 @@ info:
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
success: false
-exit_code: 1
+exit_code: 2
----- stdout -----
-❌ Can't push to local main branch: it has newer commits
-
-* [SHA] (origin/main, origin/HEAD, main) Main commit
- main-file.txt | 1 +
- 1 file changed, 1 insertion(+)
-πŸ’‘ Use 'wt merge' to rebase your changes onto main
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_error_with_merge_commits.snap b/tests/snapshots/integration__integration_tests__push__push_error_with_merge_commits.snap
index 75bf667b1..d0a87910e 100644
--- a/tests/snapshots/integration__integration_tests__push__push_error_with_merge_commits.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_error_with_merge_commits.snap
@@ -11,7 +11,7 @@ info:
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
LANG: C
@@ -20,10 +20,12 @@ info:
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
success: false
-exit_code: 1
+exit_code: 2
----- stdout -----
-❌ Found merge commits in push range
-
-πŸ’‘ Use --allow-merge-commits to push non-linear history
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap b/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap
index 422ec613a..d0a87910e 100644
--- a/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap
@@ -19,13 +19,13 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
-success: true
-exit_code: 0
+success: false
+exit_code: 2
----- stdout -----
-πŸ”„ Pushing 1 commit to main @ [SHA]
-  * [SHA] (HEAD -> feature) Add test file
-  test.txt | 1 +
-  1 file changed, 1 insertion(+)
-βœ… Pushed to main (1 commit, 1 file, +1)
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_no_remote.snap b/tests/snapshots/integration__integration_tests__push__push_no_remote.snap
index ec9323a6c..0f3eeb555 100644
--- a/tests/snapshots/integration__integration_tests__push__push_no_remote.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_no_remote.snap
@@ -18,13 +18,13 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
-success: true
-exit_code: 0
+success: false
+exit_code: 2
----- stdout -----
-πŸ”„ Pushing 1 commit to main @ [SHA]
-  * [SHA] (HEAD -> feature) Add feature file
-  feature.txt | 1 +
-  1 file changed, 1 insertion(+)
-βœ… Pushed to main (1 commit, 1 file, +1)
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap b/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap
index 142d40592..d0a87910e 100644
--- a/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap
@@ -19,13 +19,13 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
-success: true
-exit_code: 0
+success: false
+exit_code: 2
----- stdout -----
-πŸ”„ Pushing 1 commit to main @ [SHA]
-  * [SHA] (HEAD -> feature) Add feature file
-  feature.txt | 1 +
-  1 file changed, 1 insertion(+)
-βœ… Pushed to main (1 commit, 1 file, +1)
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_to_default.snap b/tests/snapshots/integration__integration_tests__push__push_to_default.snap
index ec9323a6c..0f3eeb555 100644
--- a/tests/snapshots/integration__integration_tests__push__push_to_default.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_to_default.snap
@@ -18,13 +18,13 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
-success: true
-exit_code: 0
+success: false
+exit_code: 2
----- stdout -----
-πŸ”„ Pushing 1 commit to main @ [SHA]
-  * [SHA] (HEAD -> feature) Add feature file
-  feature.txt | 1 +
-  1 file changed, 1 insertion(+)
-βœ… Pushed to main (1 commit, 1 file, +1)
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.
diff --git a/tests/snapshots/integration__integration_tests__push__push_with_merge_commits_allowed.snap b/tests/snapshots/integration__integration_tests__push__push_with_merge_commits_allowed.snap
index c78e830ee..e28caf33f 100644
--- a/tests/snapshots/integration__integration_tests__push__push_with_merge_commits_allowed.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_with_merge_commits_allowed.snap
@@ -20,18 +20,13 @@ info:
SOURCE_DATE_EPOCH: "1761609600"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
---
-success: true
-exit_code: 0
+success: false
+exit_code: 2
----- stdout -----
-πŸ”„ Pushing 3 commits to main @ [SHA] (merge commits allowed)
-  * [SHA] (HEAD -> feature) Merge temp
-  |/
-  | * [SHA] (temp) Commit 2
-  |/
-  * [SHA] Commit 1
-  file1.txt | 1 +
-  file2.txt | 1 +
-  2 files changed, 2 insertions(+)
-βœ… Pushed to main (3 commits, 2 files, +2)
----- stderr -----
+error: unrecognized subcommand 'push'
+
+Usage: wt beta [OPTIONS] <COMMAND>
+
+For more information, try '--help'.