agentapi  by coder

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

Created 5 months ago
787 stars

Top 44.5% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
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)
23
Issues (30d)
5
Star History
67 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Elvis Saravia Elvis Saravia(Founder of DAIR.AI).

agent-service-toolkit by JoshuaC215

2.0%
4k
Toolkit for building AI agent services
Created 1 year ago
Updated 22 hours ago
Feedback? Help us improve.