Skip to main content

Commands

Enum Commands 

Source
pub enum Commands {
Show 33 variants New { name: String, path: Option<String>, base: Option<String>, no_term: bool, term: Option<String>, bg: bool, prompt: Option<String>, }, Pr { branch: Option<String>, title: Option<String>, body: Option<String>, draft: bool, no_push: bool, worktree: bool, by_branch: bool, }, Merge { branch: Option<String>, interactive: bool, dry_run: bool, push: bool, ai_merge: bool, worktree: bool, }, Resume { branch: Option<String>, term: Option<String>, bg: bool, worktree: bool, by_branch: bool, }, Shell { worktree: Option<String>, args: Vec<String>, }, Status, Delete { target: Option<String>, keep_branch: bool, delete_remote: bool, force: bool, no_force: bool, worktree: bool, branch: bool, }, List, Clean { merged: bool, older_than: Option<u64>, interactive: bool, dry_run: bool, }, Tree, Stats, Diff { branch1: String, branch2: String, summary: bool, files: bool, }, Sync { branch: Option<String>, all: bool, fetch_only: bool, ai_merge: bool, worktree: bool, by_branch: bool, }, ChangeBase { new_base: String, branch: Option<String>, dry_run: bool, interactive: bool, worktree: bool, by_branch: bool, }, Config { action: ConfigAction, }, Backup { action: BackupAction, }, Stash { action: StashAction, }, Hook { action: HookAction, }, Export { output: Option<String>, }, Import { import_file: String, apply: bool, }, Scan { dir: Option<PathBuf>, }, Prune, Doctor, Upgrade, SetupClaude, ShellSetup, Path { branch: Option<String>, list_branches: bool, interactive: bool, }, ShellFunction { shell: String, }, ConfigKeys, UpdateCache, TermValues, PresetNames, HookEvents,
}

Variants§

§

New

Create new worktree for feature branch

Fields

§name: String

Branch name for the new worktree

§path: Option<String>

Custom worktree path (default: ../-)

§base: Option<String>

Base branch to create from (default: from config)

§no_term: bool

Skip AI tool launch

§term: Option<String>

Terminal launch method (e.g., tmux, iterm-tab, zellij)

§bg: bool

Launch AI tool in background

§prompt: Option<String>

Initial prompt to pass to the AI tool (starts interactive session with task)

§

Pr

Create GitHub Pull Request from worktree

Fields

§branch: Option<String>

Branch name (default: current worktree branch)

§title: Option<String>

PR title

§body: Option<String>

PR body

§draft: bool

Create as draft PR

§no_push: bool

Skip pushing to remote

§worktree: bool

Resolve target as worktree name (instead of branch)

§by_branch: bool

Resolve target as branch name (instead of worktree)

§

Merge

Merge feature branch into base branch

Fields

§branch: Option<String>

Branch name (default: current worktree branch)

§interactive: bool

Interactive rebase

§dry_run: bool

Dry run (show what would happen)

§push: bool

Push to remote after merge

§ai_merge: bool

Use AI to resolve merge conflicts

§worktree: bool

Resolve target as worktree name (instead of branch)

§

Resume

Resume AI work in a worktree

Fields

§branch: Option<String>

Branch name to resume (default: current worktree)

§term: Option<String>

Terminal launch method

§bg: bool

Launch AI tool in background

§worktree: bool

Resolve target as worktree name (instead of branch)

§by_branch: bool

Resolve target as branch name (instead of worktree)

§

Shell

Open interactive shell or execute command in a worktree

Fields

§worktree: Option<String>

Worktree branch to shell into

§args: Vec<String>

Command and arguments to execute

§

Status

Show current worktree status

§

Delete

Delete a worktree

Fields

§target: Option<String>

Branch name or path of worktree to delete (default: current worktree)

§keep_branch: bool

Keep the branch (only remove worktree)

§delete_remote: bool

Also delete the remote branch

§force: bool

Force remove even if worktree has changes (default)

§no_force: bool

Don’t use –force flag

§worktree: bool

Resolve target as worktree name (instead of branch)

§branch: bool

Resolve target as branch name (instead of worktree)

§

List

List all worktrees

§

Clean

Batch cleanup of worktrees

Fields

§merged: bool

Delete worktrees for branches already merged to base

§older_than: Option<u64>

Delete worktrees older than duration (e.g., 7, 30d, 2w, 1m)

§interactive: bool

Interactive selection UI

§dry_run: bool

Show what would be deleted without deleting

§

Tree

Display worktree hierarchy as a tree

§

Stats

Show worktree statistics

§

Diff

Compare two branches

Fields

§branch1: String

First branch

§branch2: String

Second branch

§summary: bool

Show statistics only

§files: bool

Show changed files only

§

Sync

Sync worktree with base branch

Fields

§branch: Option<String>

Branch name (default: current worktree)

§all: bool

Sync all worktrees

§fetch_only: bool

Only fetch updates without rebasing

§ai_merge: bool

Use AI to resolve merge conflicts

§worktree: bool

Resolve target as worktree name (instead of branch)

§by_branch: bool

Resolve target as branch name (instead of worktree)

§

ChangeBase

Change base branch for a worktree

Fields

§new_base: String

New base branch

§branch: Option<String>

Branch name (default: current worktree)

§dry_run: bool

Dry run (show what would happen)

§interactive: bool

Interactive rebase

§worktree: bool

Resolve target as worktree name (instead of branch)

§by_branch: bool

Resolve target as branch name (instead of worktree)

§

Config

Configuration management

Fields

§

Backup

Backup and restore worktrees

Fields

§

Stash

Stash management (worktree-aware)

Fields

§

Hook

Manage lifecycle hooks

Fields

§action: HookAction
§

Export

Export worktree configuration to a file

Fields

§output: Option<String>

Output file path

§

Import

Import worktree configuration from a file

Fields

§import_file: String

Path to the configuration file to import

§apply: bool

Apply the imported configuration (default: preview only)

§

Scan

Scan for repositories (global mode)

Fields

§dir: Option<PathBuf>

Base directory to scan (default: home directory)

§

Prune

Clean up stale registry entries (global mode)

§

Doctor

Run diagnostics

§

Upgrade

Check for updates / upgrade

§

SetupClaude

Install Claude Code skill for worktree task delegation

§

ShellSetup

Interactive shell integration setup

§

Path

[Internal] Get worktree path for a branch

Fields

§branch: Option<String>

Branch name

§list_branches: bool

List branch names (for tab completion)

§interactive: bool

Interactive worktree selection

§

ShellFunction

Generate shell function for gw-cd / cw-cd

Fields

§shell: String

Shell type: bash, zsh, fish, or powershell

§

ConfigKeys

List config keys (for tab completion)

§

UpdateCache

Refresh update cache (background process)

§

TermValues

List terminal launch method values (for tab completion)

§

PresetNames

List preset names (for tab completion)

§

HookEvents

List hook event names (for tab completion)

Trait Implementations§

Source§

impl Debug for Commands

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Commands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Commands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more