Skip to content

Enable shell completion

Make your shell complete alis commands, subcommands and flags.

Prerequisites

  • The CLI installed and on your PATH.

Steps

  1. If completion is not enabled yet, run once:

    echo "autoload -U compinit; compinit" >> ~/.zshrc
    
  2. Install the script for every new session:

    alis completion zsh > $(brew --prefix)/share/zsh/site-functions/_alis
    
    alis completion zsh > "${fpath[1]}/_alis"
    
  3. Open a new shell. For the current one only: source <(alis completion zsh).

  1. Install the bash-completion package with your OS package manager if it is missing.

  2. Install the script for every new session:

    alis completion bash > $(brew --prefix)/etc/bash_completion.d/alis
    
    alis completion bash > /etc/bash_completion.d/alis
    
  3. Open a new shell. For the current one only: source <(alis completion bash).

  1. Install the script for every new session:

    alis completion fish > ~/.config/fish/completions/alis.fish
    
  2. Open a new shell. For the current one only: alis completion fish | source.

  1. Load completions in the current session:

    alis completion powershell | Out-String | Invoke-Expression
    
  2. For every session, add that line's output to your PowerShell profile.

Add --no-descriptions to any of the commands above to generate a script without flag descriptions.

Related: alis completion.