Installation
kubectx and kubens are available through multiple package managers and installation methods. Choose the one that works best for your system.Starting with v0.9.0, kubectx and kubens are rewritten in Go. Download the latest binaries from the Releases page.
Kubectl Plugins (Krew)
Install as kubectl plugins using the Krew plugin manager.macOS Installation
Homebrew
The recommended way to install on macOS.Configure shell completion
Homebrew automatically sets up bash/zsh/fish completion scripts. Make sure your shell is configured to load Homebrew completions.
MacPorts
If you use MacPorts:Linux Installation
Debian/Ubuntu (apt)
Optional: Use testing/unstable repos for newer versions
Newer versions may be available in:See the Debian Wiki for information on enabling these repositories.
Arch Linux (pacman)
Available as an official Arch Linux package:Homebrew on Linux
If you use Homebrew on Linux:Windows Installation
Chocolatey
Install using Chocolatey:Scoop
Install using Scoop:winget
Install using winget:Manual Installation (macOS and Linux)
For POSIX environments with Bash installed.Shell Completion Setup
After manual installation, set up completion scripts for your shell:Interactive Mode with fzf
For interactive fuzzy search, install fzf:To opt out of fzf interactive mode, set the environment variable:
KUBECTX_IGNORE_FZF=1Verify Installation
After installation, verify both tools are available:Next Steps
kubectx Usage
Learn how to use kubectx to manage contexts
kubens Usage
Learn how to use kubens to manage namespaces