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.
aw completion <bash|zsh|fish|powershell>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; documented activation examples use aw.
Examples
Section titled “Examples”# Bashsource <(command aw completion bash)
# Zshsource <(command aw completion zsh)
# Fishcommand aw completion fish | source
# PowerShellaw completion powershell | Out-String | Invoke-ExpressionIn Bash, Zsh, and Fish, use command aw in activation code so completion generation bypasses any installed shell wrapper function. Managed shell integration is not installed in PowerShell, so the normal PowerShell example invokes aw directly. If a user-defined PowerShell alias or function shadows the executable, bypass it explicitly:
& (Get-Command aw -CommandType Application).Source completion powershell | Out-String | Invoke-ExpressionCandidate 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, Fish, and PowerShell 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 in Bash, Zsh, or Fish, confirm
command aw completion <shell>prints a script, source it again, and restart the shell if needed. In PowerShell, run the PowerShell activation example again. - 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.
- In Bash, Zsh, or Fish, if an installed shell wrapper behaves differently from direct invocation, keep
command awin 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.