A simple utility to list and activate kubeconfig files.
kset is a hybrid CLI. The Go binary discovers kubeconfig files, matches
filenames, prompts for context choices, and emits shell commands. A
shell wrapper evaluates those commands so KUBECONFIG changes in your current
shell.
Build the binary:
make buildInstall a shell function:
eval "$(./bin/kset --shell-function)"For regular use, add the function output to your shell startup file.
Activate a kubeconfig by filename substring:
kset devList and select from all kubeconfigs:
ksetThe interactive picker shows numbered kubeconfigs, supports type-to-filter with
multiple terms including numbers, and accepts = plus a list number followed by
return.
Activate by list number:
kset 2Use a non-default kubeconfig directory:
kset --config-dir ~/clusters prodUnset KUBECONFIG and return to the default ~/.kube/config behavior:
kset --unsetWhen a selected kubeconfig has multiple contexts, kset prompts for a context
and updates current-context in that kubeconfig file. KUBECONFIG is exported
directly to the selected source file.