---
title: "Enable shell completion"
url: "https://docs.alisx.com/how-to/cli/enable-shell-completion/"
---
# Enable shell completion

Make your shell complete `alis` commands, subcommands and flags.

## Prerequisites

- The CLI installed and on your PATH.

## Steps

=== "zsh"

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

        ```bash title="Terminal"
        echo "autoload -U compinit; compinit" >> ~/.zshrc
        ```

    2. Install the script for every new session:

        ```bash title="Terminal (macOS)"
        alis completion zsh > $(brew --prefix)/share/zsh/site-functions/_alis
        ```

        ```bash title="Terminal (Linux)"
        alis completion zsh > "${fpath[1]}/_alis"
        ```

    3. Open a new shell. For the current one only: `source <(alis completion zsh)`.

=== "bash"

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

    2. Install the script for every new session:

        ```bash title="Terminal (macOS)"
        alis completion bash > $(brew --prefix)/etc/bash_completion.d/alis
        ```

        ```bash title="Terminal (Linux)"
        alis completion bash > /etc/bash_completion.d/alis
        ```

    3. Open a new shell. For the current one only: `source <(alis completion bash)`.

=== "fish"

    1. Install the script for every new session:

        ```bash title="Terminal"
        alis completion fish > ~/.config/fish/completions/alis.fish
        ```

    2. Open a new shell. For the current one only: `alis completion fish | source`.

=== "PowerShell"

    1. Load completions in the current session:

        ```powershell title="PowerShell"
        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](https://docs.alisx.com/reference/cli/completion.md).
