Skip to main content

Shell completion

loch completion <shell> prints a completion script. Once loaded, Tab completes commands, flags, container names, namespaces and endpoints.

ShellLoad it
bashsource <(loch completion bash)
zshecho 'source <(loch completion zsh)' >> ~/.zshrc
fishloch completion fish | source
PowerShellloch completion powershell | Out-String | Invoke-Expression

To load it in every bash session, add the line to ~/.bashrc. For fish, save it once:

loch completion fish > ~/.config/fish/completions/loch.fish

Good to know​

  • Container names and namespaces are read from the active endpoint: completion needs a working API key with containers:read.
  • No scope is needed to generate the script.