CLI register Gemini agents
uv run cortex-register-gemini-agents registers deployed
Google Cloud Cortex Framework BigQuery conversational analytics data agents into a
Gemini app (Engine) in Google Cloud Discovery Engine, and
optionally creates or updates the app on demand.
Synopsis
uv run cortex-register-gemini-agents [-h] \
[-c CONFIG_PATH | --config CONFIG_PATH] \
[--enable-apis] [--create-app] \
[--dry-run] [--disable-telemetry]
Replace the following:
CONFIG_PATH: path to your global configuration file, for example:config/config.yaml.
Options
The following table describes the command-line options for
uv run cortex-register-gemini-agents:
| Flag | Description | Default |
|---|---|---|
-h, --help |
Show the help message and exit. | None |
-c, --config CONFIG_PATH |
Path to the global config.yaml file containing buildEnvironment.buildProjectId, conversationalAnalytics, and gemini configuration. |
config/config.yaml |
--enable-apis |
Automatically enable missing required Google Cloud APIs (discoveryengine.googleapis.com and geminidataanalytics.googleapis.com) on buildEnvironment.buildProjectId without prompting. Mutually exclusive with --dry-run. |
false |
--create-app |
Create or update the Gemini app (Engine) on demand before registering agents. Requires gemini.app.displayName in config.yaml. By default, the command only registers or updates agents in an existing app without modifying the app itself. |
false |
--dry-run |
Run read-only pre-flight checks, build the app and agent payloads, and report reconciliation statuses 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. |
false |
Pre-flight checks and reconciliation
Before modifying Google Cloud resources,
uv run cortex-register-gemini-agents runs read-only pre-flight checks against
buildEnvironment.buildProjectId:
- Required APIs: Verifies that
discoveryengine.googleapis.comandgeminidataanalytics.googleapis.comare enabled onbuildEnvironment.buildProjectId. - Location support: Dynamically verifies that the resolved
Gemini location (
gemini.app.location, or lowercasedata.bigQueryLocationwhen omitted) is supported by the Discovery Engine API (for example,global,us, oreu). - Existing app verification: When
--create-appisn't passed, verifies thatgemini.app.appIdalready exists and uses a compatible solution type (SOLUTION_TYPE_SEARCHorSOLUTION_TYPE_GENERATIVE_CHAT). - Live published data agents: Verifies that every enabled agent in
gemini.agentsexists as a live BigQuery conversational analyticsDataAgentwith apublished_contextpopulated (created withcontextVersion: publishedusinguv run cortex-create-ca-agents).
For each enabled agent, the tool fetches the canonical Agent2Agent (A2A) card from the live data agent, configures Google-managed OAuth authorization for end-user BigQuery credentials, imports starter prompts from published example queries, and evaluates one of four reconciliation statuses:
NEEDS_CREATION: The app (when--create-appis set) or registered agent doesn't exist yet and is created. Under--dry-run, if--create-appresolves the app asNEEDS_CREATION, all enabled agents are also reported asNEEDS_CREATION.NEEDS_UPDATE: An existing managed app or agent differs from the target configuration and is updated in place, preserving server-side sharing settings on existing agents.NO_CHANGE: The existing managed app or agent already matches the target configuration.NOT_MANAGED: An existing app uses an incompatible solution type, or an existing registered agent with the same ID doesn't target the expected conversational analyticsDataAgentcard URL. Unmanaged resources aren't overwritten and cause the run to fail.
Exit codes
0: All pre-flight checks and app or agent reconciliations (or dry-run checks) succeeded, orgeminiis disabled or has no enabled agents and--create-appisn't set.1: Configuration validation failed (including combining--dry-runand--enable-apis, or setting--create-appwithoutgemini.app.displayName), a pre-flight check failed, an existing resource resolved asNOT_MANAGED, or a Google Cloud API error occurred.
Examples
Run read-only pre-flight checks and preview registration statuses without modifying Google Cloud resources:
export CORTEX_CONFIG_FILE=config/config.yaml
uv run cortex-register-gemini-agents --config $CORTEX_CONFIG_FILE --dry-run
Register enabled conversational analytics data agents into an existing Gemini app:
export CORTEX_CONFIG_FILE=config/config.yaml
uv run cortex-register-gemini-agents --config $CORTEX_CONFIG_FILE
Create or update the Gemini app on demand, enable missing required APIs, and register enabled agents:
export CORTEX_CONFIG_FILE=config/config.yaml
uv run cortex-register-gemini-agents \
--config $CORTEX_CONFIG_FILE \
--create-app \
--enable-apis
What's next
- Configure
geminisettings and end-user access in Gemini integration. - Provision and publish BigQuery conversational analytics data agents
with
uv run cortex-create-ca-agents. - Configure
conversationalAnalyticsandagent_settings.yamlin Conversational analytics integration.