register-gemini-enterprise
Register a deployed agent to Gemini Enterprise, making it available as a tool within Gemini Enterprise.
Supports:
- ADK agents deployed to Agent Engine
- A2A agents deployed to Cloud Run
Note: A2A agents deployed to Agent Engine are not yet supported for Gemini Enterprise registration. This feature will be available in a future release.
Usage
# Via Makefile (recommended) - Interactive mode
make register-gemini-enterprise
# Direct command (installed)
agent-starter-pack register-gemini-enterprise [OPTIONS]
# Or with uvx (no install required)
uvx agent-starter-pack@latest register-gemini-enterprise [OPTIONS]Quick Start
For ADK Agents
After deploying your ADK agent to Agent Engine:
make deploy
make register-gemini-enterprise # Interactive prompts guide youThe command automatically:
- Detects Agent Engine ID from
deployment_metadata.json - Uses your current authenticated project ID
- Lists available Gemini Enterprise apps for easy selection
- Fetches display name and description from the deployed Agent Engine
- Constructs the full Gemini Enterprise resource name
- Creates or updates the registration in Gemini Enterprise
- Provides a direct console link to view your registered agent
For A2A Agents
For A2A agents deployed to Cloud Run:
make deploy
make register-gemini-enterprise # Auto-detects A2A agent and Cloud Run URLAuto-detection: The Makefile automatically constructs the agent card URL from your Cloud Run service.
Manual specification:
AGENT_CARD_URL="https://your-service.run.app/a2a/app/.well-known/agent-card.json" \
make register-gemini-enterpriseInteractive Prompts
For ADK Agents:
- Agent Engine ID - Auto-detected from
deployment_metadata.json - Project ID - Uses your current authenticated project (from
gcloud auth)- Automatically converts to project number behind the scenes
- Gemini Enterprise apps - Lists all available apps across regions (global, us, eu)
- Select from the list or enter a custom ID
For A2A Agents:
- Agent card URL - Auto-constructed from your Cloud Run service URL
- Project ID - Same as ADK agents (uses current authenticated project)
- Gemini Enterprise apps - Lists all available apps for selection
Prerequisites
For ADK Agents:
- Deployed Agent Engine (creates
deployment_metadata.json) - Gemini Enterprise application configured in Google Cloud
- Authentication:
gcloud auth application-default login
For A2A Agents:
- Deployed agent with accessible agent card endpoint
- Gemini Enterprise application configured in Google Cloud
- (Optional) OAuth 2.0 authorization configured for accessing Google Cloud resources on behalf of users
- Authentication:
gcloud auth login(for identity token)
Non-Interactive Mode
For CI/CD or scripting, you can provide all parameters via environment variables or command-line options:
# Using environment variables
ID="projects/123456/locations/global/collections/default_collection/engines/my-engine" \
make register-gemini-enterprise
# Or provide the full Gemini Enterprise app ID
GEMINI_ENTERPRISE_APP_ID="projects/123456/locations/global/collections/default_collection/engines/my-engine" \
agent-starter-pack register-gemini-enterpriseParameters
Optional
--gemini-enterprise-app-id (env: ID, GEMINI_ENTERPRISE_APP_ID)
Gemini Enterprise app resource name. If not provided, the command runs in interactive mode and lists available apps.
Format: projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine_id}
Note: The interactive mode uses your current authenticated project ID and automatically converts it to the required project number.
Find available apps: Cloud Console > Gemini Enterprise > Apps, or use the interactive listing feature
Other Options
| Parameter | Environment Variable | Default | Description |
|---|---|---|---|
--agent-card-url | AGENT_CARD_URL | None | Agent card URL for A2A agents. If provided, registers as A2A agent |
--deployment-target | DEPLOYMENT_TARGET | Auto-detected | Deployment target: agent_engine or cloud_run |
--project-number | PROJECT_NUMBER | Auto-detected | GCP project number (for non-interactive mode). Interactive mode uses current authenticated project ID |
--agent-engine-id | AGENT_ENGINE_ID | From deployment_metadata.json | Agent Engine resource name (ADK agents only) |
--metadata-file | - | deployment_metadata.json | Path to deployment metadata file |
--display-name | GEMINI_DISPLAY_NAME | From agent or "My Agent" | Display name in Gemini Enterprise |
--description | GEMINI_DESCRIPTION | From agent or "AI Agent" | Agent description |
--tool-description | GEMINI_TOOL_DESCRIPTION | Same as --description | Tool description (ADK agents only) |
--project-id | GOOGLE_CLOUD_PROJECT | Extracted from context | GCP project ID for billing |
--authorization-id | GEMINI_AUTHORIZATION_ID | None | Optional: Pre-configured OAuth authorization resource name (e.g., projects/{project_number}/locations/global/authorizations/{auth_id}) |
Examples
ADK Agent Examples
Interactive mode (recommended):
make register-gemini-enterprise
# The command will:
# 1. Auto-detect your Agent Engine ID
# 2. Use your current authenticated project ID
# 3. Search and list all Gemini Enterprise apps across all regions (global, us, eu)
# 4. Let you select from the list or enter a custom ID
# 5. Provide a direct link to view your agent in the Google Cloud ConsoleNon-interactive with environment variables:
ID="projects/123456789/locations/global/collections/default_collection/engines/my-engine" \
make register-gemini-enterpriseWith custom metadata:
ID="projects/123456789/locations/global/collections/default_collection/engines/my-engine" \
GEMINI_DISPLAY_NAME="Support Agent" \
GEMINI_DESCRIPTION="Customer support assistant" \
make register-gemini-enterpriseA2A Agent Examples
Interactive mode (recommended):
make register-gemini-enterprise
# Makefile auto-constructs agent card URL from Cloud Run service
# Follow prompts for Gemini Enterprise configurationNon-interactive mode:
AGENT_CARD_URL="https://my-agent-abc123-uc.a.run.app/a2a/app/.well-known/agent-card.json" \
ID="projects/123456789/locations/global/collections/default_collection/engines/my-engine" \
make register-gemini-enterpriseTroubleshooting
General Issues
Interactive prompts not showing
- Make sure you're running the command without providing all parameters
- If you set
GEMINI_ENTERPRISE_APP_IDorIDenvironment variable, the command skips some prompts
Can't find Gemini Enterprise ID
- Go to: Cloud Console > Gemini Enterprise > Apps
- Copy the value from the ID column (e.g.,
gemini-enterprise-123456_1234567890)
ADK-Specific Issues
"Invalid Agent Engine ID format"
- Ensure format:
projects/{project_number}/locations/{location}/reasoningEngines/{engine_id} - Check that you're using the correct resource name from
deployment_metadata.jsonor Agent Builder Console
Authentication errors (ADK)
- Run:
gcloud auth application-default login
A2A-Specific Issues
"Failed to fetch agent card"
- Verify the agent card URL is correct and accessible
- Ensure the Cloud Run service is deployed and running
Authentication errors
- Run:
gcloud auth login - Ensure you have permission to invoke the Cloud Run service