google-agents-cli-publish
Skill này làm gì
Skill hướng dẫn đăng ký một agent đã triển khai với ứng dụng Gemini và Agent Registry. Skill dành cho lập trình viên muốn agent của mình xuất hiện và dùng được trong Gemini.
Khi nào nên dùng
- ✓Khi agent của bạn đã triển khai và bạn muốn đăng ký với Gemini.
- ✓Khi bạn muốn liệt kê, cập nhật hoặc xóa các agent trong Agent Registry.
- ✓Khi bạn muốn đăng ký một máy chủ MCP cho một agent.
Liên kết skill
https://github.com/google/agents-cli/blob/main/skills/google-agents-cli-publish/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Đăng ký agent ADK đã triển khai của tôi với Gemini để mọi người có thể dùng nó trong ứng dụng Gemini.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill kiểm tra agent đã được triển khai và truy cập được, rồi dùng công cụ dòng lệnh agents để đăng ký. Với Agent Runtime, skill đọc tệp chi tiết triển khai để tự tìm agent.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Gemini Registration
Requires: A deployed agent. For Agent Runtime in Gemini platform,
deployment_metadata.json(created byagents-cli deploy) enables auto-detection. For Cloud Run or GKE, provide the agent card URL and flags directly.
Prerequisites
- Agent must be deployed — the agent must be running and reachable
- Gemini app must exist — Create one in the Google Cloud console before registering
deployment_metadata.json(Agent Runtime only) — Created automatically byagents-cli deploy; contains the Agent Runtime ID, deployment target, the A2A flag, and the agent directory- Text-based agent — Live/voice (bidi) agents are not supported by the Gemini app, which has no
/run_livetransport. Register a text-based agent instead.
Required Permissions for A2A on Cloud Run
roles/run.servicesInvokergranted to the Discovery Engine service account (service-<PROJECT_NUMBER>@gcp-sa-discoveryengine.iam.gserviceaccount.com) 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 the Gemini app 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.
# A2A on Cloud Run / GKE. The card path depends on the project's language:
# Python -> /a2a/{app_name}/.well-known/agent-card.json
# Go -> /.well-known/agent-card.json
agents-cli publish gemini \
--agent-card-url https://my-service-abc123.us-east1.run.app/a2a/app/.well-known/agent-card.json \
--gemini-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: the Gemini app 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.
agents-cli publish gemini \
--registration-type adk \
--agent-runtime-id projects/123456/locations/us-east1/reasoningEngines/789 \
--gemini-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
agents-cli publish gemini \
--agent-runtime-id "$AGENT_RUNTIME_ID" \
--gemini-app-id "$GEMINI_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):
export AGENT_RUNTIME_ID="projects/123456/locations/us-east1/reasoningEngines/789"
export GEMINI_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 pub
Câu hỏi thường gặp
Điều gì phải đúng trước khi đăng ký?
Agent phải đã triển khai và truy cập được, và ứng dụng Gemini phải có trong Cloud console.
Có hoạt động với agent giọng nói trực tiếp không?
Không. Mô tả cho biết không hỗ trợ agent trực tiếp hoặc agent giọng nói, nên cần agent dựa trên văn bản.
Có cần quyền thêm trên Cloud Run không?
Có. Tài khoản dịch vụ Discovery Engine cần quyền gọi dịch vụ Cloud Run.
Chi tiết
Mô tả gốc của tác giả
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini 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
repo: google/agents-cli
Độ phổ biến
- Sao GitHub
- 6.3k
- Vị trí xếp hạng
- #14372
- Giấy phép
- Apache-2.0
- Cập nhật
- 27/10/2026
Bình luận
- …
Thêm skill từ kho mã này
google-agents-cli-adk-code
6.3kGiúp agent của bạn viết mã cho agent AI bằng Google ADK, gồm công cụ, callback, trạng thái và các mẫu điều phối.
google-agents-cli-deploy
6.3kGiúp agent của bạn triển khai một agent AI lên Google Cloud, gồm Agent Runtime, Cloud Run, GKE, bí mật, CI/CD và xử lý sự cố.
google-agents-cli-eval
6.3kGiúp agent của bạn đánh giá một agent AI bằng bộ dữ liệu kiểm thử và chấm điểm, rồi tìm nguyên nhân các câu trả lời bị sai.
google-agents-cli-observability
6.3kGiúp agent của bạn thiết lập truy vết, ghi nhật ký và giám sát cho một agent AI đã triển khai trên Google Cloud, để bạn thấy nó làm gì.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.