Metadata-Version: 2.4
Name: conductor-a2a-cli
Version: 0.1.0
Summary: Command-line interface for the Agent-to-Agent (A2A) protocol
Project-URL: Homepage, https://github.com/conductor-oss/a2a-cli
Project-URL: Repository, https://github.com/conductor-oss/a2a-cli
Project-URL: Issues, https://github.com/conductor-oss/a2a-cli/issues
License: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13
Requires-Dist: typer>=0.12
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Requires-Dist: respx>=0.21; extra == 'test'
Description-Content-Type: text/markdown

# a2a-cli

A command-line interface for the [Agent-to-Agent (A2A) protocol](https://google.github.io/A2A/) v0.3.  
Send messages, stream responses, inspect agent cards, and manage tasks — from your terminal, against any A2A-compatible server.

---

## Install

```bash
pip install a2a-cli
```

**Requirements:** Python 3.10+

---

## Quick start

```bash
# List all agents on a server
a2a list --agent http://localhost:8080/a2a

# Inspect an agent
a2a card --agent http://localhost:8080/a2a/my-agent

# Send a message
a2a send "What is the capital of France?" --agent http://localhost:8080/a2a/my-agent

# Stream the response live (SSE)
a2a stream "Summarize this for me" --agent http://localhost:8080/a2a/my-agent

# Check a task
a2a get <task-id> --agent http://localhost:8080/a2a/my-agent

# Cancel a running task
a2a cancel <task-id> --agent http://localhost:8080/a2a/my-agent
```

Set `A2A_AGENT` so you don't repeat `--agent` every time:

```bash
export A2A_AGENT=http://localhost:8080/a2a/my-agent
a2a send "hello"
a2a card
```

---

## Commands

### `a2a list`

List all agents exposed by an A2A server.

```bash
a2a list --agent http://localhost:8080/a2a
```

```
                        Exposed Agents
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                ┃ URL                                      ┃
┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ greeter             │ http://localhost:8080/a2a/greeter         │
│ support_agent       │ http://localhost:8080/a2a/support_agent   │
│ weather_reporter    │ http://localhost:8080/a2a/weather_reporter│
└─────────────────────┴──────────────────────────────────────────┘
```

---

### `a2a card`

Fetch and display the agent card (`/.well-known/agent-card.json`).

```bash
a2a card --agent http://localhost:8080/a2a/greeter
```

```
╭──────────────────────── Agent Card ────────────────────────╮
│ greeter                                                     │
│ Version:     1                                              │
│ URL:         http://localhost:8080/a2a/greeter              │
│ Description: Agent workflow for greeter                     │
│                                                             │
│ Skills:                                                     │
│   • greeter  Agent workflow for greeter                     │
╰─────────────────────────────────────────────────────────────╯
```

Use `--json` for the raw agent card JSON:

```bash
a2a card --agent http://localhost:8080/a2a/greeter --json
```

---

### `a2a send`

Send a message and display the result.

```bash
a2a send "hello world" --agent http://localhost:8080/a2a/my-agent
```

```
╭──────────────────────── A2A Task ──────────────────────────╮
│ Task ID: dcc14eac-364d-42e3-95f3-69f2c2b0f47c              │
│ State:   completed                                          │
│                                                             │
│ Output:                                                     │
│   Hello! You said: hello world                              │
╰─────────────────────────────────────────────────────────────╯
```

**Options:**

| Flag | Description |
|---|---|
| `--json` | Print raw JSON response |
| `--quiet`, `-q` | Print only the response text (great for scripting) |
| `--context-id` | Conversation context ID for multi-turn exchanges |
| `--task-id` | Continue an existing task |

```bash
# Scripting — just the output text
a2a send "hello" --agent http://localhost:8080/a2a/my-agent --quiet
```

---

### `a2a stream`

Send a message and stream the response live via SSE.

```bash
a2a stream "Write a summary" --agent http://localhost:8080/a2a/my-agent
```

```
● working
● completed
  Here is the summary...
```

Use `--json` to print raw SSE events:

```bash
a2a stream "hello" --agent http://localhost:8080/a2a/my-agent --json
```

---

### `a2a get`

Fetch the current state of a task by ID.

```bash
a2a get dcc14eac-364d-42e3-95f3-69f2c2b0f47c --agent http://localhost:8080/a2a/my-agent
```

```
╭──────────────────────── A2A Task ──────────────────────────╮
│ Task ID: dcc14eac-364d-42e3-95f3-69f2c2b0f47c              │
│ State:   completed                                          │
│                                                             │
│ Output:                                                     │
│   Hello! You said: hello world                              │
╰─────────────────────────────────────────────────────────────╯
```

---

### `a2a cancel`

Cancel a running task.

```bash
a2a cancel dcc14eac-364d-42e3-95f3-69f2c2b0f47c --agent http://localhost:8080/a2a/my-agent
```

```
Canceled task dcc14eac-364d-42e3-95f3-69f2c2b0f47c
```

---

## Global options

| Flag | Description |
|---|---|
| `--agent`, `-a` | Agent URL. Falls back to `A2A_AGENT` env var |
| `--header`, `-H` | Extra request header, repeatable: `"Authorization: Bearer <token>"` |

---

## Protocol

Implements [A2A v0.3](https://google.github.io/A2A/):

- `message/send` — synchronous request/response
- `message/stream` — streaming via SSE
- `tasks/get` — task status and output
- `tasks/cancel` — cancel a running task
- Agent card discovery at `/.well-known/agent-card.json`

---

## Tested with

- [Conductor](https://github.com/conductor-oss/conductor) A2A server

---

## License

Apache 2.0 — [conductor-oss/a2a-cli](https://github.com/conductor-oss/a2a-cli)
