Install the CLI
The cfdl binary compiles, validates, and runs models:
cfdl compile · validate · parse · run · pack list.
compileandvalidatetake the model's folder or itsmodel.cfdl.runtakes--config <run.json>,--as-of <date>,--rate <r>and--pack <name>for a pack's domain metrics.pack list --path <dir>lists the packs in a directory;--pathis required.- The global
--jsonflag prints diagnostics as JSON. It changes diagnostics only: the IR and results are always JSON files at--out.
Homebrew
brew install cfdl-dev/tap/cfdlPrebuilt binaries
Download the binary for your platform from the
releases page,
place it on your PATH, and (macOS/Linux) make it executable. Each release
carries a SHA256SUMS.txt to check the download against.
- macOS Apple Silicon:
cfdl-darwin-arm64 - macOS Intel:
cfdl-darwin-x64 - Linux x64:
cfdl-linux-x64 - Windows x64:
cfdl-windows-x64.exe
chmod +x ~/bin/cfdlGetting the packs
The four domain packs — energy, cre, credit and opco — are built into the
binary, so use pack resolves with no flag and no download:
cfdl compile my-model --out my-model/ir.jsonA packs/ directory in the working directory is used automatically and
takes precedence over the built-in packs. --packs <dir> names another
directory. With neither, the built-in packs are used. A --packs path that
does not exist, or a directory with no pack in it, is refused with
E4004_MISSING_PACK naming the path, so a mistyped path never runs the
built-in pack in place of your own.
The packs also ship as a cfdl-packs-<version>.tar.gz release asset if you
want to read or fork one.
Verify
Put a first model in my-model/model.cfdl:
version 0.1
model "first-model"
time calendar monthly from 2026-01 for 12
entity asset borrower : Asset.Financial
stream lease.rent on entity asset.borrower inflow currency USD {
schedule every month from 2026-01 to 2026-12
amount = 1000
}Then:
cfdl --version
cfdl validate my-model
cfdl compile my-model --out my-model/ir.json
cfdl run my-model/ir.json --out my-model/results.json --rate 0.08validate prints nothing when the model is sound; run writes the results
document, with model.total of 12,000 and an NPV at 8%.