Skip to content

Command reference

The infra-cost-model command takes one subcommand. The text below is the --help output of each one, generated from the command's parser when the site is built.

usage: infra-cost-model [-h]
                        {validate,compute,analyze,extract,sync-pricing,seed-pricing,pricing-status,graph,whatif,sensitivity,what-if,coverage,reconcile,import-infracost,billing-lines} ...

DAG-based infrastructure cost analysis

options:
  -h, --help            show this help message and exit

Commands:
  {validate,compute,analyze,extract,sync-pricing,seed-pricing,pricing-status,graph,whatif,sensitivity,what-if,coverage,reconcile,import-infracost,billing-lines}
    validate            Validate a cost model YAML file
    compute             Compute costs from a cost model
    analyze             Full analysis with derived usage
    extract             Extract resources from IaC (Terraform/Pulumi/CDK/ARM)
    sync-pricing        Fetch live prices from Infracost for all services and regions
    seed-pricing        (testing/offline) Load the bundled seed price fixtures into the
                        cache
    pricing-status      Report the cached prices, and how old the newest row of each
                        source is
    graph               Render DAG visualization
    whatif              What-if analysis varying a parameter
    sensitivity         Sensitivity sweep across parameter range
    what-if             Parameter sweep across explicit values with optional A/B
                        comparison
    coverage            Check coverage between cost model and IaC resources
    reconcile           Compare a cost model with an actuals file from `aws ce get-cost-
                        and-usage`
    import-infracost    Import `infracost breakdown --format json` output as priced
                        nodes
    billing-lines       Print the cloud bill line each node's usage metrics map to

validate

usage: infra-cost-model validate [-h] <yaml-file>

positional arguments:
  <yaml-file>  Path to cost model YAML file

options:
  -h, --help   show this help message and exit

compute

usage: infra-cost-model compute [-h] [--catalog | --no-catalog] [--pricing {live,seed}]
                                [--pricing-db <path>]
                                [--time-basis {perSecond,monthly,yearly}] [--monthly]
                                [--budget <usd>] [--group-by <label>]
                                [--exclude-label <key=value>] [--exit-on-unpriced]
                                [--format {table,json}]
                                <yaml-file>

positional arguments:
  <yaml-file>           Path to cost model YAML file

options:
  -h, --help            show this help message and exit
  --catalog             Price from the pricing catalog (default)
  --no-catalog          Price from the model's embedded pricingRates instead
  --pricing {live,seed}
                        Pin the price source: 'live' prices from synced rows only and
                        fails on a metric with none; 'seed' prices from the bundled rows
                        only, never the local cache
  --pricing-db <path>   Read prices from this cache file instead of ~/.infra-cost-
                        model/pricing.db
  --time-basis {perSecond,monthly,yearly}
                        Time basis for cost reporting (default: perSecond)
  --monthly             Compute on a monthly time basis (deprecated: use --time-basis
                        monthly)
  --budget <usd>        Exit with code 1 if total cost exceeds this USD threshold
  --group-by <label>    Print a subtotal per value of this node label, plus one for
                        unlabeled nodes
  --exclude-label <key=value>
                        Leave out the nodes whose label matches (repeatable). --budget
                        applies to the total that is left
  --exit-on-unpriced    Exit with code 1 if any usage metric has no price
  --format {table,json}
                        Output format: the human-readable table (default) or a diffable
                        JSON cost snapshot

analyze

usage: infra-cost-model analyze [-h] [--catalog | --no-catalog] [--pricing {live,seed}]
                                [--pricing-db <path>] [--json] [--budget <usd>]
                                [--group-by <label>] [--exclude-label <key=value>]
                                [--exit-on-unpriced]
                                <yaml-file>

positional arguments:
  <yaml-file>           Path to cost model YAML file

options:
  -h, --help            show this help message and exit
  --catalog             Price from the pricing catalog (default)
  --no-catalog          Price from the model's embedded pricingRates instead
  --pricing {live,seed}
                        Pin the price source: 'live' prices from synced rows only and
                        fails on a metric with none; 'seed' prices from the bundled rows
                        only, never the local cache
  --pricing-db <path>   Read prices from this cache file instead of ~/.infra-cost-
                        model/pricing.db
  --json                Output in JSON format
  --budget <usd>        Exit with code 1 if total cost exceeds this USD threshold
  --group-by <label>    Report a subtotal per value of this node label, plus one for
                        unlabeled nodes
  --exclude-label <key=value>
                        Leave out the nodes whose label matches (repeatable). --budget
                        applies to the total that is left
  --exit-on-unpriced    Exit with code 1 if any usage metric has no price

extract

usage: infra-cost-model extract [-h] [--from FORMAT] [--json] <path>

positional arguments:
  <path>         Path to IaC JSON export file

options:
  -h, --help     show this help message and exit
  --from FORMAT  Source format: terraform, pulumi, cdk, arm (default: terraform)
  --json         Output in JSON format

sync-pricing

usage: infra-cost-model sync-pricing [-h] [--region REGION] [--vendor VENDOR]
                                     [<metric> ...]

positional arguments:
  <metric>         Specific catalog metrics to sync (default: all)

options:
  -h, --help       show this help message and exit
  --region REGION  Region to sync (repeatable). Default: all known regions
  --vendor VENDOR  Cloud vendor (default: aws)

seed-pricing

usage: infra-cost-model seed-pricing [-h] [--all] [<service> ...]

positional arguments:
  <service>   Specific services to seed (default: all)

options:
  -h, --help  show this help message and exit
  --all       Seed all services (default)

pricing-status

usage: infra-cost-model pricing-status [-h] [--json] [--max-age-hours <hours>]

options:
  -h, --help            show this help message and exit
  --json                Output in JSON format
  --max-age-hours <hours>
                        Exit with code 1 when the newest fetched price is older than
                        this

graph

usage: infra-cost-model graph [-h] <yaml-file>

positional arguments:
  <yaml-file>  Path to cost model YAML file

options:
  -h, --help   show this help message and exit

whatif

usage: infra-cost-model whatif [-h] --parameter <name> --value <float> [--catalog |
                               --no-catalog] [--pricing {live,seed}]
                               [--pricing-db <path>] [--monthly]
                               <yaml-file>

positional arguments:
  <yaml-file>           Path to cost model YAML file

options:
  -h, --help            show this help message and exit
  --parameter <name>    Parameter to vary (e.g., frequency, edge:from->to)
  --value <float>       New value for the parameter
  --catalog             Price from the pricing catalog (default)
  --no-catalog          Price from the model's embedded pricingRates instead
  --pricing {live,seed}
                        Pin the price source: 'live' prices from synced rows only and
                        fails on a metric with none; 'seed' prices from the bundled rows
                        only, never the local cache
  --pricing-db <path>   Read prices from this cache file instead of ~/.infra-cost-
                        model/pricing.db
  --monthly             Show costs in monthly terms (default: per-second)

sensitivity

usage: infra-cost-model sensitivity [-h] --parameter <name> [--steps <int>] [--catalog |
                                    --no-catalog] [--pricing {live,seed}]
                                    [--pricing-db <path>] [--monthly]
                                    <yaml-file>

positional arguments:
  <yaml-file>           Path to cost model YAML file

options:
  -h, --help            show this help message and exit
  --parameter <name>    Parameter to sweep (e.g., frequency, edge:from->to)
  --steps <int>         Number of steps (default: 10)
  --catalog             Price from the pricing catalog (default)
  --no-catalog          Price from the model's embedded pricingRates instead
  --pricing {live,seed}
                        Pin the price source: 'live' prices from synced rows only and
                        fails on a metric with none; 'seed' prices from the bundled rows
                        only, never the local cache
  --pricing-db <path>   Read prices from this cache file instead of ~/.infra-cost-
                        model/pricing.db
  --monthly             Show costs in monthly terms (default: per-second)

what-if

usage: infra-cost-model what-if [-h] --param <name> --values <v1,v2,...>
                                [--output {table,json}] [--compare <other-model.yaml>]
                                [--catalog | --no-catalog] [--pricing {live,seed}]
                                [--pricing-db <path>] [--monthly]
                                <yaml-file>

positional arguments:
  <yaml-file>           Path to cost model YAML file

options:
  -h, --help            show this help message and exit
  --param <name>        Parameter to sweep (e.g., frequency, edge:from->to)
  --values <v1,v2,...>  Comma-separated parameter values to evaluate
  --output {table,json}
                        Output format: table (default) or json
  --compare <other-model.yaml>
                        Path to second cost model for A/B comparison
  --catalog             Price from the pricing catalog (default)
  --no-catalog          Price from the model's embedded pricingRates instead
  --pricing {live,seed}
                        Pin the price source: 'live' prices from synced rows only and
                        fails on a metric with none; 'seed' prices from the bundled rows
                        only, never the local cache
  --pricing-db <path>   Read prices from this cache file instead of ~/.infra-cost-
                        model/pricing.db
  --monthly             Show costs in monthly terms (default: per-second)

coverage

usage: infra-cost-model coverage [-h] [--from FORMAT] [--exit-on-uncosted] [--json]
                                 <yaml-file> <iac-file>

Compare the addresses an IaC export declares with the nodes that claim them. A node
claims its resourceAddress and every address its `covers` patterns reach, as exact
strings or globs, so a module path or an aggregate node costs without renaming the node.
A `covers` pattern that reaches nothing is stale and fails.

positional arguments:
  <yaml-file>         Path to cost model YAML file
  <iac-file>          Path to IaC JSON export

options:
  -h, --help          show this help message and exit
  --from FORMAT       Source format: terraform, pulumi, cdk, arm (default: terraform)
  --exit-on-uncosted  Exit with error code 1 if uncosted resources exist (for CI budget
                      gates)
  --json              Output in JSON format (matched, uncosted, orphaned, stalePatterns)

reconcile

usage: infra-cost-model reconcile [-h] --actuals <actuals-json> [--window-days <days>]
                                  [--new-line-days <days>] [--config <reconcile-yaml>]
                                  [--json] [--fail-on-drift] [--catalog | --no-catalog]
                                  [--pricing {live,seed}] [--pricing-db <path>]
                                  <yaml-file>

positional arguments:
  <yaml-file>           Path to cost model YAML file

options:
  -h, --help            show this help message and exit
  --actuals <actuals-json>
                        Path to a Cost Explorer `get-cost-and-usage` payload
  --window-days <days>  Trailing days of the actuals file to compare (default: 30)
  --new-line-days <days>
                        Fewest consecutive billed days, ending at the end of the file,
                        that make a line new (default: 7). Other lines divide by the
                        whole window
  --config <reconcile-yaml>
                        Thresholds and accepted gaps (default: reconcile.yaml beside the
                        model, if present)
  --json                Output in JSON format
  --fail-on-drift       Exit with code 1 if any group fails or is unreadable
  --catalog             Price from the pricing catalog (default)
  --no-catalog          Price from the model's embedded pricingRates instead
  --pricing {live,seed}
                        Pin the price source: 'live' prices from synced rows only and
                        fails on a metric with none; 'seed' prices from the bundled rows
                        only, never the local cache
  --pricing-db <path>   Read prices from this cache file instead of ~/.infra-cost-
                        model/pricing.db

import-infracost

usage: infra-cost-model import-infracost [-h] [--json] <breakdown-json>

positional arguments:
  <breakdown-json>  Path to `infracost breakdown --format json` output

options:
  -h, --help        show this help message and exit
  --json            Output nodes as JSON (default: YAML)

billing-lines

usage: infra-cost-model billing-lines [-h] [--json] <yaml-file>

positional arguments:
  <yaml-file>  Path to cost model YAML file

options:
  -h, --help   show this help message and exit
  --json       Output in JSON format