跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 google-agents-cli-publish

Google Agents Cli Publish

当用户想"介绍代理","介绍我的ADK代理","注册双子企业代理","介绍给双子企业",或者需要指导代理-cli发布双子企业指令时,应当使用这种技能. 当用户想要"管理代理在代理注册","列表/更新/删除已注册代理",或"注册一个MCP服务器"时也使用. 覆盖ADK vs A2A 注册模式,程序和交互使用,旗标参考,自动检测部署元数据,代理注册机队管理,以及故障排除等. 部分特工-Cli技能套房. 不用于部署( 使用google- agents- cli- deplection) .

583935 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

当用户想"介绍代理","介绍我的ADK代理","注册双子企业代理","介绍给双子企业",或者需要指导代理-cli发布双子企业指令时,应当使用这种技能. 当用户想要"管理代理在代理注册","列表/更新/删除已注册代理",或"注册一个MCP服务器"时也使用. 覆盖ADK vs A2A 注册模式,程序和交互使用,旗标参考,自动检测部署元数据,代理注册机队管理,以及故障排除等. 部分特工-Cli技能套房. 不用于部署( 使用google- agents- cli- deplection) .

何时用

代理人需要OAuth授权(`-授权-id')。 代理通过它的推理引擎资源名直接注册;不需要代理卡 URL

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Gemini Enterprise Registration、Prerequisites、Required Permissions for A2A on Cloud Run、Registration Modes、A2A Registration、A2A on Cloud Run / GKE。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini Enterprise", "publish to Gemini Enterprise", or needs guidance on the agents-cli publish gemini-enterprise command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

Gemini Enterprise RegistrationPrerequisitesRequired Permissions for A2A on Cloud RunRegistration ModesA2A RegistrationA2A on Cloud Run / GKEADK Registration (default on Agent Runtime)Programmatic Mode (CI/CD)Via flagsVia environment variablesInteractive Mode (`--interactive`)Complete Flag Reference

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
google-agents-cli-publish
description
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini Enterprise", "publish to Gemini Enterprise", or needs guidance on the agents-cli publish gemini-enterprise command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「google-agents-cli-publish」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-0bf724a7e2d82f73-%E8%B0%B7%E6%AD%8C%E4%BB%A3%E7%90%86Cli-%E5%8F%91%E5%B8%83.html
请存为 .cursor/skills/google-agents-cli-publish/SKILL.md 或 .claude/skills/google-agents-cli-publish/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/google/agents-cli' --list

npx skills add 'https://github.com/google/agents-cli' --skill 'google-agents-cli-publish'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: google-agents-cli-publish description: > This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini Enterprise", "publish to Gemini Enterprise", or needs guidance on the agents-cli publish gemini-enterprise command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy). metadata: author: Google license: Apache-2.0 version: 1.5.0 requires: bins: - agents-cli install: "uv tool install google-agents-cli" --- # Gemini Enterprise Registration > **Requires:** A deployed agent. For Agent Runtime, `deployment_metadata.json` (created by `agents-cli deploy`) enables auto-detection. For Cloud Run or GKE, provide the agent card URL and flags directly. ## Prerequisites 1. **Agent must be deployed** — the agent must be running and reachable 2. **Gemini Enterprise app must exist** — Create one in Google Cloud Console → Gemini Enterprise → Apps before registering 3. **`deployment_metadata.json`** (Agent Runtime only) — Created automatically by `agents-cli deploy`; contains the agent runtime ID, deployment target, the A2A flag, and the agent directory ## Required Permissions for A2A on Cloud Run - **`roles/run.servicesInvoker`** granted to the Discovery Engine service account (`[email protected]`) on the Cloud Run service. --- ## Registration Modes ### A2A Registration Every scaffolded agent serves the Agent-to-Agent protocol. A2A is the default — and only — registration type on **Cloud Run** and **GKE** (no reasoning engine to invoke natively). It also works on **Agent Runtime** via `--registration-type a2a`. For an ADK agent there the CLI warns against it, because Gemini Enterprise can invoke Agent Runtime natively via `:streamQuery` — prefer ADK registration in that case. For an agent built on another framework there is no ADK app to invoke natively, so A2A is the right mode on every target and the warning is expected. Pass the agent card URL and the command fetches the card and registers it; display name and description default to the card's `name`/`description`. ```bash # A2A on Cloud Run / GKE agents-cli publish gemini-enterprise \ --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 ``` Pass `--display-name` / `--description` to override the card defaults. On Agent Runtime, the card URL auto-builds from `deployment_metadata.json` if you omit `--agent-card-url`. ### ADK Registration (default on Agent Runtime) > **ADK projects only.** The agent must be deployed to Agent Runtime as an ADK app, since > registration invokes it through `:streamQuery`. An agent on another framework registers over > A2A, so deploy it to Cloud Run or GKE and publish from there. This is the **default and recommended registration for ADK agents on Agent Runtime**: Gemini Enterprise invokes the agent natively via `:streamQuery` on its reasoning engine resource, authenticating end-to-end. Under the hood, `:streamQuery` dispatches to the `AdkApp`'s `streaming_agent_run_with_events` method — when debugging an ADK invocation, search the runtime's `reasoning_engine_stderr` logs for that method name to trace the failure. It's also the path to use when the agent needs an OAuth authorization (`--authorization-id`). The agent is registered directly via its reasoning engine resource name; no agent card URL is needed. ```bash agents-cli publish gemini-enterprise \ --registration-type adk \ --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" ``` --- ## Programmatic Mode (CI/CD) The command is non-interactive by default — pass all required values via flags or environment variables. This makes it safe for CI/CD pipelines. ### Via flags ```bash agents-cli publish gemini-enterprise \ --agent-runtime-id "$AGENT_RUNTIME_ID" \ --gemini-enterprise-app-id "$GEMINI_ENTERPRISE_APP_ID" \ --display-name "Production Agent" \ --registration-type adk ``` ### Via environment variables Most flags have an env var alternative (`--metadata-file`, `--interactive`, and `--list` do not): ```bash export 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 Mode (`--interactive`) Pass `--interactive` (or `-i`) to be guided through any missing values with interactive prompts. The command will list available Gemini Enterprise apps, offer to auto-detect the agent runtime ID from metadata, and prompt for display name and description. ```bash agents-cli publish gemini-enterprise --interactive ``` --- ## Complete Flag Reference | Flag | Env Var | Description | |------|---------|-------------| | `--agent-runtime-id` | `AGENT_RUNTIME_ID` | Agent Runtime resource name (auto-detected from `deployment_metadata.json`) | | `--gemini-enterprise-app-id` | `ID` or `GEMINI_ENTERPRISE_APP_ID` | Gemini Enterprise app full resource name | | `--display-name` | `GEMINI_DISPLAY_NAME` | Display name in Gemini Enterprise | | `--description` | `GEMINI_DESCRIPTION` | Agent description | | `--tool-description` | `GEMINI_TOOL_DESCRIPTION` | Tool description (ADK mode only, defaults to description) | | `--registration-type` | `REGISTRATION_TYPE` | `adk` or `a2a` (defaults to `adk` for an ADK agent on Agent Runtime, `a2a` everywhere else, including any non-ADK framework) | | `--agent-card-url` | `AGENT_CARD_URL` | Agent card URL for A2A registration | | `--deployment-target` | `DEPLOYMENT_TARGET` | `agent_runtime`, `cloud_run`, or `gke` (sets the default registration type — ADK on Agent Runtime, A2A on Cloud Run / GKE — and the A2A auth method) | | `--project-id` | `GOOGLE_CLOUD_PROJECT` | GCP project ID for billing | | `--project-number` | `PROJECT_NUMBER` | GCP project number (used for Gemini Enterprise lookup) | | `--authorization-id` | `GEMINI_AUTHORIZATION_ID` | OAuth authorization resource name | | `--metadata-file` | — | Path to deployment metadata (default: `deployment_metadata.json`) | | `--interactive` / `-i` | — | Enable interactive prompts | | `--list` | — | List Gemini Enterprise apps in the current project and exit | --- ## Auto-Detection from Metadata When `deployment_metadata.json` exists, the command automatically: - Reads the **agent runtime ID** (`remote_agent_runtime_id`) - Determines the **registration type**: defaults to **ADK** (native `:streamQuery`) on **Agent Runtime**, and **A2A** on **Cloud Run / GKE** (which have no reasoning engine). A project scaffolded with another framework serves no ADK app, so it defaults to **A2A** on every target. Override with `--registration-type`. - Determines the **deployment target** for authentication This means that for the simplest case (an ADK agent on Agent Runtime, registered as ADK), you only need to provide the Gemini Enterprise app ID: ```bash agents-cli publish gemini-enterprise \ --gemini-enterprise-app-id projects/123456/locations/global/collections/default_collection/engines/my-app ``` --- ## SDK Compatibility Agent Runtime deployments may encounter "Session not found" errors with `google-cloud-aiplatform` versions <= 1.128.0. In interactive mode (`--interactive`), the command checks the SDK version from `uv.lock` and offers to upgrade. In programmatic mode, ensure your SDK is up to date before registering. --- ## Agent Registry (agents and MCP servers) Agent Registry (Preview) is the Google Cloud fleet-wide catalog of **agents and MCP servers**, separate from a Gemini Enterprise app. Agents deployed to a managed runtime (Agent Runtime on Gemini Enterprise Agent Platform) are **auto-registered** — no extra step after `agents-cli deploy`. Manage them with `gcloud` (requires `roles/agentregistry.editor`): ```bash # List / inspect agents gcloud agent-registry agents list --project PROJECT --location LOCATION gcloud agent-registry agents describe AGENT_NAME # Update endpoint/metadata — edit the Service resource, not the Agent gcloud agent-registry services update AGENT_NAME \ --display-name "..." --description "..." \ --interfaces "url=ENDPOINT_URL,protocolBinding=http-json" # Register an external MCP server: not auto-introspected, so upload a # toolspec.json (its tools/list response, max 10 KB). No us/eu multi-region. gcloud agent-registry services create SERVER_NAME --location=LOCATION \ --mcp-server-spec-type=tool-spec --mcp-server-spec-content=toolspec.json \ --interfaces="url=SERVER_URL,protocolBinding=jsonrpc" # or http-json, grpc # Remove: delete the underlying runtime agent (auto-registered) OR, for # manually registered agents/servers, delete the Service resource gcloud agent-registry services delete NAME ``` Terraform: `google_agent_registry_service` with an `mcp_server_spec` block. Docs: https://docs.cloud.google.com/agent-registry/manage-agents · https://docs.cloud.google.com/agent-registry/register-mcp-servers --- ## Troubleshooting | Issue | Solution | |-------|----------| | "Session not found" after registration | SDK version issue — upgrade `google-cloud-aiplatform` (see SDK Compatibility above), redeploy, then re-register | | `--registration-type is required` | Non-interactive mode needs `--registration-type` when no `deployment_metadata.json` exists | | "Gemini Enterprise App ID is required" | Provide `--gemini-enterprise-app-id` or set the `ID` / `GEMINI_ENTERPRISE_APP_ID` env var | | Re-publishing the same agent | Registration is idempotent — re-running updates the existing registration in place instead of creating a duplicate | | HTTP 403 on registration | Check that your account has Discovery Engine Editor permissions on the Gemini Enterprise project | | Debugging ADK invocation failures on Agent Runtime | Gemini Enterprise calls the agent via the `AdkApp`'s `streaming_agent_run_with_events` method (the native `:streamQuery` contract). Grep the runtime's `reasoning_engine_stderr` logs for `streaming_agent_run_with_events` to find the underlying error | | "Could not fetch agent card" | Verify the agent is running and the URL is correct; for Cloud Run, ensure `gcloud auth login` is done | --- ## Related Skills - `/google-agents-cli-deploy` — Deployment targets, CI/CD pipelines, and production workflows (also covers Agent Gateway governed ingress/egress and Semantic Governance awareness) - `/google-agents-cli-workflow` — Development workflow, coding guidelines, and operational rules - `/google-agents-cli-scaffold` — Project creation and enhancement with `agents-cli scaffold create` / `scaffold enhance`

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Microsoft Foundry

构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…

运维与云

Azure Deploy

执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…