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

CLI

CLI Output Formats

Format kubeadapt output as table, JSON, or YAML. Includes examples for piping to jq, disabling colors, and integrating with scripts.


Every command accepts an -o (or --output) flag that controls how Kubernetes cost data is printed. The default is table.

bash
kubeadapt get clusters -o json
kubeadapt get clusters -o yaml
kubeadapt get clusters          # defaults to table

Table

The default format. Columns are styled with colors.

Tip

Use --no-color to strip all ANSI color codes when piping output to a file or another tool.

bash
kubeadapt get clusters --no-color

Example output:

plaintext
ID             NAME              PROVIDER   REGION       NODES   STATUS
c1a2b3c4...    production        aws        eu-west-1    12      active
cls-def456     non-production    aws        us-east-1    4       active

JSON

Pass -o json to get machine-readable output. This works well with jq for filtering and transforming results.

bash
kubeadapt get clusters -o json

Example output:

json
1{
2  "clusters": [
3    {
4      "id": "c1a2b3c4-d5e6-7890-abcd-ef1234567890",
5      "name": "production",
6      "provider": "aws",
7      "region": "eu-west-1",
8      "node_count": 12,
9      "status": "active"
10    },
11    {
12      "id": "cls-def456",
13      "name": "non-production",
14      "provider": "aws",
15      "region": "us-east-1",
16      "node_count": 4,
17      "status": "active"
18    }
19  ]
20}
Tip

Pipe to jq to extract specific fields:

bash
kubeadapt get clusters -o json | jq '.clusters[0].name'

YAML

Pass -o yaml for YAML output. Useful when you want to feed results into other tools that consume YAML.

bash
kubeadapt get clusters -o yaml

Example output:

yaml
1clusters:
2  - id: c1a2b3c4-d5e6-7890-abcd-ef1234567890
3    name: production
4    provider: aws
5    region: eu-west-1
6    node_count: 12
7    status: active
8  - id: cls-def456
9    name: non-production
10    provider: aws
11    region: us-east-1
12    node_count: 4
13    status: active

jq recipes

Common patterns for extracting cost data from JSON output:

bash
1# Top 5 workloads by monthly cost
2kubeadapt get workloads -o json | jq '[.workloads[] | {name: .workload_name, namespace, cost: .monthly_cost}] | sort_by(-.cost)[:5]'
3
4# Total monthly savings from pending recommendations
5kubeadapt get recommendations --status pending -o json | jq '.total_potential_savings_monthly'
6
7# Teams spending more than $1,000/month
8kubeadapt get teams -o json | jq '[.teams[] | select(.monthly_cost > 1000) | {team, monthly_cost}]'

Related

  • Examples: real-world usage with jq and pipes
  • Command Reference: all available commands
PreviousCLI Command ReferenceCLINextCLI Shell CompletionsCLI

On this page

  • Table
  • JSON
  • YAML
  • jq recipes
  • Related
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