Skip to content

Commit 1ef1870

Browse files
authored
feat: Add Gemini support (#145)
This PR introduces support for Google's Gemini as a new AI assistant in Claude Squad. ### Changes - **Gemini Integration:** - The application can now detect and use the `gemini` command-line tool if it's available on the user's system. - Tmux sessions are now configured to properly handle Gemini's prompts and output. - **Documentation:** - The `README.md` has been updated to include instructions on how to use Gemini with `cs`. - `CONTRIBUTING.md` now includes a guide for adding new AI assistants in the future. This allows users to leverage Gemini's capabilities within the existing Claude Squad workflow, expanding the tool's versatility.
1 parent c7c39fd commit 1ef1870

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Claude Squad [![CI](https://github.com/smtg-ai/claude-squad/actions/workflows/build.yml/badge.svg)](https://github.com/smtg-ai/claude-squad/actions/workflows/build.yml) [![GitHub Release](https://img.shields.io/github/v/release/smtg-ai/claude-squad)](https://github.com/smtg-ai/claude-squad/releases/latest)
22

3-
[Claude Squad](https://smtg-ai.github.io/claude-squad/) is a terminal app that manages multiple [Claude Code](https://github.com/anthropics/claude-code), [Codex](https://github.com/openai/codex) (and other local agents including [Aider](https://github.com/Aider-AI/aider)) in separate workspaces, allowing you to work on multiple tasks simultaneously.
3+
[Claude Squad](https://smtg-ai.github.io/claude-squad/) is a terminal app that manages multiple [Claude Code](https://github.com/anthropics/claude-code), [Codex](https://github.com/openai/codex), [Gemini](https://github.com/google/generative-ai-docs) (and other local agents including [Aider](https://github.com/Aider-AI/aider)) in separate workspaces, allowing you to work on multiple tasks simultaneously.
44

55

66
![Claude Squad Screenshot](assets/screenshot.png)
@@ -82,6 +82,7 @@ cs
8282
- Launch with specific assistants:
8383
- Codex: `cs -p "codex"`
8484
- Aider: `cs -p "aider ..."`
85+
- Gemini: `cs -p "gemini"`
8586
- Make this the default, by modifying the config file (locate with `cs debug`)
8687

8788
<br />

session/tmux/tmux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
const ProgramClaude = "claude"
2323

2424
const ProgramAider = "aider"
25+
const ProgramGemini = "gemini"
2526

2627
// TmuxSession represents a managed tmux session
2728
type TmuxSession struct {
@@ -128,7 +129,7 @@ func (t *TmuxSession) Start(workDir string) error {
128129
return fmt.Errorf("error restoring tmux session: %w", err)
129130
}
130131

131-
if t.program == ProgramClaude || strings.HasPrefix(t.program, ProgramAider) {
132+
if t.program == ProgramClaude || strings.HasPrefix(t.program, ProgramAider) || strings.HasPrefix(t.program, ProgramGemini) {
132133
searchString := "Do you trust the files in this folder?"
133134
tapFunc := t.TapEnter
134135
iterations := 5
@@ -220,6 +221,8 @@ func (t *TmuxSession) HasUpdated() (updated bool, hasPrompt bool) {
220221
hasPrompt = strings.Contains(content, "No, and tell Claude what to do differently")
221222
} else if strings.HasPrefix(t.program, ProgramAider) {
222223
hasPrompt = strings.Contains(content, "(Y)es/(N)o/(D)on't ask again")
224+
} else if strings.HasPrefix(t.program, ProgramGemini) {
225+
hasPrompt = strings.Contains(content, "Yes, allow once")
223226
}
224227

225228
if !bytes.Equal(t.monitor.hash(content), t.monitor.prevOutputHash) {

0 commit comments

Comments
 (0)