Kubie is a powerful CLI tool for managing Kubernetes contexts and namespaces with isolated shell environments and enhanced configuration support.
A more powerful alternative to kubectx and kubens
Kubie is designed for Kubernetes users who need to efficiently switch between multiple contexts and namespaces without interference between shell sessions. It is especially useful for developers, DevOps engineers, and security professionals managing complex Kubernetes environments, enabling seamless context and namespace management, command execution, and configuration linting.
Kubie requires a Kubernetes environment with valid kubeconfig files and optionally Rust tooling for building from source. Users should ensure their shell supports prompt modifications and consider enabling autocompletion scripts for enhanced usability. The isolated shell environments help prevent context leakage but users should be aware of spawned shells when switching contexts or namespaces.
Download the binary for Linux or OS X from the GitHub releases page and run chmod +x on the file
Build from source using Rust's cargo: install Rust from rustup.rs, then run cargo install kubie
Install via Homebrew with brew install kubie
Install via MacPorts with sudo port install kubie
Install via Nix package maintained by @illiusdope
Install on Arch Linux using pacman -S kubie
kubie ctx
Display a selectable menu of Kubernetes contexts
kubie ctx <context>
Switch the current shell to the specified context, spawning a shell if not already in a kubie shell
kubie ctx -
Switch back to the previous Kubernetes context
kubie ctx <context> -r
Spawn a recursive shell in the specified context
kubie ctx <context> -n <namespace>
Spawn a shell in the specified context and namespace
kubie ns
Display a selectable menu of namespaces
kubie ns <namespace>
Switch the current shell to the specified namespace
kubie ns -
Switch back to the previous namespace
kubie ns <namespace> -r
Spawn a recursive shell in the specified namespace
kubie exec <context> <namespace> <cmd> <args>...
Execute a command in the given context and namespace without spawning a shell
kubie exec <wildcard> <namespace> <cmd> <args>...
Execute a command in all contexts matching the wildcard within the given namespace
kubie exec <wildcard> <namespace> -e <cmd> <args>...
Execute a command in all matching contexts and namespace but fail early if any command returns a non-zero exit code
kubie export <context> <namespace>
Print the path to an isolated Kubernetes config file for the specified context and namespace
kubie edit
Display a selectable menu of contexts to edit
kubie edit <context>
Edit the Kubernetes config file containing the specified context