🍺 BREW Explorer

← all formulae

kubectx

brew install kubectx v0.11.0 Apache-2.0

Go CLI to quickly switch between kubectl contexts (clusters) and namespaces, with shell isolation and read-only modes.

Why you might care

Speeds up Kubernetes multi-cluster workflows by replacing verbose `kubectl config use-context` with instant context/namespace switching and interactive selection. Includes `kubens` for namespace switching and `-s` / `-r` flags to spawn isolated or read-only shells per context—essential for ops teams managing multiple clusters.

Categories

Alternatives

kubectl kubeconfig kubecm
3.7k
30-day installs · #730
24.0k
90-day · #455
54.8k
365-day · #639
19.8k
★ GitHub stars · updated 1mo ago

Build dependencies

go

GitHub topics

kubectl kubectl-plugins kubernetes kubernetes-clusters

Links

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "kubectl",
    "kubeconfig",
    "kubecm"
  ],
  "build_dependencies": [
    "go"
  ],
  "categories": [
    "kubernetes",
    "shell",
    "terminal-utility"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Tool that can switch between kubectl contexts easily and create aliases",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:41:03+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "kubectx",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-05-15T15:43:00Z",
  "github_readme_excerpt": "# `kubectx` + `kubens`: Power tools for kubectl\n\n![Latest GitHub release](https://img.shields.io/github/release/ahmetb/kubectx.svg)\n![GitHub stars](https://img.shields.io/github/stars/ahmetb/kubectx.svg?label=github%20stars)\n![Homebrew downloads](https://img.shields.io/homebrew/installs/dy/kubectx?label=macOS%20installs)\n[![Go implementation (CI)](https://github.com/ahmetb/kubectx/workflows/Go%20implementation%20(CI)/badge.svg)](https://github.com/ahmetb/kubectx/actions?query=workflow%3A\"Go+implementation+(CI)\")\n\nThis repository provides both `kubectx` and `kubens` tools.\n[Install \u0026rarr;](#installation)\n\n## What are `kubectx` and `kubens`?\n\n**kubectx** is a tool to switch between contexts (clusters) on kubectl\nfaster, and launch readonly shells for each context.\u003cbr/\u003e\n**kubens** is a tool to switch between Kubernetes namespaces (and\nconfigure them for kubectl) easily.\n\nHere\u0027s a **`kubectx`** demo:\n![kubectx demo GIF](img/kubectx-demo.gif)\n\n...and here\u0027s a **`kubens`** demo:\n![kubens demo GIF](img/kubens-demo.gif)\n\n### Usage\n\n#### kubectx\n\nSwitch to another cluster that\u0027s in kubeconfig:\n\n```sh\n$ kubectx minikube\nSwitched to context \"minikube\".\n```\n\nSwitch back to previous cluster:\n\n```sh\n$ kubectx -\nSwitched to context \"oregon\".\n```\n\nStart an isolated shell that only has a single context:\n\n```sh\n$ kubectx -s minikube\n```\n\nStart a read-only shell where write operations are blocked:\n\n```sh\n$ kubectx -r minikube\n```\n\nRename context:\n\n```sh\n$ kubectx dublin=gke_ahmetb_europe-west1-b_dublin\nContext \"gke_ahmetb_europe-west1-b_dublin\" renamed to \"dublin\".\n```\n\n#### kubens\n\nChange the active namespace on kubectl:\n\n```sh\n$ kubens kube-system\nContext \"test\" set.\nActive namespace is \"kube-system\".\n```\n\nGo back to the previous namespace:\n\n```sh\n$ kubens -\nContext \"test\" set.\nActive namespace is \"default\".\n```\n\nChange the active namespace even if it doesn\u0027t exist:\n\n```sh\n$ kubens namespace-404 -f\nContext \"test\" set.\nActive namespace is \"namespace-404\".\n```\n\nIf you have [`fzf`](htt",
  "github_repo": "ahmetb/kubectx",
  "github_stars": 19825,
  "github_topics": [
    "kubectl",
    "kubectl-plugins",
    "kubernetes",
    "kubernetes-clusters"
  ],
  "homepage": "https://github.com/ahmetb/kubectx",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 3677,
  "installs_365d": 54823,
  "installs_90d": 23972,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "Apache-2.0",
  "llm_generated_at": "2026-06-20T23:46:41+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "kubectx",
  "oldnames": [],
  "one_liner": "Go CLI to quickly switch between kubectl contexts (clusters) and namespaces, with shell isolation and read-only modes.",
  "optional_dependencies": [],
  "rank_30d": 730,
  "rank_365d": 639,
  "rank_90d": 455,
  "raw_hash": "dbd8da064e3b3b00",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/k/kubectx.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": "HEAD",
  "version_stable": "0.11.0",
  "versioned_formulae": [],
  "why_use_this": "Speeds up Kubernetes multi-cluster workflows by replacing verbose `kubectl config use-context` with instant context/namespace switching and interactive selection. Includes `kubens` for namespace switching and `-s` / `-r` flags to spawn isolated or read-only shells per context\u2014essential for ops teams managing multiple clusters."
}