pub enum Commands {
Show 18 variants
New {
name: String,
path: Option<String>,
base: Option<String>,
no_term: bool,
term: Option<String>,
prompt: Option<String>,
prompt_file: Option<PathBuf>,
prompt_stdin: bool,
},
Resume {
branch: Option<String>,
term: Option<String>,
},
Spawn {
target: Option<String>,
term: Option<String>,
prompt: Option<String>,
prompt_file: Option<PathBuf>,
prompt_stdin: bool,
},
Rm {
targets: Vec<String>,
interactive: bool,
dry_run: bool,
keep_branch: bool,
delete_remote: bool,
force: bool,
no_force: bool,
},
List,
Ls,
Doctor {
session_start: bool,
quiet: bool,
},
Upgrade {
yes: bool,
},
SetupClaude,
ShellSetup,
Exec {
target: String,
cmd: Vec<String>,
},
Run {
only: Option<String>,
no_main: bool,
jobs: usize,
continue_on_error: bool,
cmd: Vec<String>,
},
Guard {
tool_input: String,
},
Path {
branch: Option<String>,
list_branches: bool,
interactive: bool,
},
ShellFunction {
shell: String,
},
UpdateCache,
CompleteTargets,
SpawnAi {
spec: Option<PathBuf>,
},
}Variants§
New
Create new worktree for feature branch
Fields
term: Option<String>Terminal launch method for THIS invocation. Overrides config
and CW_LAUNCH_METHOD. Accepts canonical names (e.g.,
wezterm-tab) or aliases (e.g., w-t, w-t-b). Supports
method:session-name for tmux/zellij. Mutually exclusive
with --no-term.
Resume
Resume AI work in a worktree
Fields
Spawn
Launch AI tool in an existing worktree (default: current).
Fields
target: Option<String>Worktree target — exact worktree name, branch name, or path. Default: current worktree.
Rm
Remove one or more worktrees.
With no arguments: removes the current worktree (must be inside one).
With one or more positional targets: removes each of them; flags apply
to every target.
With -i: opens a multi-select UI.
Exits 0 on full success, 1 if the user cancelled at the confirmation prompt or in the interactive UI, 2 if any target could not be removed (not found, busy, or an error).
Fields
targets: Vec<String>Branch names or paths of worktrees to remove. If empty and –interactive is not set, removes the current worktree.
List
List all worktrees (rich, human-readable)
Ls
Print all worktrees as TSV (for scripts)
Columns: worktree_id, branch, status, age, repo_root, path
Doctor
Run diagnostics
Fields
Upgrade
Check for updates / upgrade
SetupClaude
Install Claude Code skill for worktree task delegation
ShellSetup
Interactive shell integration setup
Exec
Run cmd in one specific worktree.
Run
Run cmd in every worktree in scope.
Fields
Guard
Hook helper: read a Claude Code hook payload from stdin (or a file) and decide whether to allow or block the inbound tool use. Exits 0 to allow; non-zero with stderr message to block.
Path
[Internal] Get worktree path for a branch
Fields
ShellFunction
Generate shell function for gw-cd
UpdateCache
Refresh update cache (background process)
CompleteTargets
[Internal] Print completion targets for the current repo (one per line)
SpawnAi
[Internal] Execute an AI tool spawn spec file
Trait Implementations§
Source§impl FromArgMatches for Commands
impl FromArgMatches for Commands
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Commands
impl Subcommand for Commands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Commands
impl RefUnwindSafe for Commands
impl Send for Commands
impl Sync for Commands
impl Unpin for Commands
impl UnsafeUnpin for Commands
impl UnwindSafe for Commands
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more