skill

Google Agents CLI Publish

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 meta...

google582,908+ installsVetted

About

# Gemini Registration

> **Requires:** A deployed agent. For Agent Runtime in Gemini platform, `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 app must exist** — Create one in the Google Cloud console 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 4. **Text-based agent** — Live/voice (bidi) agents are **not supported** by the Gemini app, which has no `/run_live` transport. Register a text-based agent instead.

## Required Permissions for A2A on Cloud Run

- **`roles/run.servicesInvoker`** granted 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`.

```bash # 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.

```bash 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

```bash 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):

```bash 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 publish gemini ```

---

## Interactive Mode (`--interactive`)

Pass `--interactive` (or `-i`) to be guided through any missing values with interactive prompts. The command will list available Gemini apps, offer to auto-detect the Agent Runtime ID from metadata, and prompt for display name and description.

```bash agents-cli publish gemini --interactive ```

---

## Complete Flag Reference

| Flag | Env Var | Description | |------|---------|-------------| | `--agent-runtime-id` | `AGENT_RUNTIME_I

Install

Run this command

npx skills add google/agents-cli

Works with

claude appclaude codeclaude apicursorcodexwindsurfclinezed

Manual steps

Install with `npx skills add google/agents-cli`, or clone the repository and copy the `skills/google-agents-cli-publish` folder into your Claude skills directory.

View source

Frequently asked questions

What is the Google Agents CLI Publish skill?

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, programma…

How do I install Google Agents CLI Publish?

Run this in your terminal:

npx skills add google/agents-cli
Which AI tools does Google Agents CLI Publish work with?

It works with claude_app, claude_code, claude_api, cursor, codex, windsurf, cline, zed.

Who made Google Agents CLI Publish?

google.

Is Google Agents CLI Publish free?

Yes, it is free to use.

Related assets

More curated picks in Development & Code.

All Google Agents CLI Publish alternatives →
skillclaude_appclaude_codeclaude_api
git clone https://github.com/anthropics/skills && cp -r skills/skills/claude-api ~/.claude/skills/
Claude Api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration.…★ 4.8 · 2,500+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.1,046,962+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Grilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrase…1,041,607+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Code Review
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented cod…840,484+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Diagnosing Bugs
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing…746,030+
skillclaude_appclaude_codeclaude_api
npx skills add microsoft/azure-skills
Azure AI
Build and troubleshoot Azure AI Search, Speech, OpenAI, and Document Intelligence apps. WHEN: AI Search, vector search, hybrid search, semantic search…727,368+

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Development & Code