> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infraudit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up shell tab completion for the infraudit CLI

> Enable tab completion for the infraudit CLI in bash, zsh, fish, or PowerShell with the infraudit completion command and your shell's config file.

The `infraudit` CLI can generate tab-completion scripts for bash, zsh, fish, and PowerShell. Once enabled, pressing Tab completes command names, subcommands, and flags automatically.

## Setup

<Tabs>
  <Tab title="bash">
    Load completion for the current session only:

    ```bash theme={null}
    source <(infraudit completion bash)
    ```

    To enable completion permanently, write the script to your bash completions directory:

    ```bash theme={null}
    infraudit completion bash > /etc/bash_completion.d/infraudit
    ```

    <Note>
      On some systems the completions directory may be `/usr/local/etc/bash_completion.d/` instead. Run `pkg-config --variable=completionsdir bash-completion` to find the correct path.
    </Note>
  </Tab>

  <Tab title="zsh">
    Load completion for the current session only:

    ```bash theme={null}
    source <(infraudit completion zsh)
    ```

    To enable completion permanently, write the completion file to your `fpath`:

    ```bash theme={null}
    infraudit completion zsh > "${fpath[1]}/_infraudit"
    ```

    Then add the following to your `~/.zshrc` if `compinit` is not already called:

    ```bash theme={null}
    autoload -U compinit && compinit
    ```
  </Tab>

  <Tab title="fish">
    Load completion for the current session only:

    ```bash theme={null}
    infraudit completion fish | source
    ```

    To enable completion permanently, write the completion file to your fish completions directory:

    ```bash theme={null}
    infraudit completion fish > ~/.config/fish/completions/infraudit.fish
    ```
  </Tab>

  <Tab title="PowerShell">
    Load completion for the current session:

    ```powershell theme={null}
    infraudit completion powershell | Out-String | Invoke-Expression
    ```

    To enable completion permanently, add the above line to your PowerShell profile (`$PROFILE`).
  </Tab>
</Tabs>

## Applying changes

After writing a permanent completion file, reload your shell configuration or open a new terminal session:

<CodeGroup>
  ```bash bash theme={null}
  source ~/.bashrc
  ```

  ```bash zsh theme={null}
  source ~/.zshrc
  ```
</CodeGroup>

Fish and PowerShell pick up new completion files automatically when you open a new session.
