A script that adds the current Kubernetes context and namespace to your Bash or Zsh prompt.
kube-ps1 is a shell script that displays the current Kubernetes context and namespace in your Bash or Zsh prompt. It helps developers and DevOps engineers avoid mistakes by providing immediate visibility into which cluster and namespace they are targeting with `kubectl` commands. The tool is highly customizable, allowing users to adjust symbols, colors, and formatting to fit their workflow.
Kubernetes administrators, DevOps engineers, and developers who frequently use `kubectl` in Bash or Zsh shells and need clear context awareness to prevent operational errors.
Developers choose kube-ps1 for its simplicity, seamless integration with existing shell setups, and extensive customization options. Unlike manual context checks, it provides constant, at-a-glance visibility, reducing the risk of running commands in the wrong environment.
Kubernetes prompt info for bash and zsh
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Displays the current kubectl context and namespace directly in the prompt, reducing the risk of running commands in the wrong environment. The README emphasizes this provides 'immediate visibility into which cluster and namespace you are operating on.'
Offers numerous variables to customize symbols, colors, and formatting, such as KUBE_PS1_SYMBOL_CUSTOM for glyphs and KUBE_PS1_CTX_COLOR for dynamic hues. The README includes a full table of customization variables with defaults and examples.
Includes kubeon and kubeoff commands to quickly show or hide the prompt, with global and session-level controls. The README details how to use these commands for flexible management.
Available via package managers like Homebrew, as an Oh My Zsh plugin, and has a tmux port (kube-tmux). The README lists installation methods including brew, Oh My Zsh, and source cloning for seamless adoption.
Custom symbols like Kubernetes and OpenShift glyphs require patched fonts such as Nerd Fonts to display correctly, adding an extra installation step. The README explicitly states support for this is 'out of scope' and links to external resources.
Only supports Bash and Zsh shells, leaving out users of Fish, PowerShell, or other shell environments. The README's installation and configuration sections focus solely on Bash and Zsh, with no native alternatives.
Custom functions for cluster shortening or dynamic colors require users to write and manage shell functions, which can be complex. The README shows examples where users must define functions like get_cluster_short for KUBE_PS1_CLUSTER_FUNCTION.