Loading...
Loading...
当用户想要“发布Agent”、“发布我的ADK Agent”、“向Gemini Enterprise注册Agent”、“发布到Gemini Enterprise”,或需要agents-cli publish gemini-enterprise命令的使用指导时,应使用本Skill。内容涵盖ADK与A2A注册模式、程序化与交互式用法、参数参考、从部署元数据自动检测以及故障排查。本Skill属于Google ADK(Agent开发工具包)Skill套件。请勿用于部署(请使用google-agents-cli-deploy)。
npx skill4agent add google/agents-cli google-agents-cli-publish要求: 已部署的Agent。对于Agent Runtime,(由deployment_metadata.json创建)支持自动检测。对于Cloud Run或GKE,请直接提供Agent卡片URL和参数。agents-cli deploy
deployment_metadata.jsonagents-cli deployservice-<PROJECT_NUMBER>@gcp-sa-discoveryengine.iam.gserviceaccount.comroles/run.servicesInvokeragents-cli publish gemini-enterprise \
--agent-runtime-id projects/123456/locations/us-east1/reasoningEngines/789 \
--gemini-enterprise-app-id projects/123456/locations/global/collections/default_collection/engines/my-app \
--display-name "My Agent" \
--description "Handles customer queries" \
--tool-description "Answers questions about products"# A2A on Cloud Run
agents-cli publish gemini-enterprise \
--registration-type a2a \
--agent-card-url https://my-service-abc123.us-east1.run.app/a2a/app/.well-known/agent-card.json \
--gemini-enterprise-app-id projects/123456/locations/global/collections/default_collection/engines/my-app \
--display-name "My A2A Agent"
# A2A on Agent Runtime (card URL is auto-constructed from metadata)
agents-cli publish gemini-enterprise \
--registration-type a2a \
--gemini-enterprise-app-id projects/123456/locations/global/collections/default_collection/engines/my-appagents-cli publish gemini-enterprise \
--agent-runtime-id "$AGENT_RUNTIME_ID" \
--gemini-enterprise-app-id "$GEMINI_ENTERPRISE_APP_ID" \
--display-name "Production Agent" \
--registration-type adkexport AGENT_RUNTIME_ID="projects/123456/locations/us-east1/reasoningEngines/789"
export GEMINI_ENTERPRISE_APP_ID="projects/123456/locations/global/collections/default_collection/engines/my-app"
export GEMINI_DISPLAY_NAME="Production Agent"
export GEMINI_DESCRIPTION="Handles customer queries"
agents-cli publish gemini-enterprise--interactive--interactive-iagents-cli publish gemini-enterprise --interactive| 参数 | 环境变量 | 描述 |
|---|---|---|
| | Agent Runtime资源名称(从 |
| | Gemini Enterprise应用完整资源名称 |
| | 在Gemini Enterprise中的显示名称 |
| | Agent描述 |
| | 工具描述(仅ADK模式,默认与描述相同) |
| | |
| | A2A注册用的Agent卡片URL |
| | |
| | 用于计费的GCP项目ID |
| | GCP项目编号(用于Gemini Enterprise查找) |
| | OAuth授权资源名称 |
| — | 部署元数据文件路径(默认: |
| — | 启用交互式提示 |
deployment_metadata.jsonremote_agent_runtime_idis_a2aagents-cli publish gemini-enterprise \
--gemini-enterprise-app-id projects/123456/locations/global/collections/default_collection/engines/my-appgoogle-cloud-aiplatform--interactiveuv.lock| 问题 | 解决方案 |
|---|---|
| 注册后出现“Session not found” | SDK版本问题 —— 升级 |
需要 | 当不存在 |
| “Gemini Enterprise应用ID是必填项” | 提供 |
| “Agent已注册” | 命令会自动更新现有注册 —— 这不是错误 |
| 注册时出现HTTP 403错误 | 检查您的账号是否在Gemini Enterprise项目中拥有Discovery Engine Editor权限 |
| “无法获取Agent卡片” | 确认Agent正在运行且URL正确;对于Cloud Run,请确保已完成 |
/google-agents-cli-deploy/google-agents-cli-workflow/google-agents-cli-scaffoldagents-cli scaffold createscaffold enhance