Commands Reference
Complete reference for all KubeGraf CLI commands and flags.
Global Flags
These flags can be used with any command:
| Flag | Short | Description |
|---|---|---|
--kubeconfig | Path to kubeconfig file (default: ~/.kube/config) | |
--context | Kubernetes context to use | |
--namespace | -n | Kubernetes namespace |
--all-namespaces | -A | Show resources from all namespaces |
--help | -h | Show help |
--version | -v | Show version |
Main Commands
kubegraf
Launch the terminal UI (default command).
kubegraf [flags]
| Flag | Description |
|---|---|
--web | Start web dashboard instead of TUI |
--port | Port for web dashboard (default: 8080) |
--theme | UI theme: dark, light, dracula, nord |
kubegraf web
Start the web dashboard.
kubegraf web [flags]
| Flag | Description |
|---|---|
--port | Port to listen on (default: 8080) |
--host | Host to bind to (default: localhost) |
--open | Open browser automatically |
kubegraf contexts
List and manage Kubernetes contexts.
kubegraf contexts [flags]
kubegraf get
Get resources (similar to kubectl get).
kubegraf get <resource> [name] [flags]
Supported resources: pods, deployments, services, ingresses, configmaps, secrets, nodes
kubegraf logs
Stream logs from a pod.
kubegraf logs <pod-name> [flags]
| Flag | Description |
|---|---|
-c, --container | Container name |
-f, --follow | Follow log output |
--tail | Lines of recent logs (default: 100) |
--since | Only logs newer than duration (e.g., 5m) |
kubegraf exec
Execute a command in a container.
kubegraf exec <pod-name> -- <command> [flags]
| Flag | Description |
|---|---|
-c, --container | Container name |
-it | Interactive TTY |
kubegraf port-forward
Forward local ports to a pod.
kubegraf port-forward <pod-name> <local-port>:<pod-port>
kubegraf security
Run security analysis on the cluster.
kubegraf security [flags]
| Flag | Description |
|---|---|
--output | Output format: table, json, yaml |
--severity | Min severity: low, medium, high, critical |
kubegraf map
Generate resource map visualization.
kubegraf map [flags]
| Flag | Description |
|---|---|
--output | Output: browser, png, svg, dot |
--depth | Relationship depth (default: 2) |
Examples
# Launch TUI with specific context
kubegraf --context production
# Start web dashboard on port 3000
kubegraf web --port 3000 --open
# View pods in kube-system namespace
kubegraf -n kube-system
# Follow logs for a pod
kubegraf logs my-pod -f --tail 50
# Shell into a container
kubegraf exec my-pod -it -- /bin/sh
# Run security analysis
kubegraf security --severity high
# Generate resource map
kubegraf map --output browser