agentapi  by coder

HTTP API for controlling coding agents like Claude Code, Goose, Aider, and Codex

created 3 months ago
682 stars

Top 50.7% on sourcepulse

GitHubView on GitHub
Project Summary

AgentAPI provides an HTTP interface for controlling coding agents like Claude Code, Goose, and Aider, enabling unified chat interfaces and agent-to-agent control. It targets developers building applications that leverage AI coding assistants, offering a programmatic way to interact with these tools.

How It Works

AgentAPI operates by running agents within an in-memory terminal emulator. It translates API requests into terminal keystrokes and parses the agent's output, differentiating between user and agent messages. New agent messages are identified by diffing terminal output against a previous snapshot, and common TUI elements like echoed user input or input prompts are automatically stripped to provide cleaner message data.

Quick Start & Requirements

  • Install via go install github.com/coder/agentapi@latest or download release binaries.
  • Requires Go toolchain for building from source.
  • To run agents, the respective agent (e.g., claude, aider, goose) must be installed and in the system's PATH.
  • Demo chat interface available at https://coder.github.io/agentapi/chat.

Highlighted Details

  • Supports Claude Code, Goose, and Aider agents.
  • Exposes OpenAPI schema at /openapi.json and documentation UI at /docs.
  • Provides endpoints for sending messages (POST /message), retrieving history (GET /messages), checking status (GET /status), and streaming events (GET /events).
  • Includes an attach command for direct terminal session interaction.

Maintenance & Community

  • Developed by Coder.
  • Roadmap includes support for MCP and Agent2Agent protocols.

Licensing & Compatibility

  • License: MIT.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The logic for stripping TUI elements may require updates if the underlying agents significantly change their terminal output structure.

Health Check
Last commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
12
Issues (30d)
6
Star History
200 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Steven Hao Steven Hao(Cofounder of Cognition), and
6 more.

openai-agents-python by openai

1.5%
13k
Python SDK for multi-agent workflows
created 4 months ago
updated 7 hours ago
Feedback? Help us improve.