Skip to content

feat: add Google Gemini provider support#28

Open
0Baris wants to merge 2 commits intof:masterfrom
0Baris:master
Open

feat: add Google Gemini provider support#28
0Baris wants to merge 2 commits intof:masterfrom
0Baris:master

Conversation

@0Baris
Copy link

@0Baris 0Baris commented Feb 27, 2026

What

Adds Google Gemini as a fourth AI provider alongside OpenAI, Ollama, and
Claude Code. Default model is gemini-2.5-flash-lite.

Changes

New provider

  • src/providers/gemini.tsGeminiProvider using @google/generative-ai
    with temperature: 0.3 and maxOutputTokens: 200

Wiring

  • src/providers/types.ts — added 'gemini' to ProviderOptions.provider
    union type
  • src/providers/index.ts — factory routes to GeminiProvider, reads
    GEMINI_API_KEY env var
  • src/index.ts — added 'gemini' to RewriteOptions.provider union type,
    added gemini-2.5-flash-lite to default model resolution chain, fixed
    execCommand to use stdio: ['pipe', 'pipe', 'pipe']

CLI

  • src/cli.ts — updated --provider description, --api-key description,
    --model description; added Gemini API key validation error, informational
    message, help text, and usage examples

Other

  • .env.example — added GEMINI_API_KEY entry
  • package.json — added @google/generative-ai ^0.24.1 dependency

Usage

export GEMINI_API_KEY="your-api-key"
git-rewrite-commits --provider gemini

# or with a specific model
git-rewrite-commits --provider gemini --model gemini-2.5-flash-lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant