Skip to main content

CLI tool for AG2 agent development with A2A protocol support

Project description

AG2 CLI

A CLI tool for building, running, and deploying A2A-compatible agents.

Installation

pip install ag2-cli

Or install from source:

git clone https://github.com/AG2Platform/ag2-cli.git
cd ag2-cli
pip install -e .

Quick Start

Create a new agent

ag2 init my-agent
cd my-agent

Build and run with Docker

ag2 build
ag2 run

Run natively (without Docker)

ag2 run --native

Register with AgentOS

ag2 auth login
ag2 register https://my-agent.example.com

Commands

Authentication

ag2 auth login      # Login to AgentOS
ag2 auth logout     # Logout
ag2 auth whoami     # Show current user

Agent Development

ag2 init [name]       # Create new agent project
ag2 create file.yaml  # Create agent from AgentFile

Docker Lifecycle

ag2 build [path]    # Build agent Docker image
ag2 run [name]      # Run agent in Docker container
ag2 stop <name>     # Stop a running container
ag2 restart <name>  # Restart a container
ag2 logs <name>     # View container logs
ag2 ps              # List running containers
ag2 rm <name>       # Remove a container
ag2 rmi <name>      # Remove an image
ag2 images          # List built images
ag2 tag <src> <dst> # Tag an image

Registry

ag2 register <url>  # Register running agent with AgentOS
ag2 agents          # List your registered agents
ag2 list            # List local agent images

A2A Protocol

ag2 call <url> "message"  # Call any A2A agent
ag2 card show [path]      # Display agent card (from path or Docker image)
ag2 card validate [path]  # Validate A2A compliance

Configuration

ag2 configure         # Interactive configuration wizard
ag2 config show       # Show current configuration
ag2 config set <k> <v> # Set configuration value

AgentFile Format

The agent.yaml file defines your agent:

name: "my-agent"
version: "1.0.0"
description: "My AI agent"

card:
  provider: "my-org"
  skills:
    - name: "default"
      description: "Default capability"
  auth:
    scheme: "bearer"

agent:
  model: "gpt-4o"
  system_prompt: |
    You are a helpful assistant.

build:
  python: "3.11"
  dependencies:
    - requests

deploy:
  replicas: 2
  memory: "1GB"

A2A Protocol

This CLI generates A2A-compatible agents that implement:

  • Agent Card at /.well-known/a2a/agent-card.json
  • JSON-RPC 2.0 task endpoints
  • SSE streaming support
  • Standard authentication schemes

Development

Running tests

make test          # Run unit tests
make test-docker   # Run Docker lifecycle tests
make test-all      # Run all tests

Documentation

make docs-install  # Install documentation dependencies
make docs          # Start local docs server
make docs-build    # Build documentation

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

ag2_agentos-0.0.0a19.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

ag2_agentos-0.0.0a19-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file ag2_agentos-0.0.0a19.tar.gz.

File metadata

  • Download URL: ag2_agentos-0.0.0a19.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for ag2_agentos-0.0.0a19.tar.gz
Algorithm Hash digest
SHA256 15506df704880452bc8aa1de1179bf09e08f6d92d6b952df961c565e57c6e559
MD5 a9526f315d39760d45037a874e38eb0a
BLAKE2b-256 b3ab9b22ec3154d667a841cbf780f489a42d5389ea0f633cde18f94578e793bb

See more details on using hashes here.

File details

Details for the file ag2_agentos-0.0.0a19-py3-none-any.whl.

File metadata

File hashes

Hashes for ag2_agentos-0.0.0a19-py3-none-any.whl
Algorithm Hash digest
SHA256 02c45d198b99cfad72a04c36dd28b0c3a44da7280f3e21c719277ea8112e0262
MD5 b12333dc70e083c7e3072a607b9c1321
BLAKE2b-256 412134f52fc4143fb85013af8541160ca0617019c59ebb573ad01d5526658bbf

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