# a2a-cli An [Agent Plugin](https://agent-plugins.org/) that teaches an AI agent to drive the [`a2a` CLI](https://github.com/a2aproject/a2a-cli): fetch an agent's card, send it a message, stream or poll a task, and list, resume, or cancel tasks on any A2A (Agent2Agent) agent. > [!NOTE] > This plugin is generated from [a2aproject/a2a-cli](https://github.com/a2aproject/a2a-cli/tree/main/agent-plugin) on every a2a-cli release. Send changes there. ## Requires the `a2a` binary The plugin carries the agent-facing skill and hooks only. Install `a2a` separately: - **Homebrew (macOS / Linux):** `brew tap a2aproject/a2a-cli https://github.com/a2aproject/a2a-cli && brew install a2a` - **WinGet (Windows):** `winget install a2aproject.a2acli` - **Prebuilt binary:** download from the [latest release](https://github.com/a2aproject/a2a-cli/releases/latest) and put `a2a` on your `PATH`. Check it with `a2a version`. The skill runs the same preflight check. The contacts and discovery hooks need `a2a` 0.5.0 or later; with an older or missing `a2a` they add nothing and never block a prompt. ## Install **Claude Code** ```bash /plugin marketplace add a2aproject/agent-plugins /plugin install a2a-cli@a2a-plugins ``` **Any Agent Plugins client:** load the `plugins/a2a-cli` directory of [a2aproject/agent-plugins](https://github.com/a2aproject/agent-plugins). **Skill only**, with the [`skills`](https://www.skills.sh) CLI: ```bash npx skills add https://github.com/a2aproject/agent-plugins/tree/main/plugins/a2a-cli/skills/a2a-cli -g ``` ## Contents ```text a2a-cli/ ├── plugin.json # Agent Plugins 1.0.0 manifest ├── LICENSE ├── .claude-plugin/ │ └── plugin.json # Claude Code manifest, pointing at its hooks ├── com.anthropic.claude-code/ │ └── hooks.json # Claude Code hooks running `a2a hook` ├── ai.opencode/ │ └── plugins/ │ └── a2a-hook.js # opencode plugin running `a2a hook` └── skills/ └── a2a-cli/ └── SKILL.md ``` ## Usage Ask your agent for A2A work and it loads the skill on its own, for example: > Fetch the agent card at `http://localhost:8080` and send it "summarize this repo". ## Contacts and agent discovery (Claude Code, opencode) In Claude Code, the hooks in `com.anthropic.claude-code/hooks.json`, which `.claude-plugin/plugin.json` points to, run `a2a hook`. opencode has no command hooks, so copy `ai.opencode/plugins/a2a-hook.js` into `~/.config/opencode/plugins/`; it runs `a2a hook` from opencode's plugin events, scans `webfetch` and `websearch` calls, and adds the same context. The hooks run `a2a hook`, which tells your agent which A2A agents it can delegate to: - **Contacts.** Agents you saved with `a2a contact add ` are listed as trusted at the start of a session, after a compaction, and again whenever the contact book changes. The agent can delegate to them with `a2a send -a `. - **Discovered agents.** When a URL appears in a prompt or in a `WebFetch` or `WebSearch` call, `a2a` looks for an agent card at that site's `/.well-known/agent-card.json` and an AI Catalog at its `/.well-known/ai-catalog.json`. Agents it finds are listed as unverified, and the agent is told to ask you before delegating to them. Agents in AI Catalogs you registered with `a2a catalog add` are not listed, since a catalog can list hundreds; the agent finds them with `a2a catalog search`. The hooks don't make network requests, so they don't slow down a turn. A detached background process fetches cards and catalogs for sites it hasn't seen, and the agent hears about them at its next step. Cards are cached under the user cache directory (`~/.cache/a2a-cli` on Linux), and each agent is listed once per session. Discovery probes public and internal hosts. It never connects to link-local addresses, which covers the IPv4 cloud metadata endpoint `169.254.169.254`, and it doesn't follow a redirect from a public site to an internal address. To make an exception for a host, list it in `~/.config/a2a-cli/config.yaml`: ```yaml discovery-allow-host: [agents.internal.example] ``` To turn discovery off and keep the contacts, set `discovery: false` in the same file, or `A2ACLI_DISCOVERY=false` in the environment. To scan other tools' calls for URLs, set `discovery-scan-tools`. ## Versioning The plugin `version` matches the a2a-cli release it was built from. The bundled skill keeps its own date-based `metadata.version`.