Skip to content

Shell Autocompletion

Ahoy supports tab completion in both Zsh and Bash, completing command names and aliases from your .ahoy.yml.

There’s a dedicated plugin at ahoy-cli/zsh-ahoy that works with all major Zsh plugin managers.

  1. Visit the ahoy-cli/zsh-ahoy repository and follow the installation instructions for your plugin manager (Oh My Zsh, Antigen, zinit, or manual).
  2. Reload your shell or open a new terminal.
  3. Type ahoy (with a space) and press Tab - you should see your commands listed.

Step 1: Make sure bash-completion is installed:

Terminal window
brew install bash-completion

Step 2: Generate the completion script and install it:

Terminal window
mkdir -p ~/.bash_completion.d
ahoy --generate-bash-completion > ~/.bash_completion.d/ahoy
echo '. ~/.bash_completion.d/ahoy' >> ~/.bashrc

Step 3: Reload your configuration:

Terminal window
source ~/.bashrc

Open a new terminal, type ahoy and press Tab. You should see a list of your available commands. Aliases are completed alongside primary command names.