Getting started¶
Install¶
From source¶
The binary is namedkubeconfig-manager. Link or alias it to kcm for brevity (the install-shell-hook below does this for you).
Pre-built release¶
Grab a tarball from the releases page and drop the kcm binary somewhere on your PATH.
First run¶
With a few kubeconfigs in ~/.kube/:
kcm list # table of files, context counts, tags, alerts
kcm show prod # detail of one file (bare-name lookup + .yaml/.yml fallback)
kcm contexts # contexts inside the default ~/.kube/config
All read-only commands respect --dir <path> to target a different directory.
Install the shell hook¶
kcm use and the TUI print an export KUBECONFIG=... snippet; a shell function captures it.
Supported shells: bash, zsh, pwsh. Restart your shell (or source the rc file) and:
kcm use prod # updates KUBECONFIG in this shell
kcm tui # interactive picker; press `x` to select and export
See shell-integration.md for details on the optional kubectl alias.
Tag something¶
Metadata lives in $XDG_CONFIG_HOME/kubeconfig-manager/config.yaml and is keyed by the SHA-256 of each file's contents, so renames survive. See state-file.md.
Try the guard¶
With alerts enabled on prod, running a destructive verb through kcm kubectl prompts for confirmation:
export KUBECONFIG=~/.kube/prod.yaml
kcm kubectl delete pod mypod # prompts: "Proceed with kubectl delete?"
By default, install-shell-hook also aliases plain kubectl through the guard so alerts fire regardless of whether you type kubectl or kcm kubectl. Pass --no-alias-kubectl to skip this. See guard.md.
Where to go next¶
- Shell integration deep-dive
- State file schema — useful if you want to sync it across machines (content-hash keying makes this safe)
- Import / split / merge — reorganizing kubeconfigs