# Linux/macOS
export GEMINI_API_KEY=your_key_here
# Windows (PowerShell)
$env:GEMINI_API_KEY = "your_key_here"
# Windows (CMD)
set GEMINI_API_KEY=your_key_here
Permanent Setup
# Add to ~/.bashrc or ~/.zshrc
echo 'export GEMINI_API_KEY=your_key_here' >> ~/.bashrc
source ~/.bashrc
Usage
CLI
# Auto-detected from env
capyseo analyze ./dist --ai
# Explicit provider
capyseo analyze ./dist --ai --ai-provider gemini
# Specific model
capyseo analyze ./dist --ai --ai-provider gemini --ai-model gemini-2.5-pro
import { SEOAnalyzer, GeminiProvider } from '@capyseo/core';
const analyzer = new SEOAnalyzer({
aiProvider: 'gemini',
aiApiKey: process.env.GEMINI_API_KEY,
aiModel: 'gemini-2.5-flash',
});
Available Models
Model
Speed
Quality
Cost
gemini-2.5-flash
Fast
Good
Low
gemini-2.5-pro
Slower
Best
Higher
Recommended:gemini-2.5-flash for most use cases.
Features
Meta Description Generation
[x] [meta-description] Missing meta description
AI Suggestion: "Build modern web applications with our
comprehensive React tutorial. Learn hooks, state management,
and best practices for production-ready code."
Alt Text Generation
[!] [image-alt] Image missing alt: hero.jpg
AI Suggestion: "Developer typing on laptop with code
editor open showing React components"