KubeadaptDocsBack to site
Sign inStart free
DocsAPI ReferenceCLI
  • Overview
  • Commands
    • Output Formats
    • Shell Completions
    • Examples
Docs homev1CliExamples

CLI

CLI Examples

Copy-paste examples for the Kubeadapt CLI: list clusters, filter recommendations, export cost data, CI/CD setup, pagination, and more.


Copy-pasteable examples for common Kubernetes cost management tasks. All examples assume you've already authenticated (see Authentication).

List all clusters

bash
kubeadapt get clusters
plaintext
ID             NAME              PROVIDER   REGION       NODES   STATUS
c1a2b3c4...    production        aws        eu-west-1    12      active
cls-def456     staging           aws        us-east-1    4       active

Find pending rightsizing recommendations

bash
kubeadapt get recommendations --type rightsizing --status pending
plaintext
ID          TYPE          CLUSTER       RESOURCE                    PRIORITY   STATUS    MONTHLY SAVINGS
rec-a1b2    rightsizing   production    payments/api-gateway        high       pending   $42.80
rec-c3d4    rightsizing   production    monitoring/prometheus        medium     pending   $18.50

See Right-sizing for how recommendations are generated.

Check costs by team

bash
kubeadapt get teams -o json | jq '.teams[] | {team, monthly_cost}'
json
{ "team": "platform", "monthly_cost": 2044.80 }
{ "team": "backend", "monthly_cost": 1238.40 }
{ "team": "data", "monthly_cost": 3456.00 }

See Cost Attribution for how costs are calculated.

Find over-provisioned workloads

List workloads with low efficiency scores (high waste):

bash
kubeadapt get workloads -o json | jq '[.workloads[] | select(.efficiency_score < 30) | {name: .workload_name, namespace, efficiency: .efficiency_score, monthly_cost}] | sort_by(-.monthly_cost)'

Export data to a file

bash
kubeadapt get nodes --cluster-id c1a2b3c4-d5e6-7890-abcd-ef1234567890 -o json > nodes.json
kubeadapt get recommendations --status pending -o yaml > pending-recs.yaml

GitHub Actions workflow

yaml
1name: Weekly cost report
2on:
3  schedule:
4    - cron: "0 9 * * 1"
5
6jobs:
7  cost-report:
8    runs-on: ubuntu-latest
9    steps:
10      - name: Install CLI
11        run: curl -sSL https://raw.githubusercontent.com/kubeadapt/kubeadapt-cli/main/scripts/install.sh | bash
12
13      - name: Get pending savings
14        env:
15          KUBEADAPT_API_KEY: ${{ secrets.KUBEADAPT_API_KEY }}
16          KUBEADAPT_API_URL: https://public-api.kubeadapt.io
17        run: |
18          kubeadapt get recommendations --status pending -o json > recommendations.json
19          SAVINGS=$(kubeadapt get recommendations --status pending -o json | jq '.total_potential_savings_monthly')
20          echo "Total pending savings: \$${SAVINGS}/month"

Filter workloads by namespace and kind

bash
kubeadapt get workloads --namespace payments --kind Deployment

List persistent volumes by storage class

bash
kubeadapt get pvs --storage-class gp3

Pagination

Fetch the second page of 20 workloads:

bash
kubeadapt get workloads --cluster-id c1a2b3c4-d5e6-7890-abcd-ef1234567890 --limit 20

Debug mode

Pass -v to print HTTP request details to stderr:

bash
kubeadapt get clusters -v

More jq recipes

See Output Formats: jq recipes for additional filtering patterns.

PreviousCLI Shell CompletionsCLI

On this page

  • List all clusters
  • Find pending rightsizing recommendations
  • Check costs by team
  • Find over-provisioned workloads
  • Export data to a file
  • GitHub Actions workflow
  • Filter workloads by namespace and kind
  • List persistent volumes by storage class
  • Pagination
  • Debug mode
  • More jq recipes
Edit this page
Kubeadapt

Kubernetes FinOps platform. Cost visibility, rightsizing, and capacity planning that pays for itself in 30 days.

Product

  • Cost Monitoring
  • Cost Attribution
  • Workload Rightsizing
  • Recommendations
  • Smart Alerting
  • Best Practices
  • Network Cross-AZ

Resources

  • Documentation
  • Status Page
  • Feature Requests

Company

  • About Us
  • Security
  • Careers
  • Contact

© 2026 Kubeadapt. All rights reserved.

PrivacyTermsSecurity