This guide describes how you can enable command autocompletion for the STACKIT CLI by leveraging the functionality provided the Cobra framework.
The process may vary depending on the type of shell you are using and your operating system (OS).
You will need to start a new shell for the setup to take effect.
This process depends on the bash-completion package. If you don't have it installed already, you can install it via your OS's package manager.
stackit completion bash > ~/.bash_completionstackit completion bash > $(brew --prefix)/etc/bash_completion.d/stackitIf shell completion is not already enabled in your environment you will need to enable it by executing the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrcstackit completion zsh > "${fpath[1]}/_stackit"stackit completion zsh > $(brew --prefix)/share/zsh/site-functions/_stackitAdditionally, you might also need to run:
source $(brew --prefix)/share/zsh/site-functions/_stackit >> ~/.zshrcYou can load completions for your current shell session by running:
stackit completion powershell | Out-String | Invoke-ExpressionTo load completions for every new session, add the output of the above command to your PowerShell profile.
stackit completion fish > ~/.config/fish/completions/stackit.fish