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.1.0.tar.gz (23.6 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.1.0-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentabi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1217b512125bf3a166f5e6d753dcfeb81cb923b71a136fe68a290b62864621cf
MD5 3a73cfc9696ae345a1c515371ce05990
BLAKE2b-256 951f0c8a03deb8cb1a204c84e2423a2fca1fe4149985c60b159d16ea01f416f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentabi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec5ac1a75cc63437b3b04799be5670783c3a2d651be3a5869fa663e5b06084d6
MD5 ca9b38894f290ea9bbb0b6eac8fa96c8
BLAKE2b-256 124df0e16f04e4ca83cd6fdf72657ea3cf3daf72aff0db993e403fc8e378a8a4

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