Setup Gemini integration - API key, CLI check, and scripts
Configures Gemini integration by checking CLI, managing API keys, and copying review scripts.
/plugin marketplace add sharpner/claude-agents/plugin install workflow-core@sharpner-claude-agentsSetting up Gemini integration for AI-assisted code reviews.
which gemini || echo "NOT INSTALLED"
If not installed, inform user:
npm install -g @google/generative-ai-cliecho "${GEMINI_API_KEY:-NOT_SET}"
If NOT_SET, ask user:
Frage den User: "Hast du einen Gemini API Key?
Get one from: https://aistudio.google.com/apikey
Bitte gib deinen Gemini API Key ein (oder 'skip' zum Überspringen):"
When user provides key, add to shell config:
# Detect shell config
SHELL_CONFIG="$HOME/.zshrc"
[ ! -f "$SHELL_CONFIG" ] && SHELL_CONFIG="$HOME/.bashrc"
[ ! -f "$SHELL_CONFIG" ] && SHELL_CONFIG="$HOME/.bash_profile"
# Add to config
echo "" >> "$SHELL_CONFIG"
echo "# Gemini API Key (added by claude-agents)" >> "$SHELL_CONFIG"
echo "export GEMINI_API_KEY=\"<USER_PROVIDED_KEY>\"" >> "$SHELL_CONFIG"
echo "✅ Added to $SHELL_CONFIG"
echo "Run: source $SHELL_CONFIG"
Copy Gemini scripts to project:
mkdir -p scripts
# Get scripts from plugin or GitHub
PLUGIN_DIR="$(find ~/.claude/plugins -name 'gemini-review.sh' -path '*workflow-core*' | head -1 | xargs dirname)"
if [ -d "$PLUGIN_DIR" ]; then
cp "$PLUGIN_DIR/gemini-review.sh" scripts/
cp "$PLUGIN_DIR/gemini-subagent-impersonation.sh" scripts/
cp "$PLUGIN_DIR/gemini-research.sh" scripts/
chmod +x scripts/gemini-*.sh
echo "✅ Scripts copied to scripts/"
else
echo "Downloading scripts from GitHub..."
curl -sL https://raw.githubusercontent.com/sharpner/claude-agents/main/plugins/workflow-core/scripts/gemini-review.sh -o scripts/gemini-review.sh
curl -sL https://raw.githubusercontent.com/sharpner/claude-agents/main/plugins/workflow-core/scripts/gemini-subagent-impersonation.sh -o scripts/gemini-subagent-impersonation.sh
curl -sL https://raw.githubusercontent.com/sharpner/claude-agents/main/plugins/workflow-core/scripts/gemini-research.sh -o scripts/gemini-research.sh
chmod +x scripts/gemini-*.sh
echo "✅ Scripts downloaded to scripts/"
fi
Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Gemini Setup Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Gemini CLI: [installed/not installed]
API Key: [configured/not configured]
Scripts: scripts/gemini-*.sh
Usage:
./scripts/gemini-review.sh <pr-number>
./scripts/gemini-subagent-impersonation.sh <pr> <agent>
./scripts/gemini-research.sh "<topic>"
Don't forget: source ~/.zshrc (if API key was added)