Skip to content

Commit 1773868

Browse files
authored
feat: add support for auggie cli (#63)
1 parent 3dbdc35 commit 1773868

File tree

17 files changed

+384
-2
lines changed

17 files changed

+384
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
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), [Codex](https://github.com/openai/codex), and [Cursor CLI](https://cursor.com/en/cli) 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), [Auggie](https://docs.augmentcode.com/cli/overview), 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

cmd/server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const (
3131
AgentTypeAmp AgentType = msgfmt.AgentTypeAmp
3232
AgentTypeCursorAgent AgentType = msgfmt.AgentTypeCursorAgent
3333
AgentTypeCursor AgentType = msgfmt.AgentTypeCursor
34+
AgentTypeAuggie AgentType = msgfmt.AgentTypeAuggie
3435
AgentTypeCustom AgentType = msgfmt.AgentTypeCustom
3536
)
3637

@@ -44,6 +45,7 @@ var agentTypeMap = map[AgentType]bool{
4445
AgentTypeAmp: true,
4546
AgentTypeCursorAgent: true,
4647
AgentTypeCursor: true,
48+
AgentTypeAuggie: true,
4749
AgentTypeCustom: true,
4850
}
4951

cmd/server/server_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ func TestParseAgentType(t *testing.T) {
5757
agentTypeVar: "",
5858
want: AgentTypeCursor,
5959
},
60+
{
61+
firstArg: "auggie",
62+
agentTypeVar: "",
63+
want: AgentTypeAuggie,
64+
},
6065
{
6166
firstArg: "amp",
6267
agentTypeVar: "",
@@ -102,6 +107,11 @@ func TestParseAgentType(t *testing.T) {
102107
agentTypeVar: "cursor",
103108
want: AgentTypeCursor,
104109
},
110+
{
111+
firstArg: "claude",
112+
agentTypeVar: "auggie",
113+
want: AgentTypeAuggie,
114+
},
105115
{
106116
firstArg: "aider",
107117
agentTypeVar: "claude",

lib/msgfmt/msgfmt.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ const (
233233
AgentTypeAmp AgentType = "amp"
234234
AgentTypeCursorAgent AgentType = "cursor-agent"
235235
AgentTypeCursor AgentType = "cursor"
236+
AgentTypeAuggie AgentType = "auggie"
236237
AgentTypeCustom AgentType = "custom"
237238
)
238239

@@ -268,6 +269,8 @@ func FormatAgentMessage(agentType AgentType, message string, userInput string) s
268269
return formatGenericMessage(message, userInput, agentType)
269270
case AgentTypeCursor:
270271
return formatGenericMessage(message, userInput, agentType)
272+
case AgentTypeAuggie:
273+
return formatGenericMessage(message, userInput, agentType)
271274
case AgentTypeCustom:
272275
return formatGenericMessage(message, userInput, agentType)
273276
default:

lib/msgfmt/msgfmt_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func TestTrimEmptyLines(t *testing.T) {
218218

219219
func TestFormatAgentMessage(t *testing.T) {
220220
dir := "testdata/format"
221-
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeGemini, AgentTypeAmp, AgentTypeCodex, AgentTypeCustom}
221+
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeGemini, AgentTypeAmp, AgentTypeCodex, AgentTypeCursorAgent, AgentTypeCursor, AgentTypeAuggie, AgentTypeCustom}
222222
for _, agentType := range agentTypes {
223223
t.Run(string(agentType), func(t *testing.T) {
224224
cases, err := testdataDir.ReadDir(path.Join(dir, string(agentType)))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Getting started with Auggie by Augment Code
2+
1. You can ask questions, edit files, or run commands
3+
2. Your workspace is automatically indexed for best results
4+
3. Commands will run automatically
5+
6+
7+
💡 For automation, use 'auggie --print "your task"'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
Getting started with Auggie by Augment Code
4+
1. You can ask questions, edit files, or run commands
5+
2. Your workspace is automatically indexed for best results
6+
3. Commands will run automatically
7+
8+
9+
💡 For automation, use 'auggie --print "your task"'
10+
11+
12+
13+
14+
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
15+
│ › Try 'how do I log an error?' or type / for commands │
16+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
17+
Type / for commands • ↑↓ for history • Esc/Ctrl+C to interrupt ~/Documents/work/agentapi
18+
19+

lib/msgfmt/testdata/format/auggie/first_message/user.txt

Whitespace-only changes.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Getting started with Auggie by Augment Code
2+
1. You can ask questions, edit files, or run commands
3+
2. Your workspace is automatically indexed for best results
4+
3. Commands will run automatically
5+
6+
7+
💡 For automation, use 'auggie --print "your task"'
8+
9+
10+
11+
12+
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
13+
› Which file has this snippet
14+
func formatCodexMessage(message string, userInput string) string {
15+
message = RemoveUserInput(message, userInput, AgentTypeCodex)
16+
message = removeCodexInputBox(message)
17+
message = trimEmptyLines(message)
18+
return message
19+
}
20+
» I'll search for the file containing that specific function snippet.
21+
» Codebase search - context engine
22+
⎿ Find the file that contains the function "formatCodexMessage" with the exact signature "func formatCodexMessage(message string, userInput string) string" and implementation that calls RemoveUserInput,
23+
removeCodexInputBox, and trimEmptyLines
24+
⎿ Found 12 files
25+
lib/msgfmt/testdata/format/codex/multi-line-input/user.txt
26+
lib/msgfmt/testdata/format/codex/multi-line-input/msg.txt
27+
lib/msgfmt/msgfmt.go
28+
lib/msgfmt/testdata/format/auggie/multi-line-input/user.txt
29+
lib/msgfmt/testdata/format/cursor/multi-line-input/user.txt
30+
lib/msgfmt/message_box.go
31+
lib/msgfmt/testdata/format/cursor/multi-line-input/msg.txt
32+
lib/msgfmt/testdata/format/auggie/multi-line-input/msg.txt
33+
lib/msgfmt/testdata/format/codex/multi-line-input/expected.txt
34+
lib/msgfmt/testdata/format/cursor/multi-line-input/expected.txt
35+
+2 more lines
36+
37+
» The function formatCodexMessage is located in the file `lib/msgfmt/msgfmt.go` at lines 247-252.
38+
»
39+
lib/msgfmt/msgfmt.go (EXCERPT)
40+
func formatCodexMessage(message string, userInput string) string {
41+
» message = RemoveUserInput(message, userInput, AgentTypeCodex)
42+
message = removeCodexInputBox(message)
43+
message = trimEmptyLines(message)
44+
return message
45+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
3+
Getting started with Auggie by Augment Code
4+
1. You can ask questions, edit files, or run commands
5+
2. Your workspace is automatically indexed for best results
6+
3. Commands will run automatically
7+
8+
9+
💡 For automation, use 'auggie --print "your task"'
10+
11+
12+
13+
14+
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
15+
› Which file has this snippet
16+
func formatCodexMessage(message string, userInput string) string {
17+
message = RemoveUserInput(message, userInput, AgentTypeCodex)
18+
message = removeCodexInputBox(message)
19+
message = trimEmptyLines(message)
20+
return message
21+
}
22+
» I'll search for the file containing that specific function snippet.
23+
» Codebase search - context engine
24+
⎿ Find the file that contains the function "formatCodexMessage" with the exact signature "func formatCodexMessage(message string, userInput string) string" and implementation that calls RemoveUserInput,
25+
removeCodexInputBox, and trimEmptyLines
26+
⎿ Found 12 files
27+
lib/msgfmt/testdata/format/codex/multi-line-input/user.txt
28+
lib/msgfmt/testdata/format/codex/multi-line-input/msg.txt
29+
lib/msgfmt/msgfmt.go
30+
lib/msgfmt/testdata/format/auggie/multi-line-input/user.txt
31+
lib/msgfmt/testdata/format/cursor/multi-line-input/user.txt
32+
lib/msgfmt/message_box.go
33+
lib/msgfmt/testdata/format/cursor/multi-line-input/msg.txt
34+
lib/msgfmt/testdata/format/auggie/multi-line-input/msg.txt
35+
lib/msgfmt/testdata/format/codex/multi-line-input/expected.txt
36+
lib/msgfmt/testdata/format/cursor/multi-line-input/expected.txt
37+
+2 more lines
38+
39+
» The function formatCodexMessage is located in the file `lib/msgfmt/msgfmt.go` at lines 247-252.
40+
»
41+
lib/msgfmt/msgfmt.go (EXCERPT)
42+
func formatCodexMessage(message string, userInput string) string {
43+
» message = RemoveUserInput(message, userInput, AgentTypeCodex)
44+
message = removeCodexInputBox(message)
45+
message = trimEmptyLines(message)
46+
return message
47+
}
48+
49+
50+
51+
52+
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
53+
│ › Try 'how do I log an error?' or type / for commands │
54+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
55+
Type / for commands • ↑↓ for history • Esc/Ctrl+C to interrupt ~/Documents/work/agentapi

0 commit comments

Comments
 (0)