Gemini
Google's Gemini agent for AI-assisted coding
Gemini is Google's multimodal AI, capable of understanding code, images, and complex technical contexts. It offers strong reasoning capabilities and integration with Google's ecosystem.
Overview
| Feature | Details |
|---|---|
| Provider | |
| CLI Tool | gemini |
| Auth Methods | API key only |
| Strengths | Multimodal, large context, Google integration |
Authentication
Gemini currently only supports API key authentication. Subscription-based auth (Google One AI Premium) requires browser interaction and isn't supported headlessly.
API Key Setup
- Go to Google AI Studio
- Click "Create API Key" or copy an existing key
- Add to Sesame:
- Per-user: Settings → API Keys → Gemini
- System-wide: Set
GEMINI_API_KEYenvironment variable
Environment Variables
| Variable | Description |
|---|---|
GEMINI_API_KEY | API key from Google AI Studio |
Capabilities
Gemini can:
- Understand and generate code in multiple languages
- Process images and diagrams (multimodal)
- Handle very large contexts (1M+ tokens)
- Reason through complex technical problems
- Generate documentation with examples
Best Practices
Large Context
Gemini excels with large contexts:
"Analyze the entire src/ directory and suggest architectural
improvements. Consider the current patterns and propose
a migration path."Multimodal Inputs
While Sesame primarily uses text, Gemini's multimodal capabilities help with:
- Understanding ASCII diagrams in comments
- Processing code that references visual concepts
- Generating documentation with diagram descriptions
Technical Documentation
Gemini is strong at documentation:
"Generate comprehensive API documentation for all public
functions in the utils/ directory, including examples
and edge cases."Troubleshooting
"API key invalid"
- Verify the key at Google AI Studio
- Ensure the key hasn't been revoked
- Check for billing issues in Google Cloud Console
"Quota exceeded"
- Free tier has limited requests per minute/day
- Check your quota at Google Cloud Console
- Consider upgrading to a paid plan
"Region not supported"
- Gemini API availability varies by region
- Check supported regions
- Use a VPN if your region isn't supported (check ToS)
Slow responses
- Gemini with large contexts can be slower
- Consider using smaller context for simple tasks
- Use Gemini Flash for faster responses
CLI Reference
# Basic usage
gemini "Your prompt here"
# Specify model
gemini --model gemini-2.0-flash "prompt"
# With system instruction
gemini --system "You are a senior engineer" "review this code"Available Models
| Model | Context | Best For |
|---|---|---|
| Gemini 2.0 Pro | 1M tokens | Complex reasoning, large codebases |
| Gemini 2.0 Flash | 1M tokens | Fast responses, general tasks |
| Gemini 1.5 Pro | 2M tokens | Maximum context length |
Pricing
| Model | Input | Output |
|---|---|---|
| Gemini 2.0 Flash | Free tier available, then ~$0.075/1M tokens | ~$0.30/1M tokens |
| Gemini 2.0 Pro | ~$1.25/1M tokens | ~$5.00/1M tokens |
| Gemini 1.5 Pro | ~$1.25/1M tokens | ~$5.00/1M tokens |
Free tier includes generous limits for experimentation. For current pricing, see Google AI Pricing.
Why No Subscription Auth?
Google One AI Premium includes Gemini access, but:
- Requires browser-based OAuth flow
- Session tokens expire frequently
- No official headless authentication method
For now, API keys are the only supported method. This may change if Google adds device auth support.