Skip to content

amplihack completions — Command Reference

Synopsis

amplihack completions <SHELL>

Description

Writes a shell completion script for amplihack to stdout. Pipe the output into your shell's completion directory or source it from your shell init file to enable tab-completion for all amplihack subcommands, flags, and arguments.

Completions are generated at runtime by clap_complete using amplihack's live command definition, so the output always reflects the installed binary's actual flags — including any subcommands added in future releases.

Arguments

Argument Required Values Description
<SHELL> yes bash zsh fish powershell Target shell for completion script generation

Exit Codes

Code Meaning
0 Completion script written to stdout
1 Unrecognised shell name (see --help)

Output

The command writes the completion script to stdout and nothing else. No trailing newline is added beyond what clap_complete generates. Redirect stdout to install permanently; source it to activate for the current session only.

Examples

Bash

Persist completions for all future sessions:

amplihack completions bash > ~/.local/share/bash-completion/completions/amplihack

Or source for the current session only:

source <(amplihack completions bash)

Zsh

Add to a directory on your $fpath:

amplihack completions zsh > ~/.zfunc/_amplihack

Then ensure ~/.zfunc is on $fpath in ~/.zshrc (before compinit):

fpath=(~/.zfunc $fpath)
autoload -U compinit && compinit

Fish

amplihack completions fish > ~/.config/fish/completions/amplihack.fish

Fish auto-sources all files in ~/.config/fish/completions/, so no further steps are needed.

PowerShell

amplihack completions powershell | Out-String | Invoke-Expression

To persist across sessions, append to your profile:

amplihack completions powershell >> $PROFILE

Verification

After installing completions, confirm they are active by typing amplihack and pressing Tab:

$ amplihack <TAB>
RustyClawd          amplifier           claude              codex
completions         copilot             doctor              fleet
index-code          index-scip          install             launch
memory              mode                multitask           new
plugin              query-code          recipe              resolve-bundle-asset
uninstall           update              uvx-help            version

Note: Subcommands with explicit #[command(name = "...")] attributes (e.g. RustyClawd, uvx-help, resolve-bundle-asset) use that exact casing. All others use clap's default kebab-case. This list may grow with future releases — regenerate completions after upgrading.

Pressing Tab after a flag also completes values where they are enumerated:

$ amplihack completions <TAB>
bash  fish  powershell  zsh

Implementation Note

Completions are generated from clap's CommandFactory trait using clap_complete::generate(). The binary name hardcoded into every completion script is amplihack. If you rename the binary, regenerate completions from the renamed copy — the generated scripts embed the literal string amplihack in completion function names and patterns.