kubectx
kubectx is a command-line utility that simplifies switching between Kubernetes contexts. It functions as a lightweight wrapper around kubectl config use-context, reading the contexts defined in the kubeconfig file (typically at ~/.kube/config) and enabling rapid changes to the active context. When used with an interactive fuzzy finder such as fzf, kubectx presents a searchable list of contexts; if fzf is not installed, it accepts a context name as an argument and switches accordingly. The tool is commonly used alongside kubens, which provides a parallel mechanism for changing the active namespace within the current context.
Key features include quick context switching, optional interactive selection, and straightforward usage without altering kubectl itself.
Installation typically involves obtaining the kubectx pair of scripts (kubectx and kubens) from the project repository
Usage examples include: kubectx my-context to switch directly to a named context; kubectx to trigger interactive