Shell completion

View .md

kanject completion <SHELL> writes a completion script for the registered command tree, including loaded providers, nested subcommands, and visible option aliases. It does not edit your shell profile.

Bash

bash
# Enable for this sessionsource <(kanject completion bash)​# Or save it, then source it from ~/.bashrckanject completion bash > ~/.kanject-completion.bashsource ~/.kanject-completion.bash

Zsh

bash
autoload -Uz compinitcompinitsource <(kanject completion zsh)​# For new sessions, save and source after completion initialization in ~/.zshrckanject completion zsh > ~/.kanject-completion.zshsource ~/.kanject-completion.zsh

Initialize compinit before sourcing the script; most Zsh frameworks already do this.

PowerShell 7+

powershell
kanject completion powershell | Set-Content "$HOME/kanject-completion.ps1". "$HOME/kanject-completion.ps1"​# Add the dot-source line above to $PROFILE for new sessions

pwsh is an alias for the powershell shell selector. Unsupported shells fail with KANCLI663 and a supported-shell hint.

What completion knows

Try kanject aws de<Tab> or kanject aws deploy --bu<Tab>. Completion follows the command path and understands option values, including quoted paths. Required values use the shell’s normal file-completion fallback. Stage names, entry IDs, AWS resource names, and template aliases are not dynamically queried or suggested.

Tab completion runs no CLI process and makes no network call. Saved scripts reflect the command tree at generation time: regenerate them after updating Kanject or adding/removing a provider.

Related: Command Map · Installation.

Was this page helpful?