completion Command
What It’s For
Section titled “What It’s For”Generate native shell completion for Arashi commands, options, and safe workspace-aware values.
arashi completion <bash|zsh|fish>The command writes a shell script to stdout. Source it from your shell startup file or current session; it does not edit startup files itself.
Generated completion registers both arashi and aw with the same candidates and descriptions; arashi remains the canonical backend and documentation spelling.
Examples
Section titled “Examples”# Bashsource <(command arashi completion bash)
# Zshsource <(command arashi completion zsh)
# Fishcommand arashi completion fish | sourceUse command arashi in activation code so completion generation bypasses any installed arashi wrapper function.
Candidate Behavior
Section titled “Candidate Behavior”Static command and option completion works outside an Arashi workspace. Dynamic completion augments it from local workspace state with repositories, configured groups, worktrees, branches, supported shells, and constrained option values where the current command accepts them.
Dynamic ownership is exact: every --only segment completes configured repositories and every --group segment completes configured groups; switch [filter] and remove [target] complete a branch, worktree name, or path; move --from and move --to complete workspace branch, name, or path references; and --path narrows switch/remove suggestions to exact worktree paths. Supported-shell arguments and explicitly finite options complete only their declared values.
Dynamic lookup is local and read-only, with a 200 ms whole-query budget. It does not perform network requests or mutate workspace state. It does not execute hooks, does not prompt, and does not start child operations. Repeated or comma-separated repository and group selectors complete only the active segment and preserve the prefix already entered.
The canonical completion model retains candidate descriptions for every supported shell. Zsh and Fish can display per-candidate descriptions. Bash retains the canonical descriptions but native Bash programmable completion does not natively display per-candidate descriptions.
Troubleshooting
Section titled “Troubleshooting”- If static suggestions are missing, confirm
command arashi completion <shell>prints a script, source it again, and restart the shell if needed. - Outside a workspace, when local discovery fails, or when the 200 ms whole-query budget expires, completion silently returns no dynamic candidates while static command and option completion keeps working.
- Empty dynamic results do not trigger a network fallback: completion does not perform network requests or mutate workspace state.
- If an installed shell wrapper behaves differently from direct invocation, keep
command arashiin the completion activation line so generation bypasses the wrapper.
Related
Section titled “Related”- shell command for parent-shell switching and managed activation.
- switch command for worktree selection behavior.