📚 KCSI Cheatsheet

Quick Reference for All Commands

💡 Quick Win: "KCSI reduced my incident response time from 5 minutes to 30 seconds. The TAB autocomplete is muscle memory now." – DevOps Engineer, SaaS Startup
🌐 New in v0.7.0: Multi-Cluster Context Management

Manage multiple Kubernetes clusters without touching your system kubeconfig. Import, switch, and isolate contexts with kcsi context commands. Jump to Context Commands ↓

No commands found matching your search.
đŸ“Ļ Get Commands
kcsi get pods -n <namespace>
List all pods in a namespace with autocompletion
$ kcsi get pods -n kube-system
GET
kcsi get pods -n <ns> -o wide
List pods with extended information (node, IP)
$ kcsi get pods -n production -o wide
GET
kcsi get services -n <namespace>
List services (alias: svc)
$ kcsi get svc -n default
GET
kcsi get deployments -n <ns>
List deployments (alias: deploy)
$ kcsi get deploy -n production
GET
kcsi get nodes
List all cluster nodes (alias: no)
$ kcsi get no -o wide
GET
kcsi get namespaces
List all namespaces (alias: ns)
$ kcsi get ns
GET
kcsi get configmaps -n <ns>
List configmaps (alias: cm)
$ kcsi get cm -n default
GET
kcsi get secrets -n <ns>
List secrets in namespace
$ kcsi get secrets -n kube-system
GET
kcsi get internal-domains
List all internal Kubernetes FQDNs (services and pods)
$ kcsi get internal-domains --all-namespaces
GET
kcsi get idomains -n <ns>
List internal FQDNs in specific namespace
$ kcsi get idom -n production
GET
kcsi get pvc pods
Show PVCs with their associated pods
$ kcsi get pvc pods --all-namespaces
QUERY
kcsi get pvc pods -n <ns>
Show PVCs and pods in specific namespace
$ kcsi get pvc pods -n production
QUERY
kcsi get pvc unbound
Show unbound PVCs (Pending, Lost status)
$ kcsi get pvc unbound --all-namespaces
QUERY
kcsi get pvc unbound -n <ns>
Show unbound PVCs in specific namespace
$ kcsi get pvc unbound -n default
QUERY
🔍 Describe Commands
kcsi describe pod -n <ns> <pod>
Show detailed pod information with cascading autocomplete
$ kcsi describe pod -n default my-app
DESCRIBE
kcsi describe pod -n <ns> <pod> -c <ctr>
Describe specific container in pod
$ kcsi describe pod -n default app -c sidecar
DESCRIBE
kcsi describe service -n <ns> <svc>
Show detailed service information
$ kcsi describe svc -n default api-service
DESCRIBE
kcsi describe deployment -n <ns> <deploy>
Show detailed deployment information
$ kcsi describe deploy -n prod backend
DESCRIBE
kcsi describe node <node-name>
Show detailed node information
$ kcsi describe node worker-1
DESCRIBE
📋 Logs Commands
kcsi logs -n <ns> <pod>
View pod logs with autocompletion
$ kcsi logs -n default my-app
LOGS
kcsi logs -f -n <ns> <pod>
Follow pod logs in real-time
$ kcsi logs -f -n production api-server
LOGS
kcsi logs --tail <N> -n <ns> <pod>
Show last N lines of logs
$ kcsi logs --tail 100 -n default my-app
LOGS
kcsi logs -n <ns> <pod> -c <container>
View logs from specific container (with autocomplete)
$ kcsi logs -n default my-app -c sidecar
LOGS
kcsi logs -p -n <ns> <pod>
View previous container logs (after crash)
$ kcsi logs -p -n production crashed-pod
LOGS
đŸ—‘ī¸ Delete Commands (with Safety)
kcsi delete pod -n <ns> <pod>
Delete pod with confirmation prompt
$ kcsi delete pod -n default old-pod
DELETE
kcsi delete pod -n <ns> <pod> --force
Delete pod without confirmation (automation)
$ kcsi delete pod -n test test-pod -f
DELETE
kcsi delete service -n <ns> <svc>
Delete service with confirmation
$ kcsi delete svc -n default old-service
DELETE
kcsi delete deployment -n <ns> <deploy>
Delete deployment with confirmation
$ kcsi delete deploy -n staging old-app
DELETE
đŸ–Ĩī¸ Interactive Pod Commands
kcsi attach -n <ns> <pod>
Attach interactive shell to pod (auto-detects bash/zsh/sh)
$ kcsi attach -n production api-server
EXEC
kcsi attach -n <ns> <pod> -c <container>
Attach to specific container with autocompletion
$ kcsi attach -n default my-app -c sidecar
EXEC
kcsi execute -n <ns> <pod> -- <cmd>
Execute custom command in pod
$ kcsi execute -n prod api-pod -- ls -la /app
EXEC
kcsi execute -n <ns> <pod> -c <ctr> -- <cmd>
Execute command in specific container
$ kcsi execute -n default app -c sidecar -- env
EXEC
kcsi port-forward -n <ns> <pod> <local>:<remote>
Forward local port to pod (validates privileges and availability)
$ kcsi port-forward -n prod api 8080:80
EXEC
kcsi debug <ns> <pod>
Attach debug container with tools (auto-detects connectivity)
$ kcsi debug prod api-server
EXEC
kcsi debug <ns> <pod> -i <image>
Attach debug container with specific image
$ kcsi debug prod api -i nicolaka/netshoot
EXEC
kcsi debug <ns> <pod> -c <container>
Debug specific container in multi-container pod
$ kcsi debug prod app -c sidecar
EXEC
📊 Resource Usage & Debugging
kcsi top pods
Show CPU and memory usage for all pods
$ kcsi top pods --all-namespaces
QUERY
kcsi top pods -n <ns>
Show resource usage for pods in namespace
$ kcsi top pods -n production
QUERY
kcsi top nodes
Show CPU and memory usage for all nodes
$ kcsi top nodes
QUERY
kcsi top nodes <node>
Show resource usage for specific node
$ kcsi top nodes worker-1
QUERY
kcsi dig <ns> <pod> <domain>
DNS debugging inside pod (auto-fallback: dig → nslookup → host)
$ kcsi dig prod api kubernetes.default.svc
EXEC
kcsi dig <ns> <pod> <domain> -c <ctr>
DNS debugging in specific container
$ kcsi dig prod app dns.google -c sidecar
EXEC
🔧 Diagnostics & Monitoring
kcsi events
View cluster events sorted by timestamp
$ kcsi events
DIAGNOSTIC
kcsi events -n <ns> -w
Watch events in namespace in real-time
$ kcsi events -n production -w
DIAGNOSTIC
kcsi check errors
Find all pods with issues (not Running/Completed)
$ kcsi check err
DIAGNOSTIC
🌐 Multi-Cluster Context Management
kcsi context import <name> <kubeconfig>
Import kubeconfig and manage it in ~/.kcsi/contexts/
$ kcsi context import prod ~/prod.yaml -d "Production"
CONTEXT
kcsi context add <name> <kubeconfig>
Add reference to existing kubeconfig without copying
$ kcsi context add dev ~/.kube/dev-config
CONTEXT
kcsi context list
List all contexts with current marker (alias: ls)
$ kcsi context ls
CONTEXT
kcsi context use <name>
Switch to different cluster context
$ kcsi context use staging
CONTEXT
kcsi context current
Display currently active context
$ kcsi context current
CONTEXT
kcsi context remove <name>
Remove context and delete imported files (aliases: rm, delete)
$ kcsi context rm old-cluster
CONTEXT
â„šī¸ Project Information
kcsi --version
Show version and author
$ kcsi --version
kcsi --version-detailed
Show detailed version info (Go version, OS/Arch)
$ kcsi --version-detailed
kcsi about
Show project information and philosophy
$ kcsi about
kcsi completion bash
Generate completion script (bash/zsh/fish)
$ source <(kcsi completion bash)