# CLI Cortex Framework deploy

`uv run cortex-deploy` deploys compiled Google Cloud Cortex Framework artifacts from
the build output directory to enabled Dataform workspaces or Git
repositories configured in `deployment.targets`.

## Synopsis

```bash
uv run cortex-deploy [-h] \
    [-c CONFIG_PATH | --config CONFIG_PATH] \
    [--output-dir OUTPUT_DIR] \
    [--enable-apis] [--create-datasets] \
    [--disable-telemetry] [-y | --yes]
```

Replace the following:

- `CONFIG_PATH`: path to your global `config.yaml` file, for example: `config/config.yaml`.
- `OUTPUT_DIR`: path to the compiled build output directory, for example: `dist`.

## Pre-flight validation behavior

Pre-flight checks depend on the enabled target types in `deployment.targets`:

- **`type: dataform` targets** : When at least one enabled target uses `type: dataform`, `uv run cortex-deploy` validates required Google Cloud deployment-target APIs (`dataform.googleapis.com` on repository projects, `bigquery.googleapis.com` on target dataset projects and enabled BigLake Delta Sharing catalog projects, `bigqueryreservation.googleapis.com` and `cloudresourcemanager.googleapis.com` when BigLake Delta Sharing catalogs are enabled, and `datacatalog.googleapis.com` on policy tag taxonomy projects and column-level security target projects when column policy tags are configured under `data.security`). It also verifies or creates missing target BigQuery datasets (including `data.defaultAssertionDataset`, which defaults to `dataform_assertions`, when `data.assertionsEnabled` is `true`) and checks their locations against `data.bigQueryLocation`, validates BigLake BigQuery Enterprise Plus query capacity reservations, verifies that referenced Data Catalog policy tags exist, match `data.bigQueryLocation`, and belong to taxonomies with **Enforce access
  control** (`FINE_GRAINED_ACCESS_CONTROL`) enabled when `data.security.enabled` is `true`, and logs partition drift warnings if existing target tables differ from configured partitioning.
- **Git-only (`type: git`) targets** : When all enabled entries in `deployment.targets` use `type: git`, `uv run cortex-deploy` always skips Google Cloud API and target dataset validation. Passing `--enable-apis` or `--create-datasets` logs a warning and has no effect.

## Global flags

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

| Flag | Description | Default |
| `-h, --help` | Show the command help message and exit. | None |
| `-c, --config CONFIG_PATH` | Path to the global [`config.yaml`](https://docs.cloud.google.com/cortex/docs/deployment-configuration.md.txt#config-config-yaml) configuration file. | `config/config.yaml` |
| `--output-dir OUTPUT_DIR` | Path to the compiled build output directory to reconcile with enabled targets. | `dist` |
| `--enable-apis` | Enable required Google Cloud deployment-target APIs automatically without interactive prompts when at least one enabled target uses `type: dataform`. Logs a warning and has no effect when all enabled targets use `type: git`. | `false` |
| `--create-datasets` | Create missing target BigQuery datasets---including `data.defaultAssertionDataset` (default `dataform_assertions`) when `data.assertionsEnabled` is `true`---without interactive prompts when at least one enabled target uses `type: dataform`. Logs a warning and has no effect when all enabled targets use `type: git`. | `false` |
| `--disable-telemetry` | Disable telemetry event logging during execution. For details, see [Cortex Framework telemetry](https://docs.cloud.google.com/cortex/docs/telemetry.md.txt). | `false` |
| `-y, --yes` | Automatically confirm interactive prompts during non-interactive CI/CD runs, such as creating a missing remote Git branch or overwriting and deleting tracked files outside `ignorePatterns` on `type: git` targets. | `false` |
| `--assertions ASSERTIONS_FILE` | **Deprecated (no-op; scheduled for removal in v8.0).** Passing this flag emits a deprecation warning and has no effect. Pass `--assertions` to [`uv run cortex-build`](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-build.md.txt) or [`uv run cortex-build-and-deploy`](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-build-and-deploy.md.txt) instead. For declarative YAML assertions, see [Configure data quality assertions](https://docs.cloud.google.com/cortex/docs/data-quality-assertions.md.txt). | None |
|---|---|---|

## Examples

Deploy compiled artifacts from `dist/` to enabled targets in `config.yaml`:

```bash
export CORTEX_CONFIG_FILE=config/config.yaml

uv run cortex-deploy --config $CORTEX_CONFIG_FILE
```

## What's next

- Review Dataform and Git target options in the [Deployment guide](https://docs.cloud.google.com/cortex/docs/deployment.md.txt).
- Run compilation and deployment in one step with [`uv run cortex-build-and-deploy`](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-build-and-deploy.md.txt).
- Apply column policy tags and reconcile row access policies after Dataform workflow runs with [`uv run cortex-apply-security`](https://docs.cloud.google.com/cortex/docs/uv-run-cortex-apply-security.md.txt).