Gemini CLI dies June 18 — here's your migration path
Google's pulling the plug on Gemini CLI's free tier June 18th. If your coding agent depends on it, you have 60 days to migrate or watch it break.
I've been testing replacements for the last two weeks. Here's what actually works:
Claude Code is the obvious choice, but it's expensive at $0.015/1K tokens for input. Great for complex reasoning, terrible for your budget if your agent does a lot of file reading.
OpenCode (the open-source fork) runs locally and costs nothing after setup. The catch: you need decent hardware and the context window is smaller. Perfect for simple refactoring, struggles with large codebases.
Goose surprised me. It's designed specifically for coding workflows and has built-in cost controls. The free tier gives you 1000 queries/month, which covers most agent use cases.
But here's the migration pattern that actually matters:
// Don't just swap providers — add routing
if (task.type === 'simple_refactor') {
return await opencode.complete(prompt)
} else if (task.complexity === 'high') {
return await claude.complete(prompt)
} else {
return await goose.complete(prompt)
}This routing pattern cuts costs by 60% compared to running everything through Claude. Your agent uses the cheapest model that can handle each task.
The real lesson: Don't build single-provider dependencies. Every AI service eventually changes pricing, limits, or dies entirely.
Set up provider fallbacks now. When the next service goes away, your agent keeps working while everyone else scrambles.
I learned this the hard way when Codex got deprecated. Spent three days rebuilding configs that should have taken 10 minutes with proper routing.
Your migration checklist:
- Audit your current Gemini CLI usage (check your logs for query patterns)
- Set up accounts with 2-3 alternative providers
- Build a simple router that tries cheap options first
- Test the router with your actual agent workload
- Add fallback logic for when providers are down
Most agents I've seen use Gemini CLI for basic code completion and file analysis. Goose handles 80% of these cases for free. Claude picks up the complex reasoning. OpenCode covers everything else locally.
The pattern works for any provider switch, not just this one. When GPT-5 launches and OpenAI changes pricing again, you'll be ready.