A lightweight interactive CLI for switching Kubernetes contexts, namespaces, and GCP projects without memorising kubectl and gcloud commands.
kubectl— required for all operationsgcloud— optional, only needed for--projectand--config
go install github.com/zaikinlv/gk@latestOr build from source:
git clone https://github.com/zaikinlv/gk
cd gk
go install .| Command | Description |
|---|---|
gk |
Interactive context picker (default — same as gk -k) |
gk version |
Print current version |
gk -k / gk --context |
Interactively pick a kubeconfig context |
gk -p / gk --project |
Interactively pick and set the active GCP project |
gk -c / gk --config |
Pick a GCP project and cluster, import credentials into local kubeconfig |
gk -d / gk --clean |
Remove all clusters and contexts from local kubeconfig (except minikube) |
gk -i / gk --info |
Print current context, namespace, GCP project, and kubectl/gcloud versions |
gk -n / gk --pick-namespace |
Interactively pick a namespace for the current context |
gk -N <name> / gk --namespace=<name> |
Set a namespace directly for the current context |