atscalectl completion
The completion command generates shell completion scripts for atscalectl, allowing command names, subcommands, and flags to be completed using the Tab key. This improves the interactive CLI experience by avoiding the need to remember full command names and available options.
Usage
atscalectl completion [bash|zsh|fish|powershell]
Bash
To generate completion for the current shell session:
source <(atscalectl completion bash)
To install completion permanently on Linux:
atscalectl completion bash > /etc/bash_completion.d/atscalectl
To install completion permanently on macOS with Homebrew:
atscalectl completion bash > $(brew --prefix)/etc/bash_completion.d/atscalectl
After installing completion permanently, start a new shell session so the generated scripts are loaded.
Zsh
To generate completion for the current shell session:
source <(atscalectl completion zsh)
To install completion permanently:
atscalectl completion zsh > "${fpath[1]}/_atscalectl"
After installing completion permanently, start a new shell session so the generated scripts are loaded.
If completion has never been enabled in your Zsh configuration, enable it first:
echo "autoload -U compinit; compinit" >> ~/.zshrc
Restart the shell after updating the configuration.
Fish
To generate completion for the current shell session:
atscalectl completion fish | source
To install completion permanently:
atscalectl completion fish > ~/.config/fish/completions/atscalectl.fish
After installing completion permanently, start a new shell session so the generated scripts are loaded.
PowerShell
To enable completion for the current PowerShell session:
atscalectl completion powershell | Out-String | Invoke-Expression
To enable completion automatically for future PowerShell sessions, add the command to your PowerShell profile.
Cluster access
Completion scripts are generated locally and do not require Kubernetes access. The completion command does not contact the Kubernetes cluster, or require a kubeconfig file.
Completion usage examples
After enabling completion, commands and flags can be discovered interactively by pressing Tab after typing a partial command/flag name. For example:
atscalectl sta<TAB>
Would complete to:
atscalectl status
Flags are also completed. For example, typing the following:
atscalectl backup --<TAB>
Would output:
--mode
--output-dir
--namespace
--context
Troubleshooting
Completion does not work after installation
Start a new terminal session or reload your shell configuration manually.
For Bash:
source ~/.bashrc
For Zsh:
source ~/.zshrc
For Fish:
source ~/.config/fish/config.fish
Command completion works but flags are missing
Regenerate the completion script using the installed atscalectl binary version and reload your shell configuration.