Skip to main content

Build

Google Agents CLI Publish

Google Agents CLIOfficialCertified

Registers deployed agents in Gemini Enterprise and Agent Registry. Use when the user wants to publish the agent to Gemini Enterprise (the Console's Gemini app), register it over A2A from its agent card, or list, update or remove agents and MCP servers in Agent Registry.

  • New
  • v1.0.10
  • Reviewed Jul 21
  • No reviews yet

Capabilities

  • Agent Runtime

    The command reads the runtime ID from deployment_metadata.json and…

  • Cloud Run and GKE: A2A

    Every scaffolded agent serves A2A, and A2A is the only registration…

  • In CI/CD

  • Agent Registry

    Agent Registry (Preview) is the project-wide catalog of agents and MCP…

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.10

Publish to Gemini Enterprise and Agent Registry

Run agents-cli info first: it prints the language and deployment target the sections below key off.

Before checking the prerequisites, read the framework's skill for this stage: the skill the project's guidance file (CLAUDE.md, GEMINI.md or AGENTS.md) names. On ADK, call the Skill tool with google-agents-cli-adk-code and read its references/adk-publish.md. No Skill tool: read its SKILL.md directly (../<skill-name>/ for a bundled skill, .agents/skills/<skill-name>/ for an extension's).

Optional, after a deploy: agents-cli publish gemini registers the agent with a Gemini Enterprise app (the Console now calls it a Gemini app). publish gemini-enterprise still works as a hidden alias. agents-cli publish gemini --help lists every flag and its env var. Not deployed yet: call the Skill tool with google-agents-cli-deploy.

Done when publish prints the registered agent and the user confirms it answers in the Gemini Enterprise app.

Prerequisites

  1. The agent is deployed and reachable.
  2. The Gemini Enterprise app exists. Create it in the Console; agents-cli publish gemini --list shows the apps in the project.
  3. The agent is text-based. Live and voice agents have no A2A card and the app has no live transport.
  4. On Agent Runtime, deployment_metadata.json from agents-cli deploy is in the project.
  5. Your account has Discovery Engine Editor on the project that hosts the app.

Agent Runtime

bash
agents-cli publish gemini \
  --gemini-app-id projects/123456/locations/global/collections/default_collection/engines/my-app

The command reads the runtime ID from deployment_metadata.json and picks the registration type from the metadata. Override with --registration-type or --agent-runtime-id. Without metadata, non-interactive mode needs --registration-type.

On Agent Runtime the default type is adk: the Gemini app calls the engine through :streamQuery, with no agent card. It works only for a framework that declares the ADK runtime contract. Before you choose between adk and a2a, check the framework's skill: it says which one the agent supports there and which to prefer (on ADK, adk-publish.md prefers adk).

Cloud Run and GKE: A2A

Every scaffolded agent serves A2A, and A2A is the only registration type on Cloud Run and GKE. Pass the card URL; display name and description default to the card's name and description, and --display-name and --description override them.

bash
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

The card path depends on the language, whatever the framework:

  • Python, TypeScript: /a2a/{app_name}/.well-known/agent-card.json
  • Go, Java, Kotlin: /.well-known/agent-card.json

On Cloud Run, first grant roles/run.servicesInvoker on the service to service-PROJECT_NUMBER@gcp-sa-discoveryengine.iam.gserviceaccount.com.

On Agent Runtime, --registration-type a2a without --agent-card-url builds the card URL from the metadata. The card sits behind the /api passthrough: .../reasoningEngines/v1/{resource}/api/<card path>.

An agent that needs OAuth user consent passes --authorization-id projects/PROJECT_NUMBER/locations/global/authorizations/AUTH_ID.

In CI/CD

The command is non-interactive by default, so pass values as flags or env vars (GEMINI_APP_ID, AGENT_RUNTIME_ID, GEMINI_DISPLAY_NAME, GEMINI_DESCRIPTION, AGENT_CARD_URL, REGISTRATION_TYPE):

bash
export GEMINI_APP_ID="projects/123456/locations/global/collections/default_collection/engines/my-app"
export GEMINI_DISPLAY_NAME="Production Agent"
agents-cli publish gemini

-i prompts for missing values instead: it lists the apps and offers the runtime ID from metadata. Re-running updates the existing registration in place.

Agent Registry

Agent Registry (Preview) is the project-wide catalog of agents and MCP servers, separate from any Gemini Enterprise app. Agent Runtime agents register automatically on deploy; for A2A projects deploy also stores the served agent card on the engine, so the entry lists as an A2A agent with the card's skills. Manage entries with gcloud agent-registry (needs roles/agentregistry.editor; see its --help). Change an endpoint or metadata on the Service resource, not the Agent. An external MCP server's spec is its tools/list response (max 10 KB; no us or eu multi-region). To remove an auto-registered agent, delete the runtime agent, but ask the user first: that deletes the deployment and its managed sessions.

Terraform: google_agent_registry_service with an mcp_server_spec block. Docs: manage agents, register MCP servers.

Troubleshooting

Symptom Fix
"Session not found" after registering Python projects on google-cloud-aiplatform 1.128.0 or older: upgrade it, redeploy, re-register
--registration-type is required No deployment_metadata.json: pass --registration-type
"Gemini app ID is required" Pass --gemini-app-id or set GEMINI_APP_ID
HTTP 403 Discovery Engine Editor on the app's project; on Cloud Run, the run.servicesInvoker grant above
"Could not fetch agent card" Check the agent runs and the URL is right; for Cloud Run, gcloud auth login. A Live agent has no card and can't be published

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from Google Agents CLI

View source →
google-agents-cli-adk-codeWrites and fixes ADK agent code in Python, Go, Java, Kotlin and TypeScript: tools, callbacks, state, sub-agents, graph workflows, MCP, Live voice and the ADK recipe catalog. Use when the project uses ADK or the user names it, and they want…0 installsgoogle-agents-cli-deployDeploys agents with agents-cli to Agent Runtime, Cloud Run or GKE. Use when the user wants to deploy or go to production, add a deployment target or CI/CD, set up Terraform, secrets or IAM, test or roll back a deployed agent, put it behind…0 installsgoogle-agents-cli-evalEvaluates agents with agents-cli: eval cases, LLM-judge metrics, scores and the fix loop. Use when the user wants to evaluate or test the agent's answers, write eval cases, measure hallucination or tool use, compare runs after a change,…0 installsgoogle-agents-cli-observabilityTraces and monitors agents, ADK or any OpenTelemetry app, locally or on Google Cloud. Use when the user wants traces or logs, token and cost tracking, alerts or dashboards, to store conversation transcripts or set their retention, to debug…0 installsgoogle-agents-cli-scaffoldCreates, enhances and upgrades agents-cli projects from a framework template. Use when the user wants to scaffold the project for an agent they designed, bring an existing agent under agents-cli, or upgrade a project to the latest…0 installsgoogle-agents-cli-workflowPlans and builds new agents with agents-cli, in ADK or a framework with an agents-cli extension. Use when the user wants to build a new agent, even with no framework named; add memory, document search, OAuth, human approval, moderation or…0 installs

Frequently asked questions about google-agents-cli-publish

What does the google-agents-cli-publish skill do?

Registers deployed agents in Gemini Enterprise and Agent Registry. Use when the user wants to publish the agent to Gemini Enterprise (the Console's Gemini app), register it over A2A from its agent card, or list, update or remove agents and MCP servers in Agent Registry. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the google-agents-cli-publish skill?

Run `npx @skills-hub-ai/cli install google-agents-cli-publish` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/google-agents-cli-publish/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does google-agents-cli-publish work with?

google-agents-cli-publish runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the google-agents-cli-publish skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use google-agents-cli-publish after installing it?

In Claude Code, type `/google-agents-cli-publish` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the google-agents-cli-publish skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/google-agents-cli-publish)](https://skills-hub.ai/skills/google-agents-cli-publish)
HTML
<a href="https://skills-hub.ai/skills/google-agents-cli-publish"><img src="https://skills-hub.ai/api/badges/skill/google-agents-cli-publish" alt="Install on Skills Hub"></a>

More options in the badge docs.