Skip to content

Commit e368adb

Browse files
committed
Merge branch 'main' into feat-agent-visual-indicator
2 parents aaf3589 + 3dbdc35 commit e368adb

File tree

28 files changed

+337
-44
lines changed

28 files changed

+337
-44
lines changed

.github/workflows/go-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
go-version: "stable"
1818

1919
- name: Test
20-
run: go test -count=1 -v ./...
20+
run: CGO_ENABLED=0 go test -count=1 -v ./...
2121

2222
lint:
2323
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
read -r goos goarch artifact_name <<< "$variant"
5151
5252
echo "Building for GOOS=$goos GOARCH=$goarch..."
53-
GOOS=$goos GOARCH=$goarch BINPATH="out/$artifact_name" make build
53+
CGO_ENABLED=0 GOOS=$goos GOARCH=$goarch BINPATH="out/$artifact_name" make build
5454
done
5555
5656
- name: Upload Build Artifact

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
## v0.5.0
4+
5+
### Features
6+
7+
- Adds support for Cursor CLI.
8+
9+
## v0.4.1
10+
11+
### Fixes
12+
13+
- Sets `CGO_ENABLED=0` in build process to improve compatibility with older Linux versions.
14+
15+
## v0.4.0
16+
17+
### Breaking changes
18+
19+
- If you're running agentapi behind a reverse proxy, you'll now likely need to set the `--allowed-hosts` flag. See the [README](./README.md) for more details.
20+
21+
### New features
22+
23+
- Sourcegraph Amp support
24+
- Added a new `--allowed-hosts` flag to the `server` command.
25+
26+
### Fixes
27+
28+
- Updated Codex support after its TUI has been updated in a recent version.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ embed: $(CHAT_SOURCES_STAMP)
1717

1818
.PHONY: build
1919
build: embed
20-
go build -o ${BINPATH} main.go
20+
CGO_ENABLED=0 go build -o ${BINPATH} main.go

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AgentAPI
22

3-
Control [Claude Code](https://github.com/anthropics/claude-code), [Goose](https://github.com/block/goose), [Aider](https://github.com/Aider-AI/aider), [Gemini](https://github.com/google-gemini/gemini-cli), [Sourcegraph Amp](https://github.com/sourcegraph/amp-cli) and [Codex](https://github.com/openai/codex) with an HTTP API.
3+
Control [Claude Code](https://github.com/anthropics/claude-code), [Goose](https://github.com/block/goose), [Aider](https://github.com/Aider-AI/aider), [Gemini](https://github.com/google-gemini/gemini-cli), [Sourcegraph Amp](https://github.com/sourcegraph/amp-cli), [Codex](https://github.com/openai/codex), and [Cursor CLI](https://cursor.com/en/cli) with an HTTP API.
44

55
![agentapi-chat](https://github.com/user-attachments/assets/57032c9f-4146-4b66-b219-09e38ab7690d)
66

@@ -65,7 +65,7 @@ agentapi server -- goose
6565
```
6666

6767
> [!NOTE]
68-
> When using Codex, always specify the agent type explicitly (`agentapi server --type=codex -- codex`), or message formatting may break.
68+
> When using Codex, Gemini or CursorCLI, always specify the agent type explicitly (eg: `agentapi server --type=codex -- codex`), or message formatting may break.
6969
7070
An OpenAPI schema is available in [openapi.json](openapi.json).
7171

chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chat",
3-
"version": "0.3.3",
3+
"version": "0.5.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev --turbopack",

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var rootCmd = &cobra.Command{
1313
Use: "agentapi",
1414
Short: "AgentAPI CLI",
1515
Long: `AgentAPI - HTTP API for Claude Code, Goose, Aider, Gemini and Codex`,
16-
Version: "0.3.3",
16+
Version: "0.4.1",
1717
}
1818

1919
func Execute() {

cmd/server/server.go

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,28 @@ import (
2323
type AgentType = msgfmt.AgentType
2424

2525
const (
26-
AgentTypeClaude AgentType = msgfmt.AgentTypeClaude
27-
AgentTypeGoose AgentType = msgfmt.AgentTypeGoose
28-
AgentTypeAider AgentType = msgfmt.AgentTypeAider
29-
AgentTypeCodex AgentType = msgfmt.AgentTypeCodex
30-
AgentTypeGemini AgentType = msgfmt.AgentTypeGemini
31-
AgentTypeAmp AgentType = msgfmt.AgentTypeAmp
32-
AgentTypeCustom AgentType = msgfmt.AgentTypeCustom
26+
AgentTypeClaude AgentType = msgfmt.AgentTypeClaude
27+
AgentTypeGoose AgentType = msgfmt.AgentTypeGoose
28+
AgentTypeAider AgentType = msgfmt.AgentTypeAider
29+
AgentTypeCodex AgentType = msgfmt.AgentTypeCodex
30+
AgentTypeGemini AgentType = msgfmt.AgentTypeGemini
31+
AgentTypeAmp AgentType = msgfmt.AgentTypeAmp
32+
AgentTypeCursorAgent AgentType = msgfmt.AgentTypeCursorAgent
33+
AgentTypeCursor AgentType = msgfmt.AgentTypeCursor
34+
AgentTypeCustom AgentType = msgfmt.AgentTypeCustom
3335
)
3436

3537
// exhaustiveness of this map is checked by the exhaustive linter
3638
var agentTypeMap = map[AgentType]bool{
37-
AgentTypeClaude: true,
38-
AgentTypeGoose: true,
39-
AgentTypeAider: true,
40-
AgentTypeCodex: true,
41-
AgentTypeGemini: true,
42-
AgentTypeAmp: true,
43-
AgentTypeCustom: true,
39+
AgentTypeClaude: true,
40+
AgentTypeGoose: true,
41+
AgentTypeAider: true,
42+
AgentTypeCodex: true,
43+
AgentTypeGemini: true,
44+
AgentTypeAmp: true,
45+
AgentTypeCursorAgent: true,
46+
AgentTypeCursor: true,
47+
AgentTypeCustom: true,
4448
}
4549

4650
func parseAgentType(firstArg string, agentTypeVar string) (AgentType, error) {

cmd/server/server_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ func TestParseAgentType(t *testing.T) {
4747
agentTypeVar: "",
4848
want: AgentTypeGemini,
4949
},
50+
{
51+
firstArg: "cursor-agent",
52+
agentTypeVar: "",
53+
want: AgentTypeCursorAgent,
54+
},
55+
{
56+
firstArg: "cursor",
57+
agentTypeVar: "",
58+
want: AgentTypeCursor,
59+
},
5060
{
5161
firstArg: "amp",
5262
agentTypeVar: "",
@@ -82,6 +92,16 @@ func TestParseAgentType(t *testing.T) {
8292
agentTypeVar: "gemini",
8393
want: AgentTypeGemini,
8494
},
95+
{
96+
firstArg: "claude",
97+
agentTypeVar: "cursor-agent",
98+
want: AgentTypeCursorAgent,
99+
},
100+
{
101+
firstArg: "claude",
102+
agentTypeVar: "cursor",
103+
want: AgentTypeCursor,
104+
},
85105
{
86106
firstArg: "aider",
87107
agentTypeVar: "claude",

lib/httpapi/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func NewServer(ctx context.Context, config ServerConfig) (*Server, error) {
188188
})
189189
router.Use(corsMiddleware.Handler)
190190

191-
humaConfig := huma.DefaultConfig("AgentAPI", "0.3.3")
191+
humaConfig := huma.DefaultConfig("AgentAPI", "0.5.0")
192192
humaConfig.Info.Description = "HTTP API for Claude Code, Goose, and Aider.\n\nhttps://github.com/coder/agentapi"
193193
api := humachi.New(router, humaConfig)
194194
formatMessage := func(message string, userInput string) string {

0 commit comments

Comments
 (0)