<!-- WARNING: This documentation is auto-generated from the confluentinc/cli repository and should not be manually edited. -->

<a id="confluent-completion"></a>

# confluent completion

## Description

Use this command to print the shell completion
code for the specified shell (Bash/Zsh only). The shell code must be evaluated to provide
interactive completion of `confluent` commands.

Install Bash completions on macOS:
: 1. Install Homebrew ([https://brew.sh/](https://brew.sh/)).
  2. Install Bash completions using the `brew` command:
     ```none
     brew install bash-completion
     ```
  3. Update your Bash profile:
     ```none
     echo '[[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && . "$(brew --prefix)/etc/profile.d/bash_completion.sh"' >> ~/.bash_profile
     ```
  4. Run the following command to install auto completion:
     ```none
     confluent completion bash > $(brew --prefix)/etc/bash_completion.d/confluent
     ```

Install Bash completions on Linux:
: 1. Install Bash completion:
     ```none
     sudo apt-get install bash-completion
     ```
  2. Set the `confluent completion` code for Bash to a file that’s sourced on login:
     ```none
     confluent completion bash > /etc/bash_completion.d/confluent
     ```
  3. Load the `confluent completion` code for Bash into the current shell:
     ```none
     source /etc/bash_completion.d/confluent
     ```
  4. Add the source command above to your `~/.bashrc` or `~/.bash_profile` to enable completions for new terminals.

Install Zsh completions:
: Zsh looks for completion functions in the directories listed in the `fpath` shell variable.
  <br/>
  1. Put the `confluent completion` code for Zsh into a file in one the `fpath` directories, preferably one of the functions directories. For example:
     ```none
     confluent completion zsh > ${fpath[1]}/_confluent
     ```
  2. Enable Zsh completions:
     ```none
     autoload -U compinit && compinit
     ```
  3. Add the autoload command in your `~/.zshrc` to enable completions for new terminals. If you encounter error messages about insecure files, you can resolve by running the `chown` command to change the `_confluent` file to the same `user:group` as the other files in `${fpath[1]}/`.

```none
confluent completion <bash|zsh> [flags]
```

## Global Flags

```none
-h, --help            Show help for this command.
    --unsafe-trace    Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets.
-v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).
```

## See Also

* [Confluent CLI Command Reference](index.md#confluent-ref) - Confluent CLI.
