ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.6k stars 1.26k forks source link

Feature-request: Add sub-command to output completion scripts #320

Open jonaskello opened 3 years ago

jonaskello commented 3 years ago

Most other commands I want completion for has a sub-command to output the completion script. For example kubectl has this so all I need to add in my .zshrc is this:

source <(kubectl completion zsh)

I cannot find this kind of command for kubectx, instead I need a lot of manual steps to set this up and it also becomes hard to setup when using shared dotfiles across machines as it requires copying the completion scripts and making symlinks etc.

ahmetb commented 3 years ago

@jonaskello ideally the package manager you are using to install kubectx should be installing the completion script (it does for Homebrew, for example).

Maybe with Go implementation we can embed such completion files to a hidden subcmd like you described as well, so I'll keep this as a feature request.

anton-ryzhov commented 2 years ago

Duplicate of https://github.com/ahmetb/kubectx/issues/250 ?