Commands

CloudOpt command reference.

CloudOpt is one binary with a short command set. Script output is JSON on stdout. Progress and errors go to stderr.

Workspace setup

Command Purpose
cloudopt init Create workspace directories and default configuration
cloudopt version Print version information

Data collection

AWS

Command Purpose
cloudopt collect aws inventory Snapshot EC2, EBS, VPC, RDS inventory
cloudopt collect aws cost Collect and attribute billing data
cloudopt collect aws metrics Collect CloudWatch utilization metrics

GCP

Command Purpose
cloudopt collect gcp inventory Snapshot Compute Engine, Cloud SQL, VPC, GKE inventory
cloudopt collect gcp cost Collect billing from BigQuery export and attribute to resources
cloudopt collect gcp metrics Collect Cloud Monitoring utilization metrics

Other

Command Purpose
cloudopt import-fixture Load sample YAML data for offline use
cloudopt capabilities matrix Print the cross-provider capability matrix

--dry-run checks access without collecting. --offline uses bundled sample data instead of live APIs.

Common flags

Flag Description
--workspace-dir Path to your CloudOpt workspace (default: ~/.cloudopt)
--regions Comma-separated regions to scan (inventory)
--projects Comma-separated GCP project IDs to scan (GCP inventory)
--lookback-days Billing or metrics lookback window
--snapshot-id Attach cost or metrics to a specific inventory snapshot
--role-arn Assume an IAM role for cross-account access (AWS)
--impersonate-service-account Impersonate a GCP service account

Analysis and reporting

Command Purpose
cloudopt analyze Run optimization checks on collected data
cloudopt report Generate an HTML or JSON report
cloudopt cost-reconcile Compare collected costs against billing totals

Analyze flags

Flag Description
--snapshot-id Analyze a specific snapshot (default: latest complete)
--rules Run only specific checks (comma-separated rule IDs)
--category Run only checks in specific categories (compute, storage, etc.)

Report flags

Flag Description
--format html|json Output format (default: html)
--output Custom output file path
--redact Replace account and resource IDs with aliases
--analysis-run-id Report from a specific analysis run

Typical workflow

cloudopt init --workspace-dir "$HOME/.cloudopt"

cloudopt collect aws inventory --regions us-east-1,us-west-2
cloudopt collect aws cost --lookback-days 30
cloudopt collect aws metrics --lookback-days 14

cloudopt analyze
cloudopt report --format html --redact

For GCP, swap collect aws for collect gcp and add project or billing export flags. See the GCP guide.

Help

cloudopt --help
cloudopt collect aws inventory --help
cloudopt collect gcp inventory --help
cloudopt analyze --help
cloudopt report --help
cloudopt capabilities matrix --help

Exit codes

Code Meaning
0 Success
2 Invalid input or configuration
3 Collection failed
4 Analysis failed

Ctrl+C cancels a running command. Stored snapshots and analysis runs stay intact.