Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. ZSH Plugins
  3. kube-ps1

kube-ps1

Apache-2.0Shellv1.0.0

A script that adds the current Kubernetes context and namespace to your Bash or Zsh prompt.

GitHubGitHub
3.8k stars365 forks0 contributors

What is kube-ps1?

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.

Target Audience

Kubernetes administrators, DevOps engineers, and developers who frequently use `kubectl` in Bash or Zsh shells and need clear context awareness to prevent operational errors.

Value Proposition

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.

Overview

Kubernetes prompt info for bash, fish, and zsh

Use Cases

Best For

  • Avoiding accidental commands in the wrong Kubernetes cluster
  • Enhancing terminal productivity for frequent kubectl users
  • Visualizing context switches between multiple Kubernetes environments
  • Color-coding production vs. development clusters in the prompt
  • Integrating Kubernetes awareness into custom shell themes
  • Quickly toggling prompt info on/off during different tasks

Not Ideal For

  • Users of shells other than Bash or Zsh (e.g., Fish, PowerShell)
  • Environments with strict, minimal shell customizations or restricted prompts
  • Teams needing real-time, shared context visibility across multiple users or sessions
  • Those who prefer GUI-based Kubernetes tools or IDE integrations over command-line prompts

Pros & Cons

Pros

Immediate Context Visibility

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.'

Extensive Customization Options

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.

Easy Enable/Disable Toggle

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.

Integration with Shell Ecosystems

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.

Cons

Font Dependency for Glyphs

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.

Limited to Bash and Zsh

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.

Setup Overhead for Advanced Features

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.

Frequently Asked Questions

Quick Stats

Stars3,801
Forks365
Contributors0
Open Issues3
Last commit2 months ago
CreatedSince 2017

Tags

#shell-prompt#devops#productivity#terminal#kubernetes#cli-tool#bash#prompts#kubectl#containers#sre#zsh

Built With

B
Bash
z
zsh

Included in

ZSH Plugins17.6k
Auto-fetched 18 hours ago

Related Projects

zoxidezoxide

A smarter cd command. Supports all major shells.

Stars38,203
Forks853
Last commit4 days ago
zsh-autosuggestionszsh-autosuggestions

Fish-like autosuggestions for zsh

Stars35,900
Forks1,937
Last commit1 year ago
zsh-syntax-highlightingzsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.

Stars22,878
Forks1,376
Last commit5 months ago
autojumpautojump

A cd command that learns - easily navigate directories from the command line

Stars16,952
Forks708
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub