Skip to main content

Production-ready CLI tool for scaffolding A2ABase Agent SDK projects

Project description

A2ABase CLI

A2ABaseAI

Production-ready CLI tool for scaffolding and managing A2ABase Agent SDK projects.

PyPI API Keys Python 3.11+ MIT License


One command to scaffold, develop, and deploy A2ABase AI agents.
The A2ABase CLI helps you quickly create, manage, and run production-grade AI agent projects with built-in tooling, MCP server integration, and deployment workflows.

๐Ÿš€ Quick Start

Installation

pip install a2abase-cli

After installation, the a2abase command is available globally:

a2abase --help

Create Your First Project

# Initialize a new project
a2abase init --name my-agent

# Navigate to project
cd my-agent

# Set up environment (add your API key)
cp .env.example .env
# Edit .env and add: BASEAI_API_KEY=pk_xxx:sk_xxx

# Install dependencies
pip install -e .

# Run in development mode
a2abase dev

That's it! You now have a fully functional A2ABase agent project with:

  • โœ… Pre-configured project structure
  • โœ… Example weather agent with real API integration
  • โœ… MCP server for custom tools
  • โœ… Auto-reload development server
  • โœ… Ngrok integration for remote agent access

๐Ÿ”‘ Get Your API Key

Before using the CLI, you'll need an A2ABase API key:

  1. Sign up at A2ABaseAI Dashboard
  2. Create an API key
  3. Add it to your project's .env file:
BASEAI_API_KEY=pk_xxx:sk_xxx

๐Ÿ“– Commands

Initialize a new project

a2abase init

This will interactively prompt you for:

  • Project name
  • Package name
  • Template (basic, api, agentic)
  • Package manager (uv or pip)

Options:

  • --name, -n: Project name (non-interactive)
  • --package, -p: Package name (non-interactive)
  • --template, -t: Template type (non-interactive)
  • --pm: Package manager (non-interactive)
  • --install: Install dependencies after creation
  • --force: Overwrite existing files
  • --cwd: Working directory

Add an agent

a2abase add agent <name>

Example:

a2abase add agent research

This creates src/<package>/agents/research_agent.py with a basic agent implementation.

Add a tool

a2abase add tool <name>

Example:

a2abase add tool web_search

This creates src/<package>/tools/web_search.py with a basic tool implementation.

Options:

  • --from-api: Select from available A2ABase API tools
  • --agent, -a: Associate tool with specific agent
  • --force: Overwrite existing tool file

Select from A2ABase API tools:

a2abase add tool --from-api

This will show an interactive list of available A2ABase built-in tools (50+ tools available).

Run in development mode

a2abase dev

Runs the project with auto-reload on file changes. Automatically starts the MCP server with ngrok tunnel.

โš ๏ธ IMPORTANT: Ngrok is enabled by default because A2ABase agents run on remote servers and require public access to your local MCP server. Your custom tools won't work without ngrok!

Setup (required for remote agents):

# 1. Install ngrok support
pip install pyngrok

# 2. Get free ngrok auth token from https://dashboard.ngrok.com/get-started/your-authtoken
export NGROK_AUTH_TOKEN=your_token_here

# 3. Run dev command (ngrok enabled by default)
a2abase dev

Options:

  • --watch/--no-watch: Enable/disable auto-reload (default: enabled)
  • --mcp-port: MCP server port (default: 8000)
  • --no-mcp: Don't start MCP server
  • --ngrok/--no-ngrok: Enable/disable ngrok tunnel (default: enabled, required for remote agents)
  • --ngrok-token: Ngrok auth token (or set NGROK_AUTH_TOKEN env var)

The dev command will:

  • โœ… Start MCP server on http://localhost:8000/mcp (or custom port)
  • โœ… Create ngrok tunnel (enabled by default, required for remote agents)
  • โœ… Display both local and public URLs in a formatted table
  • โœ… Run your agent with auto-reload on file changes

Disable ngrok (only for local testing without remote agents):

a2abase dev --no-ngrok

Run once

a2abase run --input "your prompt here"

Options:

  • --input, -i: Input text for the agent
  • --json: Output as JSON

Run tests

a2abase test

Options:

  • --verbose, -v: Verbose output
  • --coverage: Run with coverage

Doctor (validate environment)

a2abase doctor

Checks your environment for:

  • โœ… Python version (3.11+)
  • โœ… Virtual environment
  • โœ… Required dependencies
  • โœ… Project configuration
  • โœ… Write permissions
  • โœ… Package manager availability

Show version

a2abase version

Shows CLI version, SDK version, and Python version.

๐Ÿ“ Project Structure

When you run a2abase init, it creates a production-ready project structure:

<project_name>/
โ”œโ”€โ”€ pyproject.toml          # Project configuration
โ”œโ”€โ”€ README.md               # Project documentation
โ”œโ”€โ”€ .gitignore             # Git ignore rules
โ”œโ”€โ”€ .env.example           # Environment variables template
โ”œโ”€โ”€ a2abase.yaml           # A2ABase project config
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ <package_name>/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ main.py        # Entrypoint
โ”‚       โ”œโ”€โ”€ sdk_adapter.py # SDK adapter (real or stub)
โ”‚       โ”œโ”€โ”€ agents/
โ”‚       โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚       โ”‚   โ””โ”€โ”€ weather_agent.py  # Example weather agent
โ”‚       โ”œโ”€โ”€ tools/
โ”‚       โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚       โ”‚   โ”œโ”€โ”€ weather.py         # Real weather tool (Open-Meteo API)
โ”‚       โ”‚   โ”œโ”€โ”€ mcp_server.py     # MCP server for custom tools
โ”‚       โ”‚   โ””โ”€โ”€ README.md         # Tools documentation
โ”‚       โ””โ”€โ”€ registry/
โ”‚           โ”œโ”€โ”€ __init__.py
โ”‚           โ”œโ”€โ”€ tools.py          # Tool registry
โ”‚           โ””โ”€โ”€ card.py           # Agent card generator
โ”œโ”€โ”€ vendor/
โ”‚   โ””โ”€โ”€ a2abase_sdk_stub/  # Fallback stub SDK
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ agent.py
โ”‚       โ”œโ”€โ”€ tools.py
โ”‚       โ””โ”€โ”€ runner.py
โ””โ”€โ”€ tests/
    โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ test_smoke.py

โœจ Generated Project Features

Weather Tool

  • ๐ŸŒค๏ธ Real weather data using Open-Meteo API
  • โœ… Free - No API key required
  • โœ… Current weather - Temperature, humidity, wind, conditions
  • โœ… Forecast - Up to 16 days of weather forecast
  • โœ… Geocoding - Automatic coordinate lookup for city names

MCP Server

  • ๐Ÿ”ง Custom tools - Serve your tools via MCP (Model Context Protocol)
  • ๐Ÿš€ Auto-start - Automatically started by a2abase dev
  • ๐ŸŒ Ngrok support - Expose server publicly with --ngrok flag
  • ๐Ÿ“ Well-documented - Complete guide in tools/README.md

Example Agent

  • ๐Ÿค– Weather Agent - Ready-to-use example with custom weather tool
  • ๐Ÿ“‹ Agent cards - Metadata generation for agent registry
  • ๐Ÿ”„ Auto-reload - Development mode with file watching

๐ŸŽฏ Key Features

  • โœ… Interactive project scaffolding - Create projects with guided prompts
  • โœ… Agent and tool generators - Quickly add new agents and tools
  • โœ… MCP server integration - Serve custom tools to A2ABase agents
  • โœ… Ngrok support - Expose MCP server publicly for remote access
  • โœ… Weather tool example - Real weather API integration (Open-Meteo)
  • โœ… Auto-reload development server - Watch for changes and auto-restart
  • โœ… Environment validation - Doctor command checks your setup
  • โœ… Fallback stub SDK - Projects work without SDK installed
  • โœ… Idempotent operations - Won't overwrite without --force
  • โœ… Rich terminal UI - Beautiful colors, tables, and formatting
  • โœ… Cross-platform - Works on macOS, Linux, Windows
  • โœ… Python 3.11+ support - Modern Python features

๐Ÿ“š Documentation

๐ŸŒ Ngrok Integration (Required for Remote Agents)

Ngrok is enabled by default because A2ABase agents run on remote servers and need public access to your local MCP server. Without ngrok, remote agents cannot access your custom tools.

Why Ngrok is Required

  • โœ… A2ABase agents execute on remote servers (not locally)
  • โœ… Your MCP server runs locally on your machine
  • โœ… Remote agents need a public URL to access your local MCP server
  • โœ… Ngrok creates a secure tunnel from the internet to your local server

Setup

  1. Get free ngrok auth token:

  2. Install pyngrok:

    pip install pyngrok
    
  3. Set environment variable:

    export NGROK_AUTH_TOKEN=your_token_here
    
  4. Run dev command (ngrok enabled by default):

    a2abase dev
    

The CLI will display both local and public URLs. Use the public URL in your agent's MCPTools configuration for remote agent access.

โš ๏ธ Security Note: Ngrok exposes your MCP server publicly. Use only for development/testing. For production, deploy your MCP server to a proper hosting service with HTTPS and authentication.

๐Ÿ’ฌ Support

๐Ÿค Contributing

Contributions are welcome!

  • Open an issue to discuss larger changes
  • Submit pull requests for bug fixes or new features
  • Follow the style and lint rules (uses ruff)

๐Ÿ“„ License

Released under the MIT License.
See LICENSE for full details.

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

a2abase_cli-0.1.1.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

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

a2abase_cli-0.1.1-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file a2abase_cli-0.1.1.tar.gz.

File metadata

  • Download URL: a2abase_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for a2abase_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b97b0cb25f5acde20180b2aea20432264f3d717a8cb33664e6e09e681b070ae
MD5 e2100e4d4013ed5034290de1289969f6
BLAKE2b-256 269099c0b59e0b504bd31ffeaa8289944bdaa883ddad552bcb61bccb356f50de

See more details on using hashes here.

File details

Details for the file a2abase_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: a2abase_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for a2abase_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74f3db8791513f03fd7a565ee14a8abbf73c99543112ba9910276b7e40fbdde6
MD5 a11b6ce1bb73eb480bfd31d690ead98d
BLAKE2b-256 6193be77c6729c831fd9ffc5a8da7cfdf9721e2d7f0888bc49bde5376c626694

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