Skip to main content

Unified async Python API for driving coding agent CLIs — Claude Code, Codex, Gemini CLI, and more

Project description

agentabi

Unified interface layer for agentic coding CLIs.

One interface. Any coding agent.

What is agentabi?

agentabi provides a stable, unified interface (an "ABI") for interacting with different agentic coding CLIs. Write your integration once, swap agents with a config change.

Supported Agents

Agent Provider Status
Claude Code Anthropic Implemented
Codex OpenAI Implemented
Gemini CLI Google Implemented
OpenCode Open Source Implemented

Installation

pip install agentabi

With optional SDK integrations:

pip install agentabi[claude]   # Claude Code SDK support
pip install agentabi[codex]    # Codex SDK support
pip install agentabi[gemini]   # Gemini CLI SDK support
pip install agentabi[all]      # All optional SDKs

Note: Each agent's CLI must be installed separately (e.g., claude, codex, gemini, opencode).

Quick Start

Run a task

import asyncio
from agentabi import Session

async def main():
    session = Session(agent="claude_code")
    result = await session.run(prompt="Fix the bug in auth.py")
    print(result["status"])       # "success"
    print(result["result_text"])  # agent's response

asyncio.run(main())

Stream events

async for event in session.stream(prompt="Explain this code"):
    if event["type"] == "message_delta":
        print(event["text"], end="")

Sync convenience

from agentabi import run_sync

result = run_sync(prompt="List Python files", agent="codex")

Discover available agents

from agentabi import detect_agents, get_agent_capabilities

agents = detect_agents()          # ["claude_code", "codex", ...]
caps = get_agent_capabilities("claude_code")
print(caps["supports_streaming"]) # True

Use Cases

  • Fleet Management — Unified entry point for managing multiple coding agents
  • Agent-to-Agent Calls — Translation layer for inter-agent invocation
  • Benchmarking — Run the same task across agents, compare results
  • Fallback & Routing — Automatic failover and cost-aware routing
  • Middleware Pipeline — Inject logging, metering, security scanning, audit trails
  • CI/CD Integration — Vendor-agnostic agent integration for pipelines

Ecosystem

agentabi is part of a layered stack:

agentabi  →  Agent CLI unified interface  →  like an OS ABI
llmir     →  LLM API format conversion    →  like a compiler IR
  • llmir — LLM Intermediate Representation for converting between LLM provider API formats (OpenAI, Anthropic, Google)

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

agentabi-0.2.0.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

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

agentabi-0.2.0-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file agentabi-0.2.0.tar.gz.

File metadata

  • Download URL: agentabi-0.2.0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for agentabi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f7f401c46b56feabd3e01700fbb6a21ae49c0e9334beabd4a21531b6794a8b9e
MD5 6caa742540f49ed165058864bf881342
BLAKE2b-256 c38bd041ddf48a7a62152468ef4e2989d7522afbf17eb906839e6731b8636146

See more details on using hashes here.

File details

Details for the file agentabi-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: agentabi-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for agentabi-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bdfeb1582ad668acb32b11708318c805f4191534fa1bc3e79663dbba5b24fe6
MD5 969f8231d1fa4b044e9d6072c9d680e1
BLAKE2b-256 7291efa0825e30f79a247f9e62cf758e636b916d6b49189fec84b7c91e8f99c8

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