home / containers / kubectx

kubectx

20k

Kubernetes context-switching CLI for listing, selecting, renaming, deleting, and changing the active `kubectl` context.

$brew install kubectx
Language
Go
Stars
19,515
Category
Containers & K8s
Agent
AI Analysis

kubectx is a small Kubernetes workflow CLI for changing the active kubectl context without repetitive kubectl config commands. It also lets you inspect, rename, delete, and unset context entries in kubeconfig.

What It Enables
  • List available kubeconfig contexts and print the current one before running cluster-specific commands.
  • Switch to another context, or jump back to the previous one, by updating the active kubectl context.
  • Rename, delete, or unset context entries when cleaning up kubeconfig state across many clusters.
Agent Fit
  • Useful as a thin shell primitive because the normal commands are short, non-interactive, and return clear success or failure states.
  • Automation fit is limited by plain text output and global kubeconfig mutation, so agents need follow-up kubectl checks to verify state.
  • Optional fzf selection helps humans, but unattended workflows should stick to explicit context names and --current reads.
Caveats
  • It manages kubeconfig context state only; namespace switching lives in the companion kubens command.
  • There is no JSON or dry-run mode, so scripts must parse simple text or inspect kubeconfig separately.