Skip to content

Commit fbfebdc

Browse files
committed
feat: add explicit support for Gemini agent in API and update documentation
1 parent 5236ce9 commit fbfebdc

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
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), 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) and [Codex](https://github.com/openai/codex) with an HTTP API.
44

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

cmd/root.go

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

cmd/server/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
AgentTypeGoose AgentType = msgfmt.AgentTypeGoose
3535
AgentTypeAider AgentType = msgfmt.AgentTypeAider
3636
AgentTypeCodex AgentType = msgfmt.AgentTypeCodex
37+
AgentTypeGemini AgentType = msgfmt.AgentTypeGemini
3738
AgentTypeCustom AgentType = msgfmt.AgentTypeCustom
3839
)
3940

@@ -46,6 +47,8 @@ func parseAgentType(firstArg string, agentTypeVar string) (AgentType, error) {
4647
agentType = AgentTypeGoose
4748
case string(AgentTypeAider):
4849
agentType = AgentTypeAider
50+
case string(AgentTypeGemini):
51+
agentType = AgentTypeGemini
4952
case string(AgentTypeCustom):
5053
agentType = AgentTypeCustom
5154
case string(AgentTypeCodex):
@@ -68,6 +71,8 @@ func parseAgentType(firstArg string, agentTypeVar string) (AgentType, error) {
6871
agentType = AgentTypeAider
6972
case string(AgentTypeCodex):
7073
agentType = AgentTypeCodex
74+
case string(AgentTypeGemini):
75+
agentType = AgentTypeGemini
7176
default:
7277
agentType = AgentTypeCustom
7378
}
@@ -137,7 +142,7 @@ func runServer(ctx context.Context, logger *slog.Logger, argsToPass []string) er
137142
var ServerCmd = &cobra.Command{
138143
Use: "server [agent]",
139144
Short: "Run the server",
140-
Long: `Run the server with the specified agent (claude, goose, aider, codex)`,
145+
Long: `Run the server with the specified agent (claude, goose, aider, gemini, codex)`,
141146
Args: cobra.MinimumNArgs(1),
142147
Run: func(cmd *cobra.Command, args []string) {
143148
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))

lib/msgfmt/msgfmt.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ const (
205205
AgentTypeGoose AgentType = "goose"
206206
AgentTypeAider AgentType = "aider"
207207
AgentTypeCodex AgentType = "codex"
208+
AgentTypeGemini AgentType = "gemini"
208209
AgentTypeCustom AgentType = "custom"
209210
)
210211

@@ -226,6 +227,8 @@ func FormatAgentMessage(agentType AgentType, message string, userInput string) s
226227
return formatGenericMessage(message, userInput)
227228
case AgentTypeCodex:
228229
return formatGenericMessage(message, userInput)
230+
case AgentTypeGemini:
231+
return formatGenericMessage(message, userInput)
229232
case AgentTypeCustom:
230233
return formatGenericMessage(message, userInput)
231234
default:

0 commit comments

Comments
 (0)