This document provides a comprehensive command reference for the KDM (Kubernetes Docker Monitor) CLI, detailing every command group, subcommand, option flag, and usage example.
These options apply when invoking the main kdm executable:
| Flag | Description |
|---|---|
-v, --version |
Output the current version of KDM CLI |
-h, --help |
Display general help and command listings |
Retrieve and display workload resources or cluster metadata in clean, formatted tables.
kdm show runnersDisplays a combined table of all active Kubernetes pods and Docker containers.kdm show podsDisplays only Kubernetes pods.kdm show containersDisplays only Docker containers.kdm show nodesDisplays details of Kubernetes cluster nodes.kdm show minikubeChecks and prints local Minikube profile and connection status.
kdm show runners
kdm show pods
kdm show minikubeChecks the health of workloads and outputs color-coded logs and details.
-w, --watch: Run in watch mode to continuously refresh the terminal output.-i, --interval <seconds>: Refresh interval in seconds (default:5).
kdm health allUnified health check of both containers and pods.kdm health podsHealth checks for pods only.kdm health containersHealth checks for Docker containers only.
kdm health all
kdm health pods -w # Continuous watch mode (5s refresh)
kdm health containers -w -i 2 # Continuous watch mode (2s refresh)Launches the interactive real-time terminal user interface (TUI) dashboard. Refreshes status and metrics automatically (Ctrl+C to exit).
kdm watchRetrieves logs from a workload. KDM attempts a Docker container prefix match first, falling back to Kubernetes pods if no matching container is found.
<name>: The container name/ID prefix or the Kubernetes pod name.
kdm logs auth-apiScans Kubernetes resources for configuration errors and operational problems. Supports AI-powered troubleshooting explanations.
-n, --namespace <namespace>: Limit check to a specific Kubernetes namespace.-L, --selector <selector>: Limit check to resources matching a label selector.-f, --filter <filter>: Run a specific analyzer only (e.g.Pod,Ingress,Deployment). Can be specified multiple times.-o, --output <format>: Output format choice:text(default) orjson.-m, --max-concurrency <num>: Max concurrency count for analyzers (default:10).-s, --with-stat: Print execution diagnostics statistics.--with-doc: Retrieve Kubernetes documentation lookups for detected problems.-e, --explain: Request AI-powered diagnosis explanations.-b, --backend <backend>: Force a specific AI backend provider to query.-l, --language <lang>: Request AI response in a target language (default:english).-a, --anonymize: Mask resource names and identifiers in prompt payload to protect privacy.-c, --no-cache: Skip looking up or saving to the local AI cache.--kubeconfig <path>: Specify an alternative kubeconfig file path.--kubecontext <context>: Specify target Kubernetes context.
kdm analyze
kdm analyze -n default --explain
kdm analyze --explain --backend ollama --language spanish
kdm analyze -o json --anonymizeManage credentials, models, and endpoints for AI backend providers. KDM supports 10+ AI providers (OpenAI, Anthropic, Gemini, Vertex AI, WatsonX, OCI GenAI, Cohere, Bedrock, Groq, HuggingFace, etc.).
-
kdm auth addRegister credentials for a provider.- Options:
-b, --backend <backend>: Target backend name (e.g.openai,ollama,anthropic,google-gemini,google-vertex, etc.).-m, --model <model>: Target model name (e.g.gpt-4o,claude-3-5-sonnet-latest).-p, --password <password>: API Key or password credential.-u, --baseurl <baseurl>: Custom API base URL.-t, --temperature <value>: Model generation temperature.--topp <value>: Top-P sampling threshold.--topk <value>: Top-K sampling threshold.--maxtokens <value>: Max tokens limit.--custom-header <Header=Value>: Add custom HTTP request header. Can be specified multiple times.
- Options:
-
kdm auth listLists all configured providers and their parameters (API keys are safely masked). -
kdm auth default <backend>Sets the active default AI provider. -
kdm auth remove <backend>Removes configured settings for a provider. -
kdm auth update <backend>Updates settings on an already registered provider (supports the same options asadd).
kdm auth add -b openai -m gpt-4o -p sk-...
kdm auth add -b ollama -m llama3.1
kdm auth default ollama
kdm auth update ollama -t 0.2
kdm auth listManage locally cached AI explanations to save tokens and avoid duplicate network requests.
kdm cache listLists all cached explanation keys.kdm cache get <key>Retrieves and prints cached markdown explanation for a key.kdm cache remove <key>Deletes a specific cache entry.kdm cache purgeDeletes all locally cached explanations.
kdm cache list
kdm cache purgeConfigure default active analyzers to filter what kdm analyze checks.
kdm filters listLists all active default analyzers and available inactive ones.kdm filters add <name>Adds an analyzer (e.g.Ingress,CronJob) to default active check list.kdm filters remove <name>Removes an analyzer from the active list.
kdm filters list
kdm filters add IngressRegister custom shell commands or HTTP webhooks to analyze arbitrary custom resources (CRDs).
-
kdm custom-analyzer add <name>Register a new analyzer. Requires either--commandor--url.- Options:
--command <cmd>: External CLI command to execute.--url <url>: HTTP endpoint URL to call.
- Options:
-
kdm custom-analyzer listLists all registered custom analyzers. -
kdm custom-analyzer remove <name>Deletes a registered custom analyzer.
kdm custom-analyzer add keda --command "kubectl get scaledobjects -A -o json"
kdm custom-analyzer list
kdm custom-analyzer remove kedaStarts the KDM server daemon in either REST API mode or JSON-RPC Model Context Protocol (MCP) mode.
-p, --port <port>: HTTP server port (default:8080).--metrics-port <port>: Metrics server port.-b, --backend <backend>: Default active AI backend provider.-f, --filter <filter>: Default analyzer filter limit.--http: Force HTTP mode (default).--mcp: Start in MCP mode (JSON-RPC stdio).
kdm serve --port 8080 # Starts HTTP REST API on http://localhost:8080
kdm serve --mcp # Starts JSON-RPC MCP server over stdioInteractively set up alerting notifications or directly update config properties.
kdm config setupLaunches interactive CLI wizard to configure alerting notifications (Discord Webhook, Email SMTP settings).kdm config listLists all general configurations.kdm config set <key> <value>Manually sets a config parameter.kdm config clearResets all configurations to default.
kdm config setup
kdm config set alert_cooldown 600
kdm config list