Skip to main content
To enable tab completion, run the following command:
where <shell> is one of bash, zsh or fish.
If you get permission denied error, you can try running the following command:
The commands above will output the completion script to the specified path. Which will look something like this:
The correct method of installing a completion script can depend on both your shell and your configuration.

Installation

Completions typically will be installed automatically by your shell’s package manager and the script will try to install them.

Zsh

This example shows how to enable tab completion for zsh, it assumes you are using oh-my-zsh.
Your completion script must have the name in the format of _ followed by the name of the application.
Without oh-my-zsh, you will need to add a path for completion scripts to your function path, and turn on completion script autoloading. First, add these lines to ~/.zshrc:
Next, create a directory at ~/.zsh/completion and copy the completion script to the new directory.

Bash

If you have bash-completion installed, you can just copy your new completion script to the /usr/local/etc/bash_completion.d or /usr/share/bash-completion/completions directory using the following command:
Without bash-completion, you will need to source the completion script directly. Copy it to a directory such as ~/.bash_completions/, and then add the following line to ~/.bash_profile or ~/.bashrc:

Fish

To enable tab completion for fish, copy the completion script to the ~/.config/fish/completions or /usr/share/fish/completions directory using the following command: