A powerful CLI wrapper that makes Kubernetes commands much easier ⚡
kubectl commands are verbose. kctl lets you skip the boilerplate:
# Before (kubectl)
kubectl get pods -n staging | grep myapp
kubectl logs -f $(kubectl get pods -n staging -o=name | grep myapp | head -1) -n staging
kubectl exec -it $(kubectl get pods -n staging --no-headers -o custom-columns=:metadata.name | grep myapp | head -1) -n staging -- sh
kubectl rollout restart deployment/myapp -n staging
kubectl config use-context production
# After (kctl)
kctl pod myapp -n staging
kctl log myapp -n staging
kctl exec myapp -n staging
kctl restart myapp -n staging
kctl ctx production| Command | Description | Example |
|---|---|---|
pod |
List pods (optionally filter by app) | kctl pod myapp |
svc |
List services | kctl svc myapp |
deploy |
List deployments | kctl deploy myapp |
log |
Stream logs from a pod | kctl log myapp |
exec |
Shell into a pod | kctl exec myapp |
forward |
Port-forward to a pod | kctl forward myapp 8080:80 |
describe |
Describe a pod | kctl describe myapp |
delete |
Delete a matching pod | kctl delete myapp |
restart |
Rollout restart a deployment | kctl restart myapp |
scale |
Scale a deployment | kctl scale myapp 3 |
ctx |
List or switch contexts | kctl ctx production |
top |
Show pod resource usage | kctl top myapp |
events |
Show events (sorted by time) | kctl events myapp |
ing |
List ingress resources | kctl ing myapp |
cm |
List configmaps | kctl cm myapp |
secret |
List secrets | kctl secret myapp |
set-namespace |
Persist default namespace | kctl set-namespace -n staging |
| Flag | Description |
|---|---|
-n, --namespace <ns> |
Target namespace (default: default) |
-h, --help |
Show help |
-V, --version |
Show version |
brew tap alaminopu/kctl https://github.com/alaminopu/kctl.git
brew install kctlPrerequisites: Rust & Cargo
curl https://sh.rustup.rs -sSf | sh # Install Rust (if needed)
cargo build --release # Build
chmod a+x target/release/kctl # Make executable
mv target/release/kctl /usr/local/bin/ # Install to PATH- Fork the repo
- Create an issue in the issue section
- Write code and commit changes
- Send a PR to the
masterbranch
See the full list of contributors.
This project is licensed under the MIT License — see LICENSE.md for details.
