kube-ps1
brew install kube-ps1
v1.0.0
Apache-2.0
Kubernetes prompt info for bash and zsh
954
30-day installs · #1327
2.4k
90-day · #1486
6.6k
365-day · #1726
3.8k
★ GitHub stars · updated 2mo ago
Runtime dependencies
GitHub topics
bash
containers
kubectl
kubernetes
kubernetes-helper
prompts
sre
zsh
Links
- https://github.com/jonmosco/kube-ps1
- GitHub: jonmosco/kube-ps1
- Brew formula source: Formula/k/kube-ps1.rb
Caveats
Make sure kube-ps1 is loaded from your ~/.zshrc and/or ~/.bashrc: source "$HOMEBREW_PREFIX/opt/kube-ps1/share/kube-ps1.sh" PS1='$(kube_ps1)'$PS1
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [],
"categories": [],
"caveats": "Make sure kube-ps1 is loaded from your ~/.zshrc and/or ~/.bashrc:\n source \"$HOMEBREW_PREFIX/opt/kube-ps1/share/kube-ps1.sh\"\n PS1=\u0027$(kube_ps1)\u0027$PS1\n",
"conflicts_with": [],
"dependencies": [
"kubernetes-cli"
],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Kubernetes prompt info for bash and zsh",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:41:26+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "kube-ps1",
"github_default_branch": "master",
"github_last_commit_at": "2026-05-24T12:10:07Z",
"github_readme_excerpt": "# kube-ps1: Kubernetes prompt for bash, zsh, and fish\n\n\n[](https://github.com/jonmosco/kube-ps1/actions/workflows/ci.yml)\n\nA script that lets you add the current Kubernetes context and namespace configured on `kubectl` to your Bash, Zsh, or Fish prompt.\n\nInspired by several tools used to simplify usage of `kubectl`.\n\n\n\n## Installing\n\n### Packages\n\n### MacOS Brew Ports\n\nHomebrew package manager:\n\n```sh\nbrew update\nbrew install kube-ps1\n```\n\n### Arch Linux\n\nAUR Package available at [https://aur.archlinux.org/packages/kube-ps1/](https://aur.archlinux.org/packages/kube-ps1/).\n\n### Oh My Zsh\n\nhttps://github.com/ohmyzsh/ohmyzsh\n\nkube-ps1 is included as a plugin in the oh-my-zsh project. To enable it, edit your `~/.zshrc` and\nadd the plugin:\n\n```bash\nplugins=(\n kube-ps1\n)\nPROMPT=\u0027$(kube_ps1)\u0027$PROMPT # or RPROMPT=\u0027$(kube_ps1)\u0027\n```\n\n## Zsh zinit plugin\n\n### Using [zinit](https://github.com/zdharma-continuum/zinit)\n\nUpdate `.zshrc` with:\n\n```sh\nzinit light jonmosco/kube-ps1\nPROMPT=\u0027$(kube_ps1)\u0027$PROMPT # or RPROMPT=\u0027$(kube_ps1)\u0027\n```\n\n### Fig\n\nInstall `kube-ps1` in zsh, bash, or fish with one click.\n\n\u003ca href=\"https://fig.io/plugins/other/kube-ps1\" target=\"_blank\"\u003e\u003cimg src=\"https://fig.io/badges/install-with-fig.svg\" width=\"120\" /\u003e\u003c/a\u003e\n\n### From Source (git clone)\n\n1. Clone this repository\n2. Source the kube-ps1.sh in your `~/.zshrc` or your `~/.bashrc`\n\n#### Zsh\n\n```sh\nsource /path/to/kube-ps1.sh\nPROMPT=\u0027$(kube_ps1)\u0027$PROMPT # or RPROMPT=\u0027$(kube_ps1)\u0027\n```\n\n#### Bash\n\n```sh\nsource /path/to/kube-ps1.sh\nPS1=\u0027[\\u@\\h \\W $(kube_ps1)]\\$ \u0027\n```\n\n#### Fish\n\nAdd this to `~/.config/fish/config.fish`:\n\n```fish\nsource /path/to/kube-ps1.fish\n\nfunction fish_prompt\n echo -n (kube_ps1) \u0027 \u0027\n # your existing prompt here\nend\n```\n\n\u003e Note: Fish users should source `kube-ps1.fish` instead of `kube-ps1.sh`.\n",
"github_repo": "jonmosco/kube-ps1",
"github_stars": 3794,
"github_topics": [
"bash",
"containers",
"kubectl",
"kubernetes",
"kubernetes-helper",
"prompts",
"sre",
"zsh"
],
"homepage": "https://github.com/jonmosco/kube-ps1",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 954,
"installs_365d": 6554,
"installs_90d": 2368,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "Apache-2.0",
"llm_generated_at": null,
"llm_model": null,
"name": "kube-ps1",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 1327,
"rank_365d": 1726,
"rank_90d": 1486,
"raw_hash": "0b6b3c16642d944b",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/k/kube-ps1.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [
{
"zsh": "test"
}
],
"version_head": "HEAD",
"version_stable": "1.0.0",
"versioned_formulae": [],
"why_use_this": null
}