CLI Cortex Framework build

uv run cortex-build compiles Google Cloud Cortex Framework data foundation and data product modules locally into dist/, performs build-input pre-flight validation against Google Cloud without deploying Dataform repositories or executing BigQuery transformations, and compiles and validates declarative data quality assertions.

The command wipes and recreates the --output-dir directory on each run. While build-only runs don't send deployment telemetry events, uv run cortex-build initializes telemetry consent state and accepts --disable-telemetry. To validate the compiled SQL dependency graph offline, run uv run cortex-compile.

Synopsis

uv run cortex-build [-h] \
    [-c CONFIG_PATH | --config CONFIG_PATH] \
    [--output-dir OUTPUT_DIR] \
    [--enable-apis] [--disable-telemetry] \
    [--assertions ASSERTIONS_FILE]

Replace the following:

  • CONFIG_PATH: path to your global config.yaml file, for example: config/config.yaml.
  • OUTPUT_DIR: path to the generated Dataform build output directory, for example: dist.
  • ASSERTIONS_FILE: path to a standalone Dataform assertions file, for example: assertions.sqlx.

Pre-flight validation scope

Before generating Dataform files, uv run cortex-build runs build-input pre-flight checks (validate_build_inputs):

  • Required build-input APIs: Verifies that bigquery.googleapis.com is enabled on source dataset projects, both analyticshub.googleapis.com and bigquery.googleapis.com are enabled on enabled BigQuery sharing catalog projects, and biglake.googleapis.com is enabled for enabled BigLake Delta Sharing catalogs.
  • Source datasets and locations: Verifies that configured source BigQuery datasets exist and match data.bigQueryLocation.
  • BigQuery sharing linked datasets: Verifies that enabled BigQuery sharing datasets exist, aren't unlinked, and match data.bigQueryLocation.

Target dataset validation and creation run during uv run cortex-deploy or uv run cortex-build-and-deploy, not during uv run cortex-build.

Global flags

The following table describes all flags supported by uv run cortex-build:

Flag Description Default
-h, --help Show the command help message and exit. None
-c, --config CONFIG_PATH Path to the global config.yaml configuration file. config/config.yaml
--output-dir OUTPUT_DIR Path to the directory where compiled Dataform artifacts are written. Existing contents in this directory are deleted and recreated on each run. dist
--enable-apis Enable required build-input Google Cloud APIs automatically without interactive prompts. false
--disable-telemetry Disable telemetry event logging and suppress the telemetry collection notice during the run. For more information, see Cortex Framework telemetry. false
--assertions ASSERTIONS_FILE Path to a standalone Dataform assertions file (must be a file, copied into <output_dir>/definitions/assertions/assertions.sqlx). For table-level YAML assertions and .sql templates, see Configure data quality assertions. None
--create-datasets Deprecated (no-op; scheduled for removal in v8.0). Passing this flag emits a deprecation warning and has no effect. Pass --create-datasets to uv run cortex-deploy or uv run cortex-build-and-deploy instead. false

Examples

Build the Dataform package into dist/:

export CORTEX_CONFIG_FILE=config/config.yaml

uv run cortex-build --config $CORTEX_CONFIG_FILE

What's next