Skip to content

onggizam/mcc

Repository files navigation

mcc

Go Reference Release Homebrew License: MIT

Manage & switch multiple Kubernetes kubeconfigs with a single command

mcc is a lightweight CLI tool to manage and switch between multiple Kubernetes cluster configs.
It stores kubeconfig files in ~/.kube/multi and switches them into ~/.kube/config when needed.

Features

  • 📂 Organize kubeconfigs — keep multiple cluster configs under ~/.kube/multi
  • 🔄 One-command switch — instantly swap the active cluster
  • 🗑 Clean up easily — remove configs you no longer need
  • 📝 Readable list — view stored clusters, created date, server info, and active flag

Installation

Homebrew (recommended)

brew tap onggizam/mcc
brew install mcc

Build from source

git clone https://github.com/onggizam/mcc.git
cd mcc
bash scripts/build.sh

Usage

First, export your cluster kubeconfig:

cat ~/.kube/config

# or generate from cluster
kubectl get cm kubeadm-config -n kube-system -o yaml > cluster1

Commands & Options

Command Options Description
mcc add -f, --file <path> Source kubeconfig file (default: current ~/.kube/config)
-n, --name <name> Name to store the kubeconfig as (required)
--force Overwrite if the name already exists
mcc ch <name> --backup Switch to the given cluster config; optionally backup the current config
mcc list (none) Show stored kubeconfigs in a table (NO., NAME, CREATED, SERVER, ACTIVE)
mcc delete <name> Remove the stored kubeconfig with the given name
mcc now (none) Show current active cluster info + cluster-wide Pod summary (all namespaces)
mcc rename <old> <new> Rename a stored kubeconfig (use --force to overwrite if exists)
mcc version (none) Print the current version of mcc

Examples

mcc add -f ./myconfig -n cluster1 --force   # Add (overwrite if exists)
mcc ch cluster1 --backup                    # Switch and backup current config
mcc list                                    # Show all stored configs
mcc delete cluster1                         # Delete stored config
mcc now                                     # Show current cluster info and Pods summary
mcc version                                 # Show current version

Check the version:

mcc version

🤝 Contributing

Contributions are welcome!