CLI reference
meridian-tools provides a command-line interface with two subcommands: run
and demo.
Global usage
meridian-tools run
Execute a meridian-tools pipeline run from an authored YAML config.
Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
--config |
Yes | — | Path to the meridian-tools YAML configuration file. |
--output-dir |
No | runs |
Directory where dated run folders will be created. |
--run-name |
No | project.name from YAML |
Optional run name override. |
--traceback |
No | false |
Show the full Python traceback on failure. |
Examples
Exit codes
| Code | Meaning |
|---|---|
0 |
Pipeline completed successfully. |
1 |
Pipeline failed. Error details are printed to stderr. Use --traceback for the full stack trace. |
Failure reporting
The CLI distinguishes five broad failure classes:
- config loading or Pydantic validation failures before wrapper preflight
- dependency preflight failures before run-directory creation
- validation-execution contract failures before run-directory creation
- wrapper-owned
ConfigPreflightErrorfailures before run-directory creation PipelineRunFailureafter the dated run directory already exists
Dependency preflight covers google-meridian[schema] support and optional
plot-export support. Validation-execution contract failures cover incompatible
single-run validation requests such as direct rolling_origin execution.
Wrapper preflight covers only the closed config/data matrix documented in the
configuration guide.
For PipelineRunFailure, the CLI prints the concrete failed run directory,
manifest path, and stage name when available so the partial run can be
inspected immediately. --traceback still shows the original underlying
exception because it is preserved through __cause__.
Validation strategy restrictions
The CLI executes a single pipeline run. Configs with
validation.strategy: rolling_origin cannot be run directly from the CLI
because they require multiple sequential runs. Use the
Python API for rolling-origin workflows.
Configs with strategy: none or strategy: blocked_tail work directly from
the CLI.
meridian-tools demo
Run one of the bundled reference demos or list available demos.
Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
<name> |
Yes (unless --list) |
— | Bundled demo name to execute. One of: timeseries, geo_panel. |
--list |
No | false |
List supported demos and exit. Cannot combine with a demo name. |
--output-dir |
No | runs/demos/ (source checkout) or ./runs/demos/ (installed) |
Override the output root directory. |
--run-name |
No | None (uses project.name from the demo config) |
Optional run name override. |
--traceback |
No | false |
Show the full Python traceback on failure. |
Examples
Available demos
| Name | Description |
|---|---|
timeseries |
National timeseries demo using bundled reference data. |
geo_panel |
Geo-panel demo using bundled reference data. |
Both demos exercise the full staged pipeline including response curves and optimisation.
Lightweight import
The CLI is designed for fast startup. Running meridian-tools --help or
meridian-tools demo --list does not import TensorFlow, NumPy, Meridian,
or ArviZ. Heavy imports are deferred until pipeline execution begins.
Entrypoints
The primary CLI entrypoint is the console script registered in
pyproject.toml:
The supported module-path equivalent is:
The package-level form below is not part of the supported contract in this milestone:
Source-tree wrapper
When working from the source checkout, runme.py provides equivalent
functionality:
See the demo guide for more details on the runme.py
wrapper.