Important
You are viewing documentation for an older version of Confluent Platform. For the latest, click here.
confluent completion¶
Description¶
Use this command to print the output shell completion code for the specified
shell (Bash/Zsh only). The shell code must be evaluated to provide interactive
completion of confluent
commands.
confluent completion <shell> [flags]
Flags¶
-h, --help Print command information.
Global Flags¶
-v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).
Examples¶
Install Bash completions on macOS:
# Install Bash completions using homebrew
brew install bash-completion
# Enable Bash completions by sourcing them from your bash profile
echo '[[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && . "$(brew --prefix)/etc/profile.d/bash_completion.sh"' >> ~/.bash_profile
# Set the confluent completion code for Bash to a file that's sourced on login
confluent completion bash > $(brew --prefix)/etc/bash_completion.d/confluent
Install Bash completions on Linux:
# Set the confluent completion code for Bash to a file that's sourced on log in
confluent completion bash > /etc/bash_completion.d/confluent
# Load the confluent completion code for Bash into the current shell
source /etc/bash_completion.d/confluent
Add the source command above to your ~/.bashrc
or ~/.profile
to enable completions for new
terminals.
Install Zsh completions:
# Zsh looks for completion functions in the directories listed in the fpath shell variable.
# Put the confluent completion code for zsh into a file in one the fpath directories,
# preferably one of the functions directories. eg:
confluent completion zsh > ${fpath[1]}/_confluent
# Enable zsh completions
autoload -U compinit && compinit
Add the autoload command in your ``~/.zshrc`` to enable completions for new terminals. If
there are 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]}/``.
To update your completion scripts after updating the CLI, run ``confluent completion <bash|zsh>``
again and overwrite the file initially created above.