Gemini CLI Guide: 1M Token Context and Who Can Still Use It

AI Tools Deep Dive
20 parts- 1Claude Design: Anthropic's Bet That Designers and Developers Want the Same Tool
- 2The 10 Best AI Coding Tools in 2026
- 3Cursor: The AI-Powered Code Editor That Changed How Developers Work
- 4OpenAI Codex: Terminal and Cloud AI Coding Agent
- 5Gemini CLI Guide: 1M Token Context and Who Can Still Use ItCurrent
- 6Kimi K2: Fast, Cheap, and Efficient Coding
- 7GitHub Copilot in 2026: Still Worth It for TypeScript Developers?
- 8Aider vs Claude Code: Open Source vs Commercial AI Coding CLI
- 9Aider vs Claude Code in 2026: Git-First Open Source vs Subagent Runtime
- 10Every AI Coding Tool Compared: The 2026 Matrix
- 11Qwen3.6-27B Is the Local Coding Model to Test First
- 12Zed Just Made Parallel AI Agents a Native Editor Primitive
- 13Warp Open Sourced the Terminal. The Real Story Is Agent Operations
- 14AI Design Slop: 16 Patterns That Mark a Site as Vibe-Coded
- 15The Claude Design Moment: AI Design Skills Just Got Their Breakout Week
- 16Codeburn: The First TUI That Actually Shows Where Your Claude Max Subscription Is Going
- 17Promptlock: Deterministic Prompt Versioning for LLM Apps
- 18Agent Replays with TraceTrail: Loom for Agent Runs
- 19Hookyard Shows Why Claude Code Hooks Need a Package Manager
- 20MCP Lens: Wireshark for Model Context Protocol Servers
TL;DR
Gemini CLI puts a 1 million token context in your terminal but now only serves paid Gemini API, Vertex AI and Code Assist users. Setup and TypeScript workflow.
Official Sources#
| Resource | Link |
|---|---|
| Gemini CLI Documentation | google-gemini.github.io/gemini-cli |
| Quota and Pricing | Gemini CLI Quota |
| Gemini CLI to Antigravity CLI Announcement | developers.googleblog.com |
| GitHub Repository | google-gemini/gemini-cli |
| Google AI Studio | aistudio.google.com |
| Gemini API Documentation | ai.google.dev/gemini-api |
| Gemini Models Overview | ai.google.dev/gemini-api/docs/models |
Last updated: October 9, 2026. Gemini CLI is no longer free for individuals. On June 18, 2026 Google stopped serving Gemini CLI to free, Google AI Pro/Ultra and Google One users and moved them to Antigravity CLI (Google's announcement). Gemini CLI now serves paid Gemini API keys, Vertex AI and Gemini Code Assist Standard/Enterprise. If you were on the free tier, follow our Gemini CLI to Antigravity CLI migration guide. Pricing, access and model sections below were rewritten to match.
Google shipped an open-source CLI for Gemini with a 1 million token context window. It launched with a generous free tier for personal Google accounts; that tier is gone. Today it is a terminal agent for teams that already pay for Gemini, and /model Auto routes each request across Gemini 3 and Gemini 2.5 models.
For TypeScript developers on a paid Gemini plan, the context window still changes the math on which tools you reach for.
Source check: the Gemini CLI quota and pricing page now opens with a banner that unpaid tier and Google One users were moved to Antigravity CLI on June 18, 2026, and Google's announcement confirms that Gemini CLI remains available through paid Gemini API keys and Gemini Code Assist Standard or Enterprise licenses. Use this guide with AI coding tools pricing comparison, Claude Code usage limits, and Aider vs Claude Code if you are deciding which coding CLI should handle which workload.
What Gemini CLI Is#
Gemini CLI is an open-source, terminal-native AI coding agent from Google. If you want to understand how products like this are structured, the Building CLIs with TypeScript course walks through the underlying patterns. Install Gemini CLI globally and run it in any project directory:
For the next layer of context, read Every AI Coding Tool Compared: The 2026 Matrix and The 10 Best AI Coding Tools in 2026; they show how reusable agent knowledge turns one-off wins into repeatable workflow.
npm install -g @google/gemini-cli
# or
npx @google/gemini-cliIt authenticates with a paid Gemini API key, Vertex AI, or a Google account that holds a Gemini Code Assist Standard or Enterprise license. Personal free and Google AI Pro/Ultra sign-ins no longer work - those accounts were moved to Antigravity CLI.
The CLI operates like other agentic coding tools - it reads your files, understands your project structure, generates code, runs commands, and iterates on errors. The difference is the models behind it and the size of the context window.
The 1 Million Token Advantage#
Context window size determines what an AI coding tool can hold in its head at once. Most tools cap out around 128K to 200K tokens. The Gemini models behind Gemini CLI give you 1 million.
In practical terms, that means you can load an entire TypeScript monorepo into a single session. Not just the file you are working on. Not just the nearby modules. The whole project - every type definition, every utility function, every test file, every configuration.
# Point Gemini at your entire project
gemini
# It can reason across your full codebase in one pass
> Refactor the auth module to use the new token format.
> Update every file that imports from auth/types.ts.
For TypeScript specifically, this matters because the language is inherently cross-referential. Types flow through interfaces, generics propagate across module boundaries, and a change in one type definition can ripple through dozens of files. A model that can see all of those files simultaneously catches issues that a smaller context window misses entirely.
Access and Pricing Since June 18, 2026#
The original free tier (60 requests per minute and 1,000 requests per day on a personal Google account) ended on June 18, 2026. Gemini CLI now runs on three paid routes:
- Paid Gemini API key - pay per token at Gemini API pricing
- Vertex AI - for Google Cloud projects, billed on model and token usage
- Gemini Code Assist Standard or Enterprise - fixed per-seat licenses with daily request quotas
Model choice is handled by /model Auto, which routes requests across Gemini 3 and Gemini 2.5 models. Free, Google AI Pro/Ultra and Google One users get the replacement, Antigravity CLI, instead; the migration guide covers the switch.
For comparison, Claude Code on the Max plan starts at $100/month and Cursor Pro is $20/month. Gemini CLI on an API key has no subscription fee, but every request is billed, so a large-context session can cost more than a flat plan.
The better comparison is workload routing, not winner-take-all. Use Gemini CLI when a large repository or long research context needs the 1 million token window and your team already pays for Gemini. Use Claude Code when you need mature subagents, hooks, and memory. Use the pricing calculator to sanity-check how those choices compound over a month.
TypeScript Workflow#
Gemini CLI picks up your project context automatically. Drop a GEMINI.md file in your project root (similar to CLAUDE.md for Claude Code) and define your conventions:
# GEMINI.md
This is a Next.js 16 project with TypeScript strict mode.
## Conventions
- Use Zod for all runtime validation
- Prefer server components, use "use client" only when necessary
- All API routes return typed responses using shared types from lib/types.ts
- Tests use Vitest with React Testing Library
## Project Structure
- app/ - Next.js App Router pages
- lib/ - Shared utilities and types
- components/ - React components
- convex/ - Backend functions and schema
With this file in place, every Gemini session starts with your project's rules loaded. The CLI reads it automatically on startup.
A typical TypeScript workflow looks like this:
# Start a session in your project
cd ~/Developer/my-app
gemini
# Generate a typed API client from your OpenAPI spec
> Generate a fully typed API client from openapi.yaml.
> Use Zod schemas for runtime validation.
> Export all types from lib/api-types.ts.
# Refactor across the codebase
> Migrate all useState calls in the dashboard to useReducer.
> Keep the same component interfaces.
# Debug type errors
> Fix all TypeScript errors in the project.
> Run tsc --noEmit and resolve each one.
The CLI handles file reads, writes, and shell commands. It will run tsc to check its own work, fix errors, and iterate until the build passes.
MCP Support#
Gemini CLI supports the Model Context Protocol. You can connect external tools - databases, APIs, documentation servers - and the CLI will use them as part of its workflow.
// .gemini/settings.json
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://localhost:5432/mydb"
}
}
}
}
This means you can query your database, fetch documentation, or interact with external services without leaving the Gemini session. The model calls the MCP tools as needed during code generation.
Gemini CLI vs Claude Code#
Both are terminal-native AI coding agents. Both read your codebase, generate code, and run commands. The differences come down to model characteristics and pricing.
Context window. Gemini wins here decisively. 1 million tokens vs Claude Code's 200K. For large TypeScript projects, this means fewer sessions where the model loses track of distant dependencies.
Code quality. Claude Sonnet 4.6 and Opus 4.6 produce excellent TypeScript output - strong type inference, idiomatic patterns, minimal hallucination. The Gemini 3 and Gemini 2.5 models behind /model Auto are competitive but tend to be more verbose in their implementations.
Tool ecosystem. Claude Code has a mature skill system, sub-agents, worktrees, and deep integration with Anthropic's model family. Gemini CLI is newer and still building out its feature set, but MCP support gives it extensibility from day one.
Price. Neither is free. Gemini CLI bills per token on a paid Gemini API key or Vertex AI, or runs under a Gemini Code Assist Standard/Enterprise seat. Claude Code Max starts at $100/month. Which is cheaper depends on how much context you push through each session.
The practical move: if your team already pays for Gemini, use both. Gemini CLI for large-context tasks and whole-repo analysis. Claude Code for precision work, complex refactors, and tasks where Anthropic's models have a quality edge. They are complementary tools, not competitors.
Getting Started#
Three steps:
# 1. Install
npm install -g @google/gemini-cli
# 2. Authenticate with a paid Gemini API key (or Vertex AI / Code Assist)
export GEMINI_API_KEY="your-paid-key"
gemini
# 3. Start coding
> Scaffold a Next.js 16 app with TypeScript, Tailwind, and Convex.
Add a GEMINI.md to your project root with your conventions. Connect any MCP servers you use. Start building.
For a curated directory of CLI coding tools including Gemini CLI, Claude Code, Codex, and others, check out clis.developersdigest.tech.
Continue Reading#
- Gemini CLI to Antigravity CLI Migration Guide: The June 18 Deadline - Google's next-generation replacement for Gemini CLI and what the migration involves
- Gemini 3.5 Pro Developer Guide: 2M Context Window and Deep Think Mode - the newer Gemini model family and what changed since Gemini 2.5 Pro
- Antigravity CLI vs Claude Code vs Codex: The Terminal Agent Field Guide - how Google's agentic terminal tools compare with the rest of the field
- NotebookLM Is Now Gemini Notebook: What Changes and What Stays
- Developer Fired by Google for Building Google Workspace CLI
- Noam Shazeer Joins OpenAI After Two Years Back at Google
FAQ#
Is Gemini CLI still free?#
No. Since June 18, 2026 Gemini CLI no longer serves free, Google AI Pro/Ultra or Google One users; Google moved them to Antigravity CLI. It now works with paid Gemini API keys, Vertex AI and Gemini Code Assist Standard/Enterprise licenses. See the migration guide if you were on the free tier.
How does Gemini CLI compare to Claude Code?#
Gemini CLI has a larger context window (1 million tokens vs 200K) and bills through a paid Gemini API key, Vertex AI or a Code Assist seat, while Claude Code starts at $100/month on the Max plan. Claude Code has a more mature ecosystem with skills, sub-agents, and worktrees. Many developers use both - Gemini for large-context tasks and high-volume iteration, Claude Code for precision work where Anthropic's models have a quality edge.
What is GEMINI.md and do I need one?#
GEMINI.md is a project configuration file similar to CLAUDE.md for Claude Code. Place it in your project root to define coding conventions, project structure, and rules. The CLI reads it automatically on startup. It is optional but recommended for consistent output.
Does Gemini CLI support MCP servers?#
Yes. Configure MCP servers in .gemini/settings.json to connect databases, APIs, documentation servers, and other external tools. The CLI calls MCP tools as needed during code generation.
Can Gemini CLI run shell commands?#
Yes. It reads files, writes code, runs shell commands, and iterates on errors. It will run tsc to check its own TypeScript output, fix type errors, and continue until the build passes.
Why does the 1 million token context matter for TypeScript?#
TypeScript is inherently cross-referential - types flow through interfaces, generics propagate across modules, and changes ripple through many files. A 1 million token window lets the model see your entire codebase simultaneously, catching issues that smaller context windows miss entirely.
How do I authenticate Gemini CLI?#
Set a paid GEMINI_API_KEY, configure Vertex AI, or sign in with a Google account that holds a Gemini Code Assist Standard or Enterprise license, then run gemini. Personal free and Google AI Pro/Ultra sign-ins stopped working on June 18, 2026.
Can I use Gemini CLI with my own API key?#
Yes, and for individual developers a paid Gemini API key is now the main way in. Usage is billed per token at Gemini API rates, and /model Auto picks between Gemini 3 and Gemini 2.5 models for each request.
Get the next deep dive like this in your inbox
One email a week on Gemini and the rest of the AI dev stack. Free.
Read next on AI coding tools
The 10 Best AI Coding Tools in 2026
From terminal agents to cloud IDEs - these are the AI coding tools worth using for TypeScript development in 2026.
8 min readWhat Is Claude Code? The Complete Guide for 2026
Claude Code is Anthropic's AI coding agent for terminal, IDE, desktop and browser. What it does, how it works, setup, pricing, MCP, skills, hooks and subagents.
15 min readAI Coding Tools Pricing Comparison 2026
AI coding tools pricing, verified Sep 28, 2026: Claude Code, Codex, Cursor, Copilot, Antigravity, Windsurf and more. Free tiers, pro plans and hidden costs.
12 min readNew here? Start with
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.








