Metadata-Version: 2.4
Name: ag2-agentos
Version: 0.0.0a26
Summary: CLI tool for AG2 agent development with A2A protocol support
Project-URL: Homepage, https://github.com/agentos/ag2-cli
Project-URL: Documentation, https://docs.agentos.ai/cli
Project-URL: Repository, https://github.com/agentos/ag2-cli
Author: John Marshall, Sam Bretz
License-Expression: MIT
Keywords: a2a,ag2,agent,ai,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.11
Requires-Dist: ag2
Requires-Dist: fastapi>=0.104.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: keyring>=24.0.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.9.0
Requires-Dist: uvicorn>=0.24.0
Requires-Dist: watchfiles>=0.21.0
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.6.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# AG2 CLI

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

## Installation

```bash
pip install ag2-cli
```

Or install from source:

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

## Quick Start

### Create a new agent

```bash
ag2 init my-agent
cd my-agent
```

### Build and run with Docker

```bash
ag2 build
ag2 run
```

### Run natively (without Docker)

```bash
ag2 run --native
```

### Register with AgentOS

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

## Commands

### Authentication

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

### Agent Development

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

### Docker Lifecycle

```bash
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

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

### A2A Protocol

```bash
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

```bash
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:

```yaml
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

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

### Documentation

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

## License

MIT
