Skip to content

CLI Reference

The gerty CLI is a kubectl plugin that communicates with the gerty-server REST API.

Global Flags

FlagDefaultDescription
--servergerty-server address
-o, --outputtableOutput format (table or json)

report

Show a cluster-wide or namespace-scoped efficiency report.

bash
gerty report
gerty report -n production
FlagDescription
-n, --namespaceScope to a single namespace

workloads

List all workloads with waste metrics, or show detail for a specific workload.

bash
gerty workloads
gerty workloads production/deployment/api-gateway

The positional argument accepts namespace/kind/name format.

recommend

Show right-sizing recommendations.

bash
gerty recommend
gerty recommend -n production
gerty recommend --risk HIGH
FlagDescription
-n, --namespaceScope to a single namespace
--riskFilter by risk level (LOW, MEDIUM, HIGH)

pr

Create a Pull Request (GitHub) or Merge Request (GitLab) in your GitOps repository with right-sizing recommendations.

bash
gerty pr deployment/api-gateway
gerty pr deployment/api-gateway -n production --dry-run
FlagDescription
-n, --namespaceTarget namespace
--branch-prefixPR/MR branch prefix
--dry-runShow what would be changed without creating a PR/MR

Gerty auto-detects your Git provider from the repository URL. GitHub and GitLab (including self-hosted) are supported. Configure access via Helm values:

yaml
gitops:
  provider: github   # or gitlab
  token: ""          # PAT or deploy token (or reference a Secret)

The PR/MR description uses a built-in template with resource changes, metrics, and risk assessment. Customise it with gitops.prTemplate in your values file. See Configuration for available template fields.

annotate

Add GitOps source annotations to a Kubernetes resource, linking it to its manifest in a Git repository.

bash
gerty annotate deployment/api -n prod \
  --repo https://github.com/acme/k8s \
  --path apps/api/deployment.yaml
FlagDescription
-n, --namespaceTarget namespace
--repoGit repository URL (required)
--pathPath to manifest in repo (required)
--fieldSpecific field path
--applyApply annotations immediately via kubectl

discover

Auto-discover workloads managed by ArgoCD or Flux and display their GitOps mappings.

bash
gerty discover
gerty discover -o json
FlagDescription
-o, --outputOutput format (text or json)