khelp(er)
A command-line tool for managing Kubernetes contexts.
Overview
khelp simplifies working with kubeconfig files by providing intuitive commands to list, switch, import, export, and manage Kubernetes contexts.
Installation
From Source
The binary will be available at target/release/khelp.
With Self-Update Feature
Platform Support
- Linux
- macOS
- Windows
Commands
| Command | Description |
|---|---|
list |
List all available contexts (current context marked with *) |
current |
Display details about the active context |
switch [name] |
Switch to a different context (interactive if no name given) |
edit [name] |
Edit a context configuration in your default editor |
export [names...] |
Export one or more contexts to stdout in YAML format |
delete [name] |
Delete a context and its orphaned cluster/user (supports --force) |
cleanup |
Remove orphaned clusters and users not referenced by any context |
rename <old> <new> |
Rename an existing context |
add <file> |
Import contexts from an external kubeconfig file |
completions [shell] |
Generate shell completions (bash, zsh, fish, powershell, elvish) |
update |
Check for and apply updates (requires self_update feature) |
Usage Examples
List all contexts:
Switch to a context interactively:
Switch to a specific context:
Import contexts from another kubeconfig:
Import with automatic rename for conflicts:
Export a context for backup:
Export multiple contexts at once:
Delete a context (automatically removes orphaned cluster/user):
Clean up any orphaned clusters and users:
Install shell completions:
Shell Completions
Generate completions for your shell:
# Bash
# Zsh
# Fish
Or use automatic installation:
License
MIT