Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AgentAPI

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.
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), [Auggie](https://docs.augmentcode.com/cli/overview), and [Cursor CLI](https://cursor.com/en/cli) with an HTTP API.

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

Expand Down
2 changes: 2 additions & 0 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
AgentTypeAmp AgentType = msgfmt.AgentTypeAmp
AgentTypeCursorAgent AgentType = msgfmt.AgentTypeCursorAgent
AgentTypeCursor AgentType = msgfmt.AgentTypeCursor
AgentTypeAuggie AgentType = msgfmt.AgentTypeAuggie
AgentTypeCustom AgentType = msgfmt.AgentTypeCustom
)

Expand All @@ -44,6 +45,7 @@ var agentTypeMap = map[AgentType]bool{
AgentTypeAmp: true,
AgentTypeCursorAgent: true,
AgentTypeCursor: true,
AgentTypeAuggie: true,
AgentTypeCustom: true,
}

Expand Down
10 changes: 10 additions & 0 deletions cmd/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func TestParseAgentType(t *testing.T) {
agentTypeVar: "",
want: AgentTypeCursor,
},
{
firstArg: "auggie",
agentTypeVar: "",
want: AgentTypeAuggie,
},
{
firstArg: "amp",
agentTypeVar: "",
Expand Down Expand Up @@ -102,6 +107,11 @@ func TestParseAgentType(t *testing.T) {
agentTypeVar: "cursor",
want: AgentTypeCursor,
},
{
firstArg: "claude",
agentTypeVar: "auggie",
want: AgentTypeAuggie,
},
{
firstArg: "aider",
agentTypeVar: "claude",
Expand Down
3 changes: 3 additions & 0 deletions lib/msgfmt/msgfmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ const (
AgentTypeAmp AgentType = "amp"
AgentTypeCursorAgent AgentType = "cursor-agent"
AgentTypeCursor AgentType = "cursor"
AgentTypeAuggie AgentType = "auggie"
AgentTypeCustom AgentType = "custom"
)

Expand Down Expand Up @@ -268,6 +269,8 @@ func FormatAgentMessage(agentType AgentType, message string, userInput string) s
return formatGenericMessage(message, userInput, agentType)
case AgentTypeCursor:
return formatGenericMessage(message, userInput, agentType)
case AgentTypeAuggie:
return formatGenericMessage(message, userInput, agentType)
case AgentTypeCustom:
return formatGenericMessage(message, userInput, agentType)
default:
Expand Down
2 changes: 1 addition & 1 deletion lib/msgfmt/msgfmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func TestTrimEmptyLines(t *testing.T) {

func TestFormatAgentMessage(t *testing.T) {
dir := "testdata/format"
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeGemini, AgentTypeAmp, AgentTypeCodex, AgentTypeCustom}
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeGemini, AgentTypeAmp, AgentTypeCodex, AgentTypeCursorAgent, AgentTypeCursor, AgentTypeAuggie, AgentTypeCustom}
for _, agentType := range agentTypes {
t.Run(string(agentType), func(t *testing.T) {
cases, err := testdataDir.ReadDir(path.Join(dir, string(agentType)))
Expand Down
7 changes: 7 additions & 0 deletions lib/msgfmt/testdata/format/auggie/first_message/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Getting started with Auggie by Augment Code
1. You can ask questions, edit files, or run commands
2. Your workspace is automatically indexed for best results
3. Commands will run automatically


💡 For automation, use 'auggie --print "your task"'
19 changes: 19 additions & 0 deletions lib/msgfmt/testdata/format/auggie/first_message/msg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


Getting started with Auggie by Augment Code
1. You can ask questions, edit files, or run commands
2. Your workspace is automatically indexed for best results
3. Commands will run automatically


💡 For automation, use 'auggie --print "your task"'




╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ › Try 'how do I log an error?' or type / for commands │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Type / for commands • ↑↓ for history • Esc/Ctrl+C to interrupt ~/Documents/work/agentapi


Empty file.
45 changes: 45 additions & 0 deletions lib/msgfmt/testdata/format/auggie/multi-line-input/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Getting started with Auggie by Augment Code
1. You can ask questions, edit files, or run commands
2. Your workspace is automatically indexed for best results
3. Commands will run automatically


💡 For automation, use 'auggie --print "your task"'




────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
› Which file has this snippet
func formatCodexMessage(message string, userInput string) string {
message = RemoveUserInput(message, userInput, AgentTypeCodex)
message = removeCodexInputBox(message)
message = trimEmptyLines(message)
return message
}
» I'll search for the file containing that specific function snippet.
» Codebase search - context engine
⎿ Find the file that contains the function "formatCodexMessage" with the exact signature "func formatCodexMessage(message string, userInput string) string" and implementation that calls RemoveUserInput,
removeCodexInputBox, and trimEmptyLines
⎿ Found 12 files
lib/msgfmt/testdata/format/codex/multi-line-input/user.txt
lib/msgfmt/testdata/format/codex/multi-line-input/msg.txt
lib/msgfmt/msgfmt.go
lib/msgfmt/testdata/format/auggie/multi-line-input/user.txt
lib/msgfmt/testdata/format/cursor/multi-line-input/user.txt
lib/msgfmt/message_box.go
lib/msgfmt/testdata/format/cursor/multi-line-input/msg.txt
lib/msgfmt/testdata/format/auggie/multi-line-input/msg.txt
lib/msgfmt/testdata/format/codex/multi-line-input/expected.txt
lib/msgfmt/testdata/format/cursor/multi-line-input/expected.txt
+2 more lines

» The function formatCodexMessage is located in the file `lib/msgfmt/msgfmt.go` at lines 247-252.
»
lib/msgfmt/msgfmt.go (EXCERPT)
func formatCodexMessage(message string, userInput string) string {
» message = RemoveUserInput(message, userInput, AgentTypeCodex)
message = removeCodexInputBox(message)
message = trimEmptyLines(message)
return message
}
55 changes: 55 additions & 0 deletions lib/msgfmt/testdata/format/auggie/multi-line-input/msg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@


Getting started with Auggie by Augment Code
1. You can ask questions, edit files, or run commands
2. Your workspace is automatically indexed for best results
3. Commands will run automatically


💡 For automation, use 'auggie --print "your task"'




────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
› Which file has this snippet
func formatCodexMessage(message string, userInput string) string {
message = RemoveUserInput(message, userInput, AgentTypeCodex)
message = removeCodexInputBox(message)
message = trimEmptyLines(message)
return message
}
» I'll search for the file containing that specific function snippet.
» Codebase search - context engine
⎿ Find the file that contains the function "formatCodexMessage" with the exact signature "func formatCodexMessage(message string, userInput string) string" and implementation that calls RemoveUserInput,
removeCodexInputBox, and trimEmptyLines
⎿ Found 12 files
lib/msgfmt/testdata/format/codex/multi-line-input/user.txt
lib/msgfmt/testdata/format/codex/multi-line-input/msg.txt
lib/msgfmt/msgfmt.go
lib/msgfmt/testdata/format/auggie/multi-line-input/user.txt
lib/msgfmt/testdata/format/cursor/multi-line-input/user.txt
lib/msgfmt/message_box.go
lib/msgfmt/testdata/format/cursor/multi-line-input/msg.txt
lib/msgfmt/testdata/format/auggie/multi-line-input/msg.txt
lib/msgfmt/testdata/format/codex/multi-line-input/expected.txt
lib/msgfmt/testdata/format/cursor/multi-line-input/expected.txt
+2 more lines

» The function formatCodexMessage is located in the file `lib/msgfmt/msgfmt.go` at lines 247-252.
»
lib/msgfmt/msgfmt.go (EXCERPT)
func formatCodexMessage(message string, userInput string) string {
» message = RemoveUserInput(message, userInput, AgentTypeCodex)
message = removeCodexInputBox(message)
message = trimEmptyLines(message)
return message
}




╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ › Try 'how do I log an error?' or type / for commands │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Type / for commands • ↑↓ for history • Esc/Ctrl+C to interrupt ~/Documents/work/agentapi
7 changes: 7 additions & 0 deletions lib/msgfmt/testdata/format/auggie/multi-line-input/user.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Which file has this snippet
func formatCodexMessage(message string, userInput string) string {
message = RemoveUserInput(message, userInput)
message = removeCodexInputBox(message)
message = trimEmptyLines(message)
return message
}
60 changes: 60 additions & 0 deletions lib/msgfmt/testdata/format/auggie/second_message/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Getting started with Auggie by Augment Code
1. You can ask questions, edit files, or run commands
2. Your workspace is automatically indexed for best results
3. Commands will run automatically


💡 For automation, use 'auggie --print "your task"'
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
› Which repo is this ?

» I'll help you identify what repository this is by examining the codebase structure and contents.
» . - read file
⎿ Read 40 lines
./CHANGELOG.md
./LICENSE
./Makefile
./README.md
./agentapi
./chat
./cmd
./example.txt
./forge.yaml
./go.mod
+30 more lines

» Let me check the README and other key files to identify this repository.
» README.md - read file
⎿ Read 188 lines
1 # AgentAPI
2
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.
4
5 ![agentapi-chat](https://github.com/user-attachments/assets/57032c9f-4146-4b66-b219-09e38ab7690d)
6
7 You can use AgentAPI:
8
9 - to build a unified chat interface for coding agents
10 - as a backend in an MCP server that lets one agent control another coding agent
+178 more lines

» This is the AgentAPI repository by Coder.

AgentAPI is a tool that provides an HTTP API to control various coding agents including:
• Claude Code
• Goose
• Aider
• Gemini CLI
• Sourcegraph Amp
• Codex
• Cursor CLI

The repository is written in Go (as evidenced by the go.mod file) and includes:
• A server component that runs agents in a terminal emulator
• A web chat interface (in the /chat directory using Next.js)
• HTTP endpoints for sending messages and getting conversation history
• Terminal attachment functionality

The main purpose is to provide a unified interface for controlling different coding agents programmatically, making it easier to build applications that work with multiple AI coding assistants.
Loading