Skip to content

Commit 21fa3ba

Browse files
authored
docs: add register-gemini-enterprise CLI documentation (#431)
* docs: add register-gemini-enterprise CLI documentation Add comprehensive documentation for the register-gemini-enterprise command, including usage examples, parameter descriptions, and troubleshooting guide. - Create new CLI reference page at docs/cli/register_gemini_enterprise.md - Add register-gemini-enterprise to CLI index page - Document all command options and environment variables - Include quick start examples and common troubleshooting scenarios * docs: make register-gemini-enterprise documentation more concise Streamline documentation by: - Combining redundant sections - Using table format for optional parameters - Reducing verbose examples - Condensing troubleshooting section - Removing repetitive explanations Reduced from 264 to 108 lines while keeping all essential information. * docs: add hyperlink to register-gemini-enterprise documentation Update template README to link to full documentation for the register-gemini-enterprise command instead of just mentioning env var.
1 parent e4770dd commit 21fa3ba

File tree

3 files changed

+109
-1
lines changed

3 files changed

+109
-1
lines changed

agent_starter_pack/base_template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ make install && make playground
7272
| `make build-frontend` | Build the frontend for production |
7373
{%- endif %}
7474
{%- if cookiecutter.is_adk %}
75-
| `make register-gemini-enterprise` | Register deployed agent to Gemini Enterprise (see Makefile for parameters) |
75+
| `make register-gemini-enterprise` | Register deployed agent to Gemini Enterprise ([docs](https://googlecloudplatform.github.io/agent-starter-pack/cli/register_gemini_enterprise.html)) |
7676
{%- endif %}
7777
{%- endif %}
7878
| `make test` | Run unit and integration tests |

docs/cli/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ The Agent Starter Pack provides a command-line interface (CLI) to create and set
88
- [`setup-cicd`](setup_cicd.md) - Set up CI/CD pipeline for your project
99
- [`enhance`](enhance.md) - Add agent-starter-pack capabilities to existing projects without creating a new directory
1010
- [`list`](list.md) - List available agents and templates
11+
- [`register-gemini-enterprise`](register_gemini_enterprise.md) - Register a deployed Agent Engine to Gemini Enterprise
1112

1213
For detailed usage instructions, click on the command links above.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# `register-gemini-enterprise`
2+
3+
Register a deployed Agent Engine to Gemini Enterprise, making it available as a tool within the Gemini Enterprise application.
4+
5+
## Usage
6+
7+
```bash
8+
# Via Makefile (recommended)
9+
ID="projects/.../engines/xxx" make register-gemini-enterprise
10+
11+
# Direct command
12+
uvx --from agent-starter-pack agent-starter-pack-register-gemini-enterprise [OPTIONS]
13+
```
14+
15+
## Quick Start
16+
17+
After deploying your agent, register it with just the Gemini Enterprise app ID. The agent engine ID is automatically read from `deployment_metadata.json`:
18+
19+
```bash
20+
make deploy # Creates deployment_metadata.json
21+
22+
ID="projects/123456/locations/global/collections/default_collection/engines/my-engine" \
23+
make register-gemini-enterprise
24+
```
25+
26+
The command automatically:
27+
- Reads agent engine ID from `deployment_metadata.json`
28+
- Fetches display name and description from the deployed Agent Engine
29+
- Creates or updates the registration in Gemini Enterprise
30+
31+
## Prerequisites
32+
33+
- Deployed Agent Engine (creates `deployment_metadata.json`)
34+
- Gemini Enterprise application configured in Google Cloud
35+
- Authentication: `gcloud auth application-default login`
36+
37+
## Parameters
38+
39+
### Required
40+
41+
**`--gemini-enterprise-app-id`** (env: `ID`, `GEMINI_ENTERPRISE_APP_ID`)
42+
43+
Gemini Enterprise app resource name.
44+
45+
Format: `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine_id}`
46+
47+
Note: Use project **number** (numeric), not project ID (string).
48+
49+
Find it: Cloud Console > Discovery Engine > Apps > [Your App] > Details
50+
51+
### Optional
52+
53+
| Parameter | Environment Variable | Default | Description |
54+
|-----------|---------------------|---------|-------------|
55+
| `--agent-engine-id` | `AGENT_ENGINE_ID` | From `deployment_metadata.json` | Agent Engine resource name |
56+
| `--metadata-file` | - | `deployment_metadata.json` | Path to deployment metadata file |
57+
| `--display-name` | `GEMINI_DISPLAY_NAME` | From Agent Engine or "My Agent" | Display name in Gemini Enterprise |
58+
| `--description` | `GEMINI_DESCRIPTION` | From Agent Engine or "AI Agent" | Agent description |
59+
| `--tool-description` | `GEMINI_TOOL_DESCRIPTION` | Same as `--description` | Tool description for Gemini Enterprise |
60+
| `--project-id` | `GOOGLE_CLOUD_PROJECT` | Extracted from agent-engine-id | GCP project ID for billing |
61+
| `--authorization-id` | `GEMINI_AUTHORIZATION_ID` | None | OAuth authorization resource name |
62+
63+
## Examples
64+
65+
**Basic registration:**
66+
```bash
67+
ID="projects/123456789/locations/global/collections/default_collection/engines/my-engine" \
68+
make register-gemini-enterprise
69+
```
70+
71+
**With custom metadata:**
72+
```bash
73+
ID="projects/.../engines/xxx" \
74+
GEMINI_DISPLAY_NAME="Support Agent" \
75+
GEMINI_DESCRIPTION="Customer support assistant" \
76+
make register-gemini-enterprise
77+
```
78+
79+
**Using environment variables:**
80+
```bash
81+
export GEMINI_ENTERPRISE_APP_ID="projects/.../engines/xxx"
82+
export GEMINI_DISPLAY_NAME="Product Support Agent"
83+
export GEMINI_DESCRIPTION="AI agent for product support"
84+
85+
agent-starter-pack-register-gemini-enterprise
86+
```
87+
88+
## Troubleshooting
89+
90+
**"No agent engine ID provided and deployment_metadata.json not found"**
91+
- Run `make deploy` first to create the metadata file, or provide `--agent-engine-id` explicitly
92+
93+
**"Invalid GEMINI_ENTERPRISE_APP_ID format"**
94+
- Ensure format: `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine_id}`
95+
- Use project **number** (numeric), not project ID
96+
97+
**"Could not access secret with service account"**
98+
- Grant Cloud Build service account the `secretmanager.secretAccessor` role
99+
100+
**Authentication errors**
101+
- Run: `gcloud auth application-default login`
102+
103+
## See Also
104+
105+
- [Agent Engine Deployment Guide](../guide/deployment.md)
106+
- [Gemini Enterprise Integration](https://cloud.google.com/discovery-engine/docs)
107+
- [CLI Reference](index.md)

0 commit comments

Comments
 (0)