kedify is a command-line interface for working with the Kedify API from your terminal.
The CLI currently focuses on authentication, cluster inspection, and applying recommendation data to Helm values files.
kedify auth loginReads a Kedify API token and stores it in the OS credential store when available, with a file fallback.kedify auth tokenPrints the current auth token to stdout.- Interactive hidden token entry
When run in a terminal,
auth loginuses a Bubble Tea prompt and keeps the token hidden. - Piped token input
You can also provide a token via
stdin. - CI-friendly token injection
Commands can also use
--tokenorKEDIFY_TOKENinstead of the stored credentials file. kedify list clustersCalls the Kedify API and transparently reads all pages before printing the final cluster list.kedify get cluster [name-or-id]Prints one cluster by name or id, and shows an interactive picker when no name is provided.kedify delete cluster [name-or-id]Deletes one cluster by name or id, and shows an interactive picker when no name is provided.kedify list recommendations <cluster-id>Prints the recommendations payload for a cluster id.kedify apply recommendations <kind/name>Applies recommendations from a saved JSON or YAML file to a Helm values file and can emitjson,diff, oroverrideoutput.kedify metricsOpens an interactive Prometheus metric explorer, builds and validates a PromQL query, previews it as an ASCII graph, and generates YAML for aScaledObject, aMetricPredictor, or both. Creating the resources in Kubernetes is an explicit opt-in.- Output formatting
kedify list clusters,kedify get cluster, andkedify list recommendationssupport-oand--outputwithtext,json, oryaml.textis the default.kedify delete clusterprints its confirmation message tostderrand keepsstdoutempty for shell-friendly usage.
Build the CLI locally with:
make buildThe binary will be available at ./bin/kedify.
- Go toolchain version from
go.mod makekubectlwhen using Prometheus discovery, port-forwarding, or resource creation
Generate a Kedify API token at:
https://dashboard.dev.kedify.io/api-keys
The CLI stores credentials in:
OS credential store when available
~/.config/kedify/credentials.json as fallback
Interactive login:
./bin/kedify auth loginLogin with a global token flag:
./bin/kedify --token "$KEDIFY_TOKEN" auth loginLogin with a positional token argument:
./bin/kedify auth login "$KEDIFY_TOKEN"Print the current token:
./bin/kedify auth tokenPiped login:
printf '%s\n' "$KEDIFY_TOKEN" | ./bin/kedify auth loginShow help:
./bin/kedify --helpList clusters in the default human-readable text format:
./bin/kedify list clustersList clusters as YAML:
./bin/kedify list clusters -o yamlGet a cluster by name:
./bin/kedify get cluster my-clusterGet a cluster as JSON:
./bin/kedify get cluster my-cluster -o jsonDelete a cluster by name:
./bin/kedify delete cluster my-clusterDelete a cluster by UUID:
./bin/kedify delete cluster fc6af0dc-685b-4055-805d-0d3e0ead1596List recommendations for a cluster as JSON:
./bin/kedify list recommendations fc6af0dc-685b-4055-805d-0d3e0ead1596 -o jsonApply recommendations to a Helm values file and print the patch plan as JSON:
./bin/kedify apply recommendations deployment/my-app \
--namespace my-namespace \
--chart-path ./chart \
--values-file ./chart/values.yaml \
--recommendations-file ./recommendations.json \
--resources cpu-requests,memory-limits \
--format json \
--dry-runApply recommendations and write an override file:
./bin/kedify apply recommendations deployment/my-app \
--namespace my-namespace \
--chart-path ./chart \
--values-file ./chart/values.yaml \
--recommendations-file ./recommendations.json \
--resources cpu-requests,memory-limits \
--format override \
--output-file ./override-values.yamlExplore metrics using Kubernetes service discovery:
./bin/kedify metricsConnect directly to Prometheus and generate manifests for a specific namespace:
./bin/kedify metrics \
--server=http://localhost:9090 \
--namespace=my-appPreselect parts of the interactive flow:
# Discover Prometheus, use the first matching service, and port-forward it.
./bin/kedify metrics --disco --filter=memory_
# Use a specific kubectl context and kubeconfig for discovery and port-forwarding.
./bin/kedify metrics \
--disco \
--context=staging \
--kubeconfig=./config/staging.kubeconfig
# Validate this query, select a horizon, and visualize it.
./bin/kedify metrics \
--server=http://localhost:9090 \
--query='sum(foobar)' \
--visualize
# Skip both choices and immediately load the 3-day graph.
./bin/kedify metrics \
--server=http://localhost:9090 \
--query='sum(foobar)' \
--visualize \
--horizon=3d \
--print--server and --disco are mutually exclusive. --visualize requires --query, and --horizon requires --visualize. Supported horizon values are 6h, 1d, 3d, 1w, and 30d. --context and --kubeconfig are forwarded to every kubectl invocation made by the metrics command. A value passed through --filter remains editable in the metric browser. Before generated resources are printed, the CLI offers to open a line-numbered YAML editor; --print skips this final question and prints directly.
The metrics explorer:
- discovers Prometheus services and Mimir gateways from the active kubeconfig using common labels and can manage a temporary
kubectl port-forward; Mimir API requests use its/prometheusprefix andX-Scope-OrgID: kedify-agent; - retrieves metric names with the
{__name__=~".+"}selector; - supports arrow and Page Up/Page Down navigation, plus case-insensitive substring filtering as you type;
- shows label names and values as you drill into a metric;
- starts from a single-series
sum(metric{label="value"})expression and lets you edit and validate the final PromQL; - can graph the last 6 hours, day, 3 days, week, or month of samples in the terminal, using a range-appropriate Prometheus query step;
- generates a
kedify-otelScaledObjectwith a default target value of1, and prompts for its scale target; - generates a
MetricPredictorwith a one-week Prometheus range at a30sstep so it has historical samples for initial training; - prints the selected resource manifests by default and only runs
kubectl createwhen the creation checkbox is enabled and a final review of the exact YAML, active Kubernetes context, and target namespace is confirmed.
Interactive terminal UX, progress, and optional creation confirmations are written to stderr. If no resource manifest is selected, the completed PromQL expression is printed to stdout; otherwise, the generated YAML is printed to stdout.
Notes for apply recommendations:
- The command is Helm-only in v1.
--recommendations-file,--chart-path, and--values-fileare required.--containeris optional. If omitted, the CLI matches all recommendation-bearing containers in the workload.- All matched containers must be safely patchable for the run to succeed.
--output-fileis required for--format overrideunless--dry-runis set.- JSON output includes top-level
containersand per-entrycontainerfields for multi-container runs.
Pick a cluster interactively:
./bin/kedify get clusterPick a cluster interactively and delete it:
./bin/kedify delete clusterOverride the API URL:
./bin/kedify --apiurl https://api.dev.kedify.io/v1 list clustersOr with an environment variable:
KEDIFY_API_URL=https://api.dev.kedify.io/v1 ./bin/kedify list clustersPass the auth token explicitly in CI:
./bin/kedify --token "$KEDIFY_TOKEN" list clustersOr via environment variable:
KEDIFY_TOKEN="$KEDIFY_TOKEN" ./bin/kedify get cluster my-cluster- The CLI keeps command output on
stdoutso it remains script-friendly. - Interactive prompts and terminal UX are sent to
stderr. - Paginated API responses are read across all pages automatically before output is printed.
Licensed under the Apache License v2.0. See LICENSE.