Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
docs: Expand execute option docs with examples and use case
Maximilian Roos5026d13fa8c1
diff --git a/README.md b/README.mdindex 46732af98..12429a121 100644--- a/README.md+++ b/README.md@@ -484,6 +484,14 @@ Options:-x, --execute <EXECUTE>Command to run after switch+ Replaces the wt process with the command after switching, giving it full terminal control. Useful for launching editors, AI agents, or other interactive tools.++ Especially useful in shell aliases to create a worktree and start working in one command:++ alias wsc='wt switch --create --execute=claude'++ Then wsc feature-branch creates the worktree and launches Claude Code.+-f, --forceSkip approval promptsdiff --git a/docs/content/switch.md b/docs/content/switch.mdindex fadfee168..2fe50e6c9 100644--- a/docs/content/switch.md+++ b/docs/content/switch.md@@ -102,6 +102,14 @@ Options:-x, --execute <EXECUTE>Command to run after switch+ Replaces the wt process with the command after switching, giving it full terminal control. Useful for launching editors, AI agents, or other interactive tools.++ Especially useful in shell aliases to create a worktree and start working in one command:++ alias wsc='wt switch --create --execute=claude'++ Then wsc feature-branch creates the worktree and launches Claude Code.+-f, --forceSkip approval promptsdiff --git a/src/cli.rs b/src/cli.rsindex a580df73a..e0c323224 100644--- a/src/cli.rs+++ b/src/cli.rs@@ -1063,6 +1063,19 @@ Arguments resolve by checking the filesystem before git branches:base: Option<String>,/// Command to run after switch+ ///+ /// Replaces the wt process with the command after switching, giving+ /// it full terminal control. Useful for launching editors, AI agents,+ /// or other interactive tools.+ ///+ /// Especially useful in shell aliases to create a worktree and start+ /// working in one command:+ ///+ /// ```sh+ /// alias wsc='wt switch --create --execute=claude'+ /// ```+ ///+ /// Then `wsc feature-branch` creates the worktree and launches Claude Code.#[arg(short = 'x', long)]execute: Option<String>,diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snapindex 37fa2dc94..54047cf4c 100644--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap@@ -36,7 +36,15 @@ Usage: [1m[36mwt switch[0m [36m[OPTIONS][0m [36m<BRANCH>[0mDefaults to default branch.[0m[1m[36m-x[0m, [1m[36m--execute[0m[36m [0m[36m<EXECUTE>[0m- Command to run after switch+ Command to run after switch[0m+ [0m+ Replaces the wt process with the command after switching, giving it full terminal control. Useful for launching editors, AI agents, or other interactive tools.[0m+ [0m+ Especially useful in shell aliases to create a worktree and start working in one command:[0m+ [0m+ [1m[1malias wsc='wt switch --create --execute=claude'[0m+ [0m[0m+ Then [1mwsc feature-branch[0m creates the worktree and launches Claude Code.[0m[1m[36m-f[0m, [1m[36m--force[0mSkip approval prompts