switch Command
What It’s For
Move into the right worktree quickly without manually changing directories.
What It Does
- Selects an existing worktree and opens a new terminal context there.
- Supports parent-only, child-repo-only, or combined worktree scopes.
- Uses terminal-aware launch behavior (tmux, VS Code, Cursor, Kiro, and common terminal apps).
Usage
arashi switch [filter] [options]Key Options
--repostarget child repositories in the current workspace only.--alltarget parent workspaces and nested child repo worktrees.--cdrequest parent-shell directory switching for one invocation.--no-cdforce launch behavior for one invocation.--pathtreat the argument as an exact worktree path instead of a fuzzy filter.--seshrun sesh mode in tmux (requires active tmux session andsesh).--vscode,--cursor,--kiroexplicitly open the selected worktree in that IDE for one invocation.--no-default-launchignore configured switch launch defaults for one invocation.
Examples
# Pick from parent workspace worktreesarashi switch
# Match child repos by repository name firstarashi switch --repos docs
# Include parent workspaces plus child repo worktreesarashi switch --all
# Select one exact worktree by full patharashi switch --path /path/to/worktree
# Force the selected worktree to open in Cursorarashi switch --cursor feature-auth
# Change the current shell directory when shell integration is activearashi switch --cd feature-auth
# Use sesh/tmux switching modearashi switch --sesh
# Force launch behavior when switch defaults prefer cdarashi switch --no-cd
# Ignore configured launch defaults for one runarashi switch --no-default-launchNotes
- Default scope is parent repository worktrees only.
- In
--reposmode, filter text matches repository names first:- exact repo match wins
- otherwise a unique partial repo match is selected
- If
--reposhas no repo matches, Arashi prints available child repositories. - Configure default switch mode in
.arashi/config.jsonunderdefaults.switch.mode(launch,cd, orauto). --pathrequires an exact worktree path and skips fuzzy branch/path matching.- Configure default launch mode in
.arashi/config.jsonunderdefaults.switch.launchMode. - Launch precedence is: explicit launch flag, then
--no-default-launch, then configured switch default, then automatic environment detection. mode: "auto"prefers parent-shell switching only when shell integration is active and otherwise keeps launch behavior.- Install shell integration with
arashi shell installor print manual wrapper code witharashi shell init <bash|zsh|fish>. - If
--cdcannot act on the parent shell because the wrapper is inactive, Arashi warns and skips launch fallback for that invocation. - When no explicit IDE flag is provided,
arashi switchprefers Cursor, Kiro, or VS Code automatically when launched from those IDE-integrated terminals and the matching launcher is available. - The VS Code extension passes the matching IDE flag automatically and uses exact-path switching for selected worktrees so duplicate branch names do not cause ambiguous matches.