Skip to main content

Auto-completion

coCLI provides auto-completion functionality for Bash and Zsh, which can save you a lot of typing.

cocli generates Zsh auto-completion script using the cocli completion zsh command. Sourcing this auto-completion script in your Shell will enable cocli auto-completion functionality.

To enable this feature in all Shell sessions, add the following content to your ~/.zshrc file:

source <(cocli completion zsh)

After reloading the Shell, cocli auto-completion will take effect immediately.

If you receive an error like 2: command not found: compdef, add the following content to the beginning of your ~/.zshrc file:

autoload -Uz compinit
compinit