Skip to content

Commit 477d397

Browse files
committed
update README
1 parent 0c487a4 commit 477d397

File tree

1 file changed

+46
-10
lines changed

1 file changed

+46
-10
lines changed

README.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,71 @@
11
# AgentAPI
22

33
Control Claude Code, Goose, and Aider with an HTTP API.
4+
45
<div>
56
<img width="800px" src="https://github.com/user-attachments/assets/4b9950f5-bfa7-4f38-bf09-58364f78c100">
67
</div>
78

8-
## Usage
9+
## Quickstart
10+
11+
Install `agentapi` by downloading the latest release binary from the [releases page](https://github.com/coder/agentapi/releases) and putting it in your PATH.
12+
13+
Run a Claude Code server (assumes `claude` is installed on your system):
914

10-
AgentAPI is under active development. Release binaries will be available soon.
15+
```bash
16+
agentapi server -- claude
17+
```
1118

12-
To run the server with Claude Code:
19+
Send a message to the agent:
1320

1421
```bash
15-
go run main.go server -- claude
22+
curl -X POST localhost:3284/message \
23+
-H "Content-Type: application/json" \
24+
-d '{"content": "Hello, agent!", "type": "user"}'
1625
```
1726

18-
You may also pass additional arguments to the agent command. For example:
27+
Get the conversation history:
28+
29+
```bash
30+
curl localhost:3284/messages
31+
```
32+
33+
## CLI Commands
34+
35+
### `agentapi server`
36+
37+
Run an HTTP server that lets you control an agent. If you'd like to start an agent with additional arguments, pass the full agent command after the `--` flag.
1938

2039
```bash
21-
go run main.go server -- claude --allowedTools "Bash(git*) Edit Replace"
40+
agentapi server -- claude --allowedTools "Bash(git*) Edit Replace"
2241
```
2342

24-
By default, the server runs on port 3284. You can inspect the available endpoints by opening http://localhost:3284/docs.
43+
You may also use `agentapi` to run the Aider and Goose agents:
44+
45+
```bash
46+
agentapi server -- aider --model sonnet --api-key anthropic=sk-ant-apio3-XXX
47+
agentapi server -- goose
48+
```
49+
50+
By default, the server runs on port 3284. The server exposes an OpenAPI schema at http://localhost:3284/openapi.json. You may also inspect the available endpoints at http://localhost:3284/docs.
2551

2652
There are 4 endpoints:
2753

2854
- GET `/messages` - returns a list of all messages in the conversation with the agent
2955
- POST `/message` - sends a message to the agent. When a 200 response is returned, AgentAPI has detected that the agent started processing the message
30-
- GET `/status` - returns the current status of the agent, either "waiting_for_input" or "running"
31-
- GET `/events` - an SSE stream of events from the agent: new messages and status updates
56+
- GET `/status` - returns the current status of the agent, either "stable" or "running"
57+
- GET `/events` - an SSE stream of events from the agent: message and status updates
58+
59+
### `agentapi attach`
60+
61+
Attach to a running agent's terminal session.
62+
63+
```bash
64+
agentapi attach --url localhost:3284
65+
```
66+
67+
Press `ctrl+c` to detach from the session.
3268

3369
## How it works
3470

35-
AgentAPI runs an in-memory terminal emulator. It translates API calls into appropriate terminal keystrokes, and parses the agent's outputs into individual messages using a set of heuristics.
71+
AgentAPI runs an in-memory terminal emulator. It translates API calls into appropriate terminal keystrokes, and parses the agent's outputs into individual messages. At the time of writing, none of the agents expose a native HTTP API. Once they do, AgentAPI will be updated to support them.

0 commit comments

Comments
 (0)