Skip to main content

Command-line client for the A2A (Agent-to-Agent) Protocol

Project description

A2A CLI

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

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

  • Interactive chat mode with server agents
  • Command-line interface for task management
  • Multiple transport protocols (HTTP, SSE, WebSockets, STDIO)
  • Rich text UI with streaming responses
  • Support for all A2A protocol methods
  • Configuration management for multiple servers

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2a_cli-0.1.8.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2a_cli-0.1.8-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

File details

Details for the file a2a_cli-0.1.8.tar.gz.

File metadata

  • Download URL: a2a_cli-0.1.8.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for a2a_cli-0.1.8.tar.gz
Algorithm Hash digest
SHA256 c405e5c7e88bad5be5f4775db88df1bcbdb6d962293f081297de56c6ac1a3c7a
MD5 fc57b5b6ed3caa8bb50f8f4828f6e838
BLAKE2b-256 dc0a78bc2b64c32bedc8fdf05d3c3d6696b9e0452c1e322969a840367f85f21a

See more details on using hashes here.

File details

Details for the file a2a_cli-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: a2a_cli-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 55.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for a2a_cli-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b4b94eb565879f6700fd9b2432c6f49d683cf1eb3eaff77527948f9984b0da84
MD5 c98b12c47e749d76630785adc146e445
BLAKE2b-256 ae583fe7bc4dfb5a1604405645aa3bc9d0371ba1b58874a4b41692cd0d0ed4b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page