Skip to content

Shell autocompletion

Ahoy can tab-complete command names and aliases from your .ahoy.yml in Zsh and Bash.

Install the ahoy-cli/zsh-ahoy plugin. Its README has instructions for Oh My Zsh, Antigen, zinit and manual installs.

Then open a new terminal, type ahoy (with a space) and press Tab.

  1. Install bash-completion:

    Terminal window
    brew install bash-completion
  2. Generate the completion script and load it from your .bashrc:

    Terminal window
    mkdir -p ~/.bash_completion.d
    ahoy --generate-bash-completion > ~/.bash_completion.d/ahoy
    echo '. ~/.bash_completion.d/ahoy' >> ~/.bashrc
  3. Reload your config:

    Terminal window
    source ~/.bashrc

Open a new terminal, type ahoy and press Tab. You should see your commands and their aliases.