explaingit

spechtlabs/kush

Analysis updated 2026-05-18

2GoAudience · ops devopsComplexity · 2/5LicenseSetup · easy

TLDR

A command-line tool that gives each terminal shell its own isolated, temporary Kubernetes context, so switching clusters in one window can't affect another.

Mindmap

mindmap
  root((repo))
    What it does
      Isolates kube context
      Deletes config on exit
      Keeps auth working
    Tech stack
      Go
      Kubernetes
      kubectl
    Use cases
      Avoid wrong cluster mistakes
      Run scripted commands safely
      Lint kubeconfig files
    Audience
      DevOps engineers
      Kubernetes developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Open an isolated shell pinned to a production Kubernetes context without risking other terminals switching along with it.

USE CASE 2

Run a single kubectl command against a specific cluster from a script or CI job without an interactive shell.

USE CASE 3

Check all discovered kubeconfig files for missing clusters, users, or broken references.

What is it built with?

GoKuberneteskubectl

How does it compare?

spechtlabs/kushanomalroil/1keyanshuman852/dasan-router-cli
Stars222
LanguageGoGoGo
Last pushed2019-05-17
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audienceops devopsops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Unix-only in this version, no Windows or PowerShell support.

Free to use, modify, and distribute for any purpose, including commercial use, as long as you keep the copyright and license notices.

In plain English

kush is a command line tool for people who work with Kubernetes, the system many companies use to run containerized applications across clusters of servers. Normally, switching which cluster or environment kubectl points to means editing a single shared configuration file, and that change affects every terminal window, script, and background tool reading that same file. It is easy to end up accidentally running a command against production because another terminal changed the active context a few minutes earlier. kush solves this by never touching that shared file. Running kush with a context name, such as prod, opens a normal subshell that is pinned to that one context through its own private, temporary configuration file. Any kubectl, helm, or similar tool run inside that shell only sees the pinned context. When you exit the shell, the temporary configuration is deleted automatically, so nothing persists and your main setup is untouched. You can have a prod shell open in one terminal and a dev shell in another at the same time, with no risk of one leaking into the other. Because kush copies the authentication details from your existing configuration exactly as they are, it keeps working with whatever login method you already use, including cloud provider logins and OpenShift. It ships as a single Go binary with no other dependencies, and can be installed through Homebrew, the kubectl plugin manager Krew, Nix, or by building from source. It is unix-only for now, so it does not support Windows. Beyond the basic enter and exit workflow, kush includes commands for re-pinning just the namespace inside an existing shell, running a single command against a context without opening an interactive shell, checking configuration files for common problems, and splitting a shared configuration into separate files per context. Configuration is optional, with sensible defaults, and can include hooks that run commands automatically when entering or leaving a context. This is aimed at developers and operations engineers who regularly switch between multiple Kubernetes clusters and want to avoid running commands against the wrong one by mistake.

Copy-paste prompts

Prompt 1
Help me install kush using Homebrew and open an isolated shell for my prod Kubernetes context.
Prompt 2
Explain how kush's kush exec command works for running a single kubectl command in CI.
Prompt 3
Show me how to configure pre_exec_hook and post_exec_hook in kush's config.yaml.

Frequently asked questions

What is kush?

A command-line tool that gives each terminal shell its own isolated, temporary Kubernetes context, so switching clusters in one window can't affect another.

What language is kush written in?

Mainly Go. The stack also includes Go, Kubernetes, kubectl.

What license does kush use?

Free to use, modify, and distribute for any purpose, including commercial use, as long as you keep the copyright and license notices.

How hard is kush to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is kush for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.