CLI

CLI Shell Completions

Enable tab completion for kubeadapt in Bash, Zsh, Fish, and PowerShell. Includes persistent setup instructions for each shell.

kubeadapt can generate completion scripts for Bash, Zsh, Fish, and PowerShell. Once installed, pressing Tab completes command names and flags.

Bash

Source the completion script in your current session:

bash
source <(kubeadapt completion bash)

To make it permanent on Linux, write the script to the completions directory:

bash
kubeadapt completion bash > /etc/bash_completion.d/kubeadapt

On macOS with Homebrew:

bash
kubeadapt completion bash > $(brew --prefix)/etc/bash_completion.d/kubeadapt

Then restart your shell or run source ~/.bashrc.

Zsh

Source the completion script in your current session:

bash
source <(kubeadapt completion zsh)

To make it permanent, write the script to a directory on your fpath:

bash
kubeadapt completion zsh > "${fpath[1]}/_kubeadapt"
Note

If you haven't enabled Zsh completions yet, add this to your ~/.zshrc before the fpath line above:

autoload -Uz compinit
compinit

Then restart your shell.

Fish

Source the completion script in your current session:

bash
kubeadapt completion fish | source

To make it permanent, write the script to the Fish completions directory:

bash
kubeadapt completion fish > ~/.config/fish/completions/kubeadapt.fish

Fish picks up completions in that directory automatically on the next shell start.

PowerShell

Source the completion script in your current session:

powershell
kubeadapt completion powershell | Out-String | Invoke-Expression

To make it permanent, add that line to your PowerShell profile ($PROFILE). If the profile file doesn't exist yet, create it first:

powershell
New-Item -ItemType File -Path $PROFILE -Force Add-Content $PROFILE 'kubeadapt completion powershell | Out-String | Invoke-Expression'