# Quickstart Start one wrapper, read its agent card, send it a message. Every wrapper works the same way from the outside, so the client side below is identical for all five. You need Node 20 or later. Shell commands are written for bash or zsh; on Windows use Git Bash or WSL, or the PowerShell form given in step 2. - [1. Start an agent](#1-start-an-agent) - [2. Talk to it](#2-talk-to-it) - [3. Give it a config file](#3-give-it-a-config-file) - [No account at all](#no-account-at-all) - [Running from a clone](#running-from-a-clone) - [If something goes wrong](#if-something-goes-wrong) ## 1. Start an agent Pick one. No config file is needed for a first run: every wrapper has built-in defaults. > [!WARNING] > There is no authentication on the endpoint, and without `--hostname` a wrapper listens on all interfaces. The agents below can read and change files in the directory you give them, and most can run commands. Keep `--hostname 127.0.0.1` and use a scratch directory until you have read the [Security Guide](../guides/security.md). ### GitHub Copilot ```bash gh auth login # an account with Copilot access; or: export GITHUB_TOKEN=... npx a2a-copilot --hostname 127.0.0.1 --model auto ``` Listens on port 3000. `--model auto` lets Copilot choose a model your plan includes. No Copilot access? `a2a-copilot` can use [your own model endpoint](../../a2a-copilot/README.md#bring-your-own-model-byok) instead. ### Claude ```bash export ANTHROPIC_API_KEY=sk-ant-... npx a2a-claude --hostname 127.0.0.1 --workspace /path/to/a/scratch/dir ``` Listens on port 3030. The workspace must be an existing directory. ### OpenCode `a2a-opencode` does not start OpenCode. It connects to a server you run, and that server needs a model provider configured. ```bash opencode serve --port 4096 # terminal 1 npx a2a-opencode --hostname 127.0.0.1 # terminal 2 ``` Listens on port 3000. An OpenCode 2.x server needs a password (`export OPENCODE_SERVER_PASSWORD=...` in both terminals). OpenCode 1.x servers need neither. ### OpenAI Codex ```bash npm install -g @openai/codex && codex login npx a2a-codex --hostname 127.0.0.1 --workspace /path/to/a/git/repo ``` Listens on port 3020. The workspace must be a Git repository (Codex checks this). ### Google Antigravity ```bash npm install -g a2a-antigravity a2a-antigravity setup # creates a Python venv with the pinned SDK; needs Python 3.10+ export GEMINI_API_KEY=... a2a-antigravity --hostname 127.0.0.1 --workspace /path/to/a/scratch/dir ``` Listens on port 3040. When a wrapper is up it prints its URLs: the agent card, the JSON-RPC endpoint, the REST endpoint and `/health`. ## 2. Talk to it Replace `3000` with your wrapper's port. ```bash # Is it up? curl -s http://localhost:3000/health # What is it? Every A2A client starts here. curl -s http://localhost:3000/.well-known/agent-card.json # Ask it something. curl -s -X POST http://localhost:3000/a2a/jsonrpc -H 'content-type: application/json' -d '{ "jsonrpc": "2.0", "id": "1", "method": "message/send", "params": { "message": { "kind": "message", "messageId": "m1", "role": "user", "parts": [{ "kind": "text", "text": "What does Array.prototype.flatMap do?" }] } } }' ``` The same request in PowerShell: ```powershell $body = '{"jsonrpc":"2.0","id":"1","method":"message/send","params":{"message":{"kind":"message","messageId":"m1","role":"user","parts":[{"kind":"text","text":"What does Array.prototype.flatMap do?"}]}}}' Invoke-RestMethod -Method Post -Uri http://localhost:3000/a2a/jsonrpc -ContentType 'application/json' -Body $body | ConvertTo-Json -Depth 12 ``` The call returns when the agent has finished. The result is a task: ```json { "jsonrpc": "2.0", "id": "1", "result": { "kind": "task", "id": "3879bc73-...", "contextId": "62f7a72b-...", "status": { "state": "completed" }, "artifacts": [ { "name": "response", "parts": [{ "kind": "text", "text": "flatMap maps each element, then flattens one level..." }] } ], "metadata": { "x-usage": { "inputTokens": 12, "outputTokens": 5, "llmCalls": 1 } } } } ``` Three things to know when you read it: - **The answer is the artifact named `response`.** A task can also carry artifacts whose name starts with `trace.` (lifecycle, tool calls, usage). Those are for telemetry, not for the reader. Filter on the name. - **Send `contextId` back** in the next message (`"contextId": "62f7a72b-..."` inside `message`) to continue the same conversation. - **Token usage** is in `metadata["x-usage"]` on the task, and on the final status event when you stream. For streaming, the v1.0 wire format and the REST binding, see [What is A2A](what-is-a2a.md). ## 3. Give it a config file A config file sets what the agent says about itself and how the backend runs. Only `agentCard.name` and `agentCard.description` are required by the schema; everything else has a default. ```json { "agentCard": { "name": "Repo Helper", "description": "Answers questions about this repository", "skills": [{ "id": "assistant", "name": "Coding Assistant", "description": "Answer coding questions", "tags": ["code"] }] }, "server": { "port": 3000, "hostname": "127.0.0.1" }, "copilot": { "model": "auto", "systemPrompt": "You are a concise coding assistant.", "systemPromptMode": "replace" } } ``` ```bash npx a2a-copilot --config ./config.json ``` The backend block has the wrapper's name: `copilot`, `claude`, `opencode`, `codex` or `antigravity`. Each package ships a commented example under `agents/example/config.json` and a JSON schema under `schemas/`. Settings are merged in this order, later wins: built-in defaults, config file, environment variables, CLI flags. The shared keys are in the [Configuration reference](../reference/configuration.md), the backend keys in each wrapper's README. Next steps: add [MCP servers](../reference/configuration.md#config-sections), let the agent [call other agents](../guides/sub-agents.md), or run the [software engineering crew](../../examples/software-engineering-crew/) with two agents. ## No account at all Three things in the repository run with no API key, no subscription and no model. ```bash git clone https://github.com/shashikanth-gs/a2a-wrapper.git cd a2a-wrapper # A planner hands work to two stand-in agents over A2A. No install needed. node examples/software-engineering-crew/planner.mjs --mock "Add a slugify(text) helper" # The next two need the packages built. npm install npm run build -w @a2a-wrapper/core npm run build -w a2a-copilot -w a2a-claude # Real a2a-copilot and a2a-claude servers answer a message, with a fake LLM behind them. node examples/mock-ollama/smoke.mjs # A parent agent's tool bridge calls two fake A2A agents (downloads a2a-mcp-skillmap with npx). bash examples/a2a-subagents-scenario/start-all.sh ``` The fake LLM always answers `pong-from-mock-ollama`. It shows that the wrapper, the backend SDK and the A2A plumbing work on your machine; it says nothing about answer quality. ## Running from a clone ```bash git clone https://github.com/shashikanth-gs/a2a-wrapper.git cd a2a-wrapper npm install npm run build -w @a2a-wrapper/core # core's dist/ is not in git and is not built by npm install npm run dev -w a2a-copilot -- --config agents/example/config.json ``` `npm run dev -w ` runs that wrapper from TypeScript; the config path is relative to the package directory. `npx turbo run build` builds everything in dependency order if you prefer one command. ## If something goes wrong | Symptom | Likely cause | |---|---| | `Model "..." is not available` (Copilot) | Your plan does not include that model. Use `--model auto`. | | The server starts but every task fails | Usually credentials. A missing key is only a warning at start-up; the backend rejects the first request. Read the wrapper's log. | | `codex.workingDirectory does not exist`, or Codex refuses to run | `--workspace` must exist and be a Git repository. | | Tasks fail with `Cannot reach OpenCode server` | `opencode serve` is not running at `--opencode-url` (default `http://localhost:4096`). | | The server listens on an unexpected address | Check `server.hostname`, `BIND_HOST` and `--hostname` (the flag wins). `HOSTNAME` counts only when it holds an IP address or `localhost`. | | A flag seems to do nothing | Unknown flags are ignored without an error. Check the spelling with `--help`. | | Port already in use | `--port `. Copilot and OpenCode both default to 3000. | ## What on this page was actually run Checked on Windows 11 with Node, against `a2a-copilot` 1.8.2 from npm and against a build of the 2.0.0 source: - `npx a2a-copilot --hostname 127.0.0.1 --port --model ` with no config file, and with the config file from step 3, then `/health`, the agent card, and the `message/send` request above. The model behind it was the fake LLM from `examples/mock-ollama`, through Copilot's BYOK settings, not GitHub's service. - On the build of `main`: the same over v1.0 JSON-RPC, REST and `message/stream`, a second message on the same `contextId` (it reused the backend session), and the PowerShell request. - All three commands under [No account at all](#no-account-at-all). Not run for this page: any real model backend (Copilot's own service, Claude, OpenCode, Codex, Gemini) and anything on macOS or Linux. The start commands for Claude, OpenCode, Codex and Antigravity were checked against each CLI's source, not executed against the real service.