Commands Reference

Complete reference for all KubeGraf CLI commands and flags.

Global Flags

These flags can be used with any command:

FlagShortDescription
--kubeconfigPath to kubeconfig file (default: ~/.kube/config)
--contextKubernetes context to use
--namespace-nKubernetes namespace
--all-namespaces-AShow resources from all namespaces
--help-hShow help
--version-vShow version

Main Commands

kubegraf

Launch the terminal UI (default command).

kubegraf [flags]
FlagDescription
--webStart web dashboard instead of TUI
--portPort for web dashboard (default: 8080)
--themeUI theme: dark, light, dracula, nord

kubegraf web

Start the web dashboard.

kubegraf web [flags]
FlagDescription
--portPort to listen on (default: 8080)
--hostHost to bind to (default: localhost)
--openOpen 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]
FlagDescription
-c, --containerContainer name
-f, --followFollow log output
--tailLines of recent logs (default: 100)
--sinceOnly logs newer than duration (e.g., 5m)

kubegraf exec

Execute a command in a container.

kubegraf exec <pod-name> -- <command> [flags]
FlagDescription
-c, --containerContainer name
-itInteractive 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]
FlagDescription
--outputOutput format: table, json, yaml
--severityMin severity: low, medium, high, critical

kubegraf map

Generate resource map visualization.

kubegraf map [flags]
FlagDescription
--outputOutput: browser, png, svg, dot
--depthRelationship 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