Skip to Content

Option variables

opt and option are aliases. They read CLI flags or the options object passed to the API.

stage: ${opt:stage, "dev"} region: ${option:region, "us-east-1"}

Use options for invocation-specific values such as stage, region, profile, or output mode. Options are user inputs, so they are reported by requirements and analyze output when required.

CLI example

Given this config:

config.yml
stage: ${opt:stage, "dev"} region: ${option:region, "us-east-1"} serviceUrl: https://api.example.com/${stage}/${region}

Pass option values as normal CLI flags:

configorama config.yml --stage prod --region eu-west-2

It resolves to:

{ "stage": "prod", "region": "eu-west-2", "serviceUrl": "https://api.example.com/prod/eu-west-2" }

If a flag is missing, Configorama uses the fallback in the variable expression.

See CLI reference for command syntax and API reference for programmatic options.

Last updated on