# CLI create Knowledge Catalog data products


`uv run cortex-create-kc-data-products` creates and synchronizes
Google Cloud Cortex Framework data products and governance metadata in
Knowledge Catalog.

## Synopsis

```bash
uv run cortex-create-kc-data-products [-h] \
    [-c CONFIG_PATH | --config CONFIG_PATH] \
    [--kc-project-id KC_PROJECT_ID] \
    --owner-email OWNER_EMAIL \
    [--enable-apis] [--dry-run] [--disable-telemetry]
```

Replace the following:

- `CONFIG_PATH`: path to your global configuration file, for example: `config/config.yaml`.
- `KC_PROJECT_ID`: Google Cloud project ID where Knowledge Catalog resources are created, for example: `my-cortex-project`.
- `OWNER_EMAIL`: email address of the data product owner, for example: `data-owner@example.com`.

> [!NOTE]
> **Note:** `uv run cortex-kc-sync` is retained as a backward-compatible alias for `uv run cortex-create-kc-data-products`. Existing Knowledge Catalog data products that aren't managed by Cortex Framework (`NOT_MANAGED`) are skipped with a warning without failing the run.

## Options

The following table describes the command-line options for
`uv run cortex-create-kc-data-products`:


| Flag | Description | Default |
| `-h, --help` | Show help message and exit. | None |
| `-c, --config CONFIG_PATH` | Path to the global `config.yaml` file used during deployment. | `config/config.yaml` |
| `--kc-project-id KC_PROJECT_ID` | The Google Cloud project ID where Knowledge Catalog resources are created. If omitted, the tool automatically infers the project ID from the target BigQuery dataset defined in `config.yaml`. | Inferred from target dataset in `config.yaml` |
| `--owner-email OWNER_EMAIL` | **Required.** The email address of the owner of the data products. | None (required) |
| `--enable-apis` | Automatically enable missing required Google Cloud APIs without prompting: `bigquery.googleapis.com` on target dataset projects and `dataplex.googleapis.com` on `--kc-project-id` (or target dataset projects if omitted). Mutually exclusive with `--dry-run` (combining both fails configuration validation with exit code `1`). | `false` |
| `--dry-run` | Run read-only pre-flight API checks (`bigquery.googleapis.com` and `dataplex.googleapis.com`), resolve BigQuery tables for enabled data products, and report each data product's sync status without creating or updating resources in Google Cloud. Mutually exclusive with `--enable-apis`. Telemetry event logging is suppressed during `--dry-run`. | `false` |
| `--disable-telemetry` | Temporarily disable telemetry event logging during execution. Telemetry is also automatically suppressed when `--dry-run` is set. For more information, see [Cortex Framework telemetry](https://docs.cloud.google.com/cortex/docs/telemetry.md.txt). | `false` |
| `--data-modules-root-directory DATA_MODULES_DIR` | **Deprecated (ignored; scheduled for removal in v8.0).** Passing this flag emits a deprecation warning and has no effect; configure `data.namespaces` in `config.yaml` instead. | None |
|---|---|---|

<br />

## Examples

Run read-only pre-flight checks and preview synchronization status without
modifying Google Cloud resources:

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

uv run cortex-create-kc-data-products \
    --config $CORTEX_CONFIG_FILE \
    --owner-email OWNER_EMAIL \
    --dry-run
```

Replace the following:

- `OWNER_EMAIL`: email address of the data product owner, for example: `data-owner@example.com`.

Create and synchronize enabled data products (`syncToKc: true`) in
Knowledge Catalog:

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

uv run cortex-create-kc-data-products \
    --config $CORTEX_CONFIG_FILE \
    --owner-email OWNER_EMAIL
```

Replace the following:

- `OWNER_EMAIL`: email address of the data product owner, for example: `data-owner@example.com`.

## What's next

- Learn how to configure and query catalog metadata in [Knowledge Catalog
  integration](https://docs.cloud.google.com/cortex/docs/knowledge-catalog).
- Complete post-deployment verification in [Post-deployment steps](https://docs.cloud.google.com/cortex/docs/post-deployment-steps.md.txt).