Install Command Completion

The Confluent CLI and Confluent Cloud CLI support autocompletion for Bash.

Prerequisites

Follow these instructions to install Bash autocompletion.

MacOS

  1. Install Homebrew.

  2. Install Bash completion.

    brew install bash-completion
    
  3. Add bash-completion to your Bash profile (~/.bash_profile). The _completion file is created in the next step.

    Confluent Cloud CLI

    Update your Bash profile for the Confluent Cloud CLI.

    # Add autocompletion for the Confluent Cloud CLI
    . /usr/local/etc/profile.d/bash_completion.sh
    source ~/.ccloud_completion
    
    Confluent CLI

    Update your Bash profile for the Confluent CLI.

    # Add autocompletion for the Confluent CLI
    . /usr/local/etc/profile.d/bash_completion.sh
    source ~/.confluent_completion
    
  4. Run this command to create your CLI completion file.

    Confluent Cloud CLI

    Run this command to install auto completion for the Confluent Cloud CLI.

    ccloud completion bash >> ~/.ccloud_completion
    
    Confluent CLI

    Run this command to install auto completion for the Confluent CLI.

    confluent completion bash >> ~/.confluent_completion
    

You can now autocomplete commands. For example, you can type ccloud service-account or confluent iam, and hit Tab to scroll through the available commands.

Ubuntu/Debian

  1. Install Bash completion.

    sudo apt-get install bash-completion
    
  2. Add bash-completion to your Bash profile (~/.bash_profile). The _completion file is created in the next step.

    Confluent Cloud CLI

    Update your Bash profile for the Confluent Cloud CLI.

    # Add autocompletion for the Confluent Cloud CLI
    . /usr/local/etc/profile.d/bash_completion.sh
    source ~/.ccloud_completion
    
    Confluent CLI

    Update your Bash profile for the Confluent CLI.

    # Add autocompletion for the Confluent CLI
    . /usr/local/etc/profile.d/bash_completion.sh
    source ~/.confluent_completion
    
  3. Run this command to create your CLI completion file.

    Confluent Cloud CLI

    Run this command to install auto completion for the Confluent Cloud CLI.

    ccloud completion bash >> ~/.ccloud_completion
    
    Confluent CLI

    Run this command to install auto completion for the Confluent CLI.

    confluent completion bash >> ~/.confluent_completion
    

You can now autocomplete commands. For example, you can type ccloud service-account or confluent iam, and hit Tab to scroll through the available commands.