Skip to main content

A2A CLI

A command-line client for the A2A (Agent-to-Agent) Protocol v0.3.0.

Overview

A2A CLI provides a rich, interactive command-line interface for interacting with A2A protocol servers. It allows you to connect to A2A-compatible agents, send tasks, monitor their progress, and view results in real-time.

Features

  • A2A Protocol v0.3.0 Compliant - Full support for the latest specification
  • Interactive chat mode with server agents
  • Command-line interface for task management
  • Multiple transport protocols (HTTP, SSE, WebSockets, STDIO)
  • Agent discovery via /.well-known/agent-card.json
  • Rich text UI with streaming responses
  • Support for all A2A protocol methods
  • Configuration management for multiple servers
  • Session persistence and conversation memory

Installation

# Install from PyPI
pip install a2a-cli

# Or install from source
git clone https://github.com/chrishayuk/a2a-cli.git
cd a2a-cli
pip install -e .

Quick Start

# Start in interactive chat mode
uvx a2a-cli chat

# Send a task to a server
uvx a2a-cli --server http://localhost:8000 send "Hello, agent"

# Watch a task's progress
uvx a2a-cli watch <task-id>

Chat Mode

The interactive chat mode provides a rich interface for interacting with A2A agents:

uvx a2a-cli chat

In chat mode, you can:

  • Type messages directly to communicate with the agent
  • Use slash commands to perform specific actions
  • View agent responses with rich formatting
  • Monitor task status and artifacts in real-time

Common Chat Commands

Command Description
/connect <url> Connect to an A2A server
/send <text> Send a task to the server
/send_subscribe <text> Send a task and stream updates
/get <id> Get details about a task
/help Show available commands
/server Show current server information
/servers List available server configurations

Command Line Mode

A2A CLI can also be used as a traditional command-line tool:

# Send a task and wait for the result
uvx a2a-cli send "Generate a list of 5 movie recommendations" --wait

# Get details about a specific task
uvx a2a-cli get <task-id>

# Cancel a running task
uvx a2a-cli cancel <task-id>

Configuration

A2A CLI supports configuration files to manage multiple server connections. Create a file at ~/.a2a/config.json:

{
  "servers": {
    "local": "http://localhost:8000",
    "dev": "https://dev-agent.example.com",
    "prod": "https://agent.example.com"
  }
}

Then use them by name:

uvx a2a-cli --server local chat 

Or in chat mode:

/connect local

Transport Types

A2A CLI supports multiple transport protocols:

  • HTTP: Standard JSON-RPC over HTTP
  • SSE: Server-Sent Events for streaming responses
  • WebSocket: Bidirectional communication
  • STDIO: Standard input/output for CLI-based agents

Development

Requirements

  • Python 3.11+
  • Dependencies: a2a-json-rpc, httpx, rich, typer, prompt-toolkit

Setup

# Clone the repository
git clone https://github.com/yourusername/a2a-cli.git
cd a2a-cli

# Install in development mode
make dev-install

# Run tests
make test

Project Structure

a2a-cli/
├── src/
│   └── a2a_cli/
│       ├── a2a_client.py   # Main client class
│       ├── cli.py          # CLI entry point
│       ├── transport/      # Transport implementations
│       ├── chat/           # Chat interface
│       └── ui/             # UI components
├── tests/                  # Test suite
├── pyproject.toml          # Project metadata and dependencies
└── README.md               # This file

License

MIT

Metadata

Release files for a2a-cli 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a2a-cli 0.2
File Size Uploaded
a2a_cli-0.2.tar.gz 51.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for a2a-cli 0.2
File Interpreter ABI Platform
a2a_cli-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 108.2 kB

Release files / a2a_cli-0.2.tar.gz

Download URL a2a_cli-0.2.tar.gz
Size 51.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1bf80edb7971e0a37ed606ec6926a2f1191f90ed0827e78beb2627bbde048d0c
BLAKE2b-256 checksum
How to use checksums
42711bf18e59bd8c57ed65e9f965ef33275fae189425e13cc4387b4ec7c22162
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release files / a2a_cli-0.2-py3-none-any.whl

Download URL a2a_cli-0.2-py3-none-any.whl
Size 57.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb8652fddcd36b178714c63fec9c81b05cb99534bc528976852d2d5f9e140aee
BLAKE2b-256 checksum
How to use checksums
a97c16a9a7a1676253079cfb4ad820f4488deca62e004bff26ad01ece0ebb8ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page