Skip to main content

Gemini Agent

Gemini is Google's AI model, offering fast responses and a generous free tier.

Overview

Gemini provides:

  • Speed - Fast response times
  • Free tier - Great for getting started
  • Efficiency - Good quality at lower cost
  • Multimodal - Can understand images

When to Use Gemini

Ideal For

  • ✅ Quick prototypes
  • ✅ Simple bug fixes
  • ✅ Documentation tasks
  • ✅ Cost-conscious projects
  • ✅ High-volume tasks

Less Ideal For

  • ⚠️ Complex multi-file changes
  • ⚠️ Security-critical code
  • ⚠️ Nuanced business logic

Setup

API Key

  1. Go to Google AI Studio
  2. Click "Get API key"
  3. Create new key or use existing
export GEMINI_API_KEY="your-gemini-api-key"

Configuration

{
"agents": {
"gemini": {
"enabled": true,
"model": "gemini-2.5-pro",
"autonomy": "workspace-write"
}
}
}

Model Options

ModelSpeedQualityCost
gemini-2.5-flashFastestGoodFree
gemini-2.5-proFastBetter$
gemini-2.0-flash-expFastGoodFree

Free Tier

Gemini offers a generous free tier:

  • 60 requests/minute (Gemini 1.5 Flash)
  • 2 requests/minute (Gemini 1.5 Pro)
  • No credit card required

Perfect for:

  • Learning Friday Dev
  • Personal projects
  • Side projects

Usage

From UI

  1. Open task
  2. Click "Run Agent"
  3. Select "Gemini"
  4. Start

From CLI

# Use default Gemini model
friday-dev run --task 123 --agent gemini

# Use specific model
friday-dev run --task 123 --agent gemini --model gemini-2.5-flash

Comparison

FeatureGeminiClaudeFriday
Speed⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Quality⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
CostFree/$$$$$$$
AutonomyMediumLowHigh

Best Practices

Task Descriptions

Gemini works well with direct instructions:

## Task
Add a loading spinner to the login button

## Instructions
1. Import Spinner from @/components/ui
2. Add isLoading state to LoginForm
3. Show spinner when isLoading is true
4. Disable button while loading

Keep It Simple

Gemini excels at focused tasks:

# Good - Single focus
Fix the TypeScript error in src/utils/date.ts line 45

# Less Good - Multiple concerns
Fix all TypeScript errors, add tests, and improve performance

Example Output

Quick Bug Fix

Task: "Fix the off-by-one error in pagination"

// Before
const startIndex = page * pageSize;
const endIndex = startIndex + pageSize;

// After - Fixed off-by-one
const startIndex = (page - 1) * pageSize; // Changed
const endIndex = startIndex + pageSize;

Documentation

Task: "Add JSDoc to the formatDate function"

/**
* Formats a date into a human-readable string.
*
* @param date - The date to format (Date object or ISO string)
* @param format - Output format ('short' | 'long' | 'relative')
* @returns Formatted date string
*
* @example
* formatDate(new Date(), 'short') // "Jan 15"
* formatDate(new Date(), 'long') // "January 15, 2024"
* formatDate(new Date(), 'relative') // "2 hours ago"
*/
export function formatDate(
date: Date | string,
format: 'short' | 'long' | 'relative' = 'short'
): string {
// ... implementation
}

Rate Limits

Free Tier Limits

ModelRequests/MinTokens/Min
Flash601M
Pro232K

Handling Limits

{
"agents": {
"gemini": {
"retryOnRateLimit": true,
"retryDelay": 60000
}
}
}

Pricing

  • No cost
  • No credit card
  • Perfect for learning

When you need more:

Troubleshooting

Rate Limit Errors

Error: 429 Too Many Requests

Solutions:

  1. Wait 60 seconds
  2. Use Gemini Flash (higher limits)
  3. Upgrade to paid tier
  4. Switch to another agent

Quality Issues

If output quality is low:

  1. Add more detail to task
  2. Use Gemini Pro instead of Flash
  3. Switch to Claude/Friday for complex tasks

API Key Issues

  1. Verify key at aistudio.google.com
  2. Check key permissions
  3. Regenerate key if needed

Next Steps