kubectx is a command-line tool that speeds up switching between Kubernetes clusters and namespaces in kubectl.
The tool solves the friction of managing multiple Kubernetes contexts and namespaces by providing dedicated commands for rapid switching. kubectx lets you change between clusters defined in your kubeconfig file, while kubens handles namespace switching. Both tools support interactive selection via fzf if installed, allowing fuzzy searching through available options. They also provide tab completion for bash, zsh, and fish shells to avoid typing full context or namespace names. Additional features include launching isolated shells scoped to a single context, starting read-only shells that block write operations, and renaming contexts.
Adopt this tool if you regularly work with multiple Kubernetes clusters or frequently switch namespaces within clusters. It suits any workflow involving multi-cluster management, whether for development, testing, or operations. The tool is available across macOS, Linux, and Windows through multiple package managers including Homebrew, apt, pacman, Chocolatey, Scoop, and winget, as well as through Krew as a kubectl plugin.
The project maintains active continuous integration testing for its Go implementation. Development follows a structured release process with binaries published to a releases page. The codebase is written in Go and the project provides shell completion scripts for multiple shells to support different user environments.