Skip to main content

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

Project description

agentabi

PyPI version GitHub release CI License: MIT

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.1.tar.gz (27.2 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.1-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentabi-0.2.1.tar.gz
  • Upload date:
  • Size: 27.2 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.1.tar.gz
Algorithm Hash digest
SHA256 4d4b23ce6612846d2c108b00e17721673a3cbcc065ef962bbc6c8d4308d3dbe5
MD5 a1f8768046e702a30202da93d754b4eb
BLAKE2b-256 5deddaaed0bcd6e80584d5e036c3b9f5ca3f3bb6cb025568068c8b7bc812066b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentabi-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 37.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33651395e69f67a9efc2bd6fb023c834205902cc705d0d00f395608606134384
MD5 6f881b26d5f07f8c8b7436670a925b90
BLAKE2b-256 306ee6cbf246e309c6e9d23137ccafb5a36a2fa544be8cfa0030632f744d0697

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