Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
agent2api
command
Command agent2api serves local agent CLIs as OpenAI- and Anthropic-compatible HTTP APIs.
|
Command agent2api serves local agent CLIs as OpenAI- and Anthropic-compatible HTTP APIs. |
|
internal
|
|
|
adapter
Package adapter defines the contract every agent CLI backend implements, and the registry that turns a config block into a live adapter.
|
Package adapter defines the contract every agent CLI backend implements, and the registry that turns a config block into a live adapter. |
|
adapter/agentcli
Package agentcli holds the plumbing every CLI-backed adapter needs: resolving the binary, learning which flags the installed version actually supports, and turning one subprocess run into a stream of IR events.
|
Package agentcli holds the plumbing every CLI-backed adapter needs: resolving the binary, learning which flags the installed version actually supports, and turning one subprocess run into a stream of IR events. |
|
adapter/claudecode
Package claudecode adapts the Claude Code CLI (`claude`) into an inference backend.
|
Package claudecode adapts the Claude Code CLI (`claude`) into an inference backend. |
|
adapter/codex
Package codex adapts the Codex CLI (`codex exec`) into an inference backend.
|
Package codex adapts the Codex CLI (`codex exec`) into an inference backend. |
|
adapter/cursor
Package cursor adapts the Cursor Agent CLI (`cursor-agent`) into an inference backend.
|
Package cursor adapts the Cursor Agent CLI (`cursor-agent`) into an inference backend. |
|
adapter/fake
Package fake provides an in-memory adapter for tests: it exercises the gateway end to end without spawning a CLI.
|
Package fake provides an in-memory adapter for tests: it exercises the gateway end to end without spawning a CLI. |
|
adapter/mock
Package mock is a scripted backend, compiled in only with the "conformance" build tag.
|
Package mock is a scripted backend, compiled in only with the "conformance" build tag. |
|
adapter/qwencode
Package qwen adapts the Qwen Code CLI (`qwen`) into an inference backend.
|
Package qwen adapts the Qwen Code CLI (`qwen`) into an inference backend. |
|
config
Package config defines agent2api's configuration schema and assembles the effective config from three layers: built-in defaults, an optional config file, and CLI flags — later layers winning per key.
|
Package config defines agent2api's configuration schema and assembles the effective config from three layers: built-in defaults, an optional config file, and CLI flags — later layers winning per key. |
|
frontend/anthropic
Package anthropic implements the Anthropic-compatible HTTP surface: POST /v1/messages, streaming and non-streaming.
|
Package anthropic implements the Anthropic-compatible HTTP surface: POST /v1/messages, streaming and non-streaming. |
|
frontend/openai
Package openai implements the OpenAI-compatible HTTP surface: POST /v1/chat/completions and GET /v1/models, streaming and non-streaming.
|
Package openai implements the OpenAI-compatible HTTP surface: POST /v1/chat/completions and GET /v1/models, streaming and non-streaming. |
|
frontend/responses
Package responses serves the OpenAI Responses API as a text-only endpoint.
|
Package responses serves the OpenAI Responses API as a text-only endpoint. |
|
frontend/sse
Package sse encodes Server-Sent Events and pumps adapter events into them.
|
Package sse encodes Server-Sent Events and pumps adapter events into them. |
|
gate
Package gate bounds how many agent CLI processes an adapter may have running at once.
|
Package gate bounds how many agent CLI processes an adapter may have running at once. |
|
ir
Package ir defines the protocol-neutral internal representation that sits between API frontends (OpenAI, Anthropic) and agent CLI adapters.
|
Package ir defines the protocol-neutral internal representation that sits between API frontends (OpenAI, Anthropic) and agent CLI adapters. |
|
logging
Package logging builds the process logger from configuration.
|
Package logging builds the process logger from configuration. |
|
prompt
Package prompt renders a conversation into the single prompt string an agent CLI accepts.
|
Package prompt renders a conversation into the single prompt string an agent CLI accepts. |
|
router
Package router resolves the model name in a request to the adapter that serves it.
|
Package router resolves the model name in a request to the adapter that serves it. |
|
runner
Package runner owns agent CLI subprocess lifecycle: spawning, streaming stdout line by line, capturing a bounded stderr tail, enforcing idle and absolute deadlines, and making sure nothing outlives the request.
|
Package runner owns agent CLI subprocess lifecycle: spawning, streaming stdout line by line, capturing a bounded stderr tail, enforcing idle and absolute deadlines, and making sure nothing outlives the request. |
|
selfupdate
Package selfupdate replaces the running agent2api binary with the latest published release.
|
Package selfupdate replaces the running agent2api binary with the latest published release. |
|
server
Package server wires configuration into a running HTTP gateway: it builds the adapters, the router and the API frontends, and owns the listener.
|
Package server wires configuration into a running HTTP gateway: it builds the adapters, the router and the API frontends, and owns the listener. |
|
version
Package version reports the build's identity.
|
Package version reports the build's identity. |
Click to show internal directories.
Click to hide internal directories.