Gemini CLI
Google's entry into the AI CLI space is actually pretty sick. Gemini CLI is a terminal tool powered by Gemini 2.5 Pro that gives you a conversational coding assistant right in your shell. It's fast, it's free (with generous limits), and it has something no other CLI tool can match — a 1 million token context window. That's not a typo. One million tokens.
The tool works in both interactive and non-interactive modes. Interactive gives you a chat-style session where you can iteratively build, debug, and refine code. Non-interactive mode (-p "your prompt") is perfect for one-shot tasks — generate a file, analyze a codebase, write a migration script. Both modes have their place and you'll end up using both.
Auth is flexible. First launch can be your Google account via browser OAuth — useful if you're just trying it out and don't want to mess with API keys. For production use, set GEMINI_API_KEY and it goes straight to the API. The free tier via OAuth is surprisingly generous — enough for daily development work without hitting limits.
What's actually useful here is scale. Most AI tools are bottlenecked by context — you can only feed them so much code before they start forgetting things. Gemini CLI's million-token window means you can load entire monorepos, full documentation sets, or massive log files into a single session and the model actually retains all of it. For large-scale refactoring or analysis, this is a genuine game changer.
The Google integration runs deep. Native access to Google Search for grounding responses in real-time information. Access to your Google Drive files, Gmail, Calendar through the tool-use system. If your workflow involves looking up documentation, checking emails for requirements, or reading spreadsheets — Gemini CLI can do all of that inline without leaving your terminal.
The extensions system lets you add custom capabilities. Define tools in a manifest, point Gemini at them, and it can call your scripts, APIs, or services during a session. This turns it from a coding assistant into a general-purpose agent. Database queries, deployment scripts, monitoring dashboards — whatever you can script, Gemini can use.
Multimodal input is supported. You can feed it images — screenshots of UI bugs, architecture diagrams, handwritten notes on a whiteboard — and it understands them. "Here's what the dashboard looks like in production, fix the alignment issue in the header component" actually works. This is something text-only tools literally cannot do.
The reasoning models (Gemini 2.5 Pro with thinking) are competitive with anything else on the market for complex coding tasks. Architecture decisions, debugging race conditions, optimizing database queries — the reasoning models think through these systematically. The free tier gives you access to these models, which is honestly wild.
Performance on Google-related tasks is unmatched. If you're building on Google Cloud, using Firebase, working with Android, or doing anything in the Google ecosystem — Gemini CLI has an unfair advantage. It's been trained on all of Google's documentation and it shows. The quality of answers about Google APIs and services is noticeably better than competitors.
Who's it for? Engineers who need breadth. Teams doing large-scale analysis or migration work. Anyone who wants a powerful AI coding assistant without paying per token. Google ecosystem developers who want first-class support. If you've ever hit a context limit on another tool and thought "I wish I could just feed it everything" — Gemini CLI is literally built for that.
Power Tips
Getting real leverage from 1M contextQuick Wins
The single most useful flag. Makes Gemini return output immediately and exit — perfect for pipelines, cron jobs, and one-off analysis.
1M tokens is roughly 750,000 words or several large codebases. Don't be conservative — give Gemini full context.
Set once in your shell profile and never type --model again. Gemini 2.5 Pro for the best reasoning.
Skips all confirmation prompts — runs commands and makes changes without asking. Sticky for the session. Use carefully on anything destructive.
For tasks that take 5+ minutes, use --checkpoint so Gemini can resume if interrupted. Huge time saver on big analysis tasks.
Browser auth is fine for interactive use. For scripts and CI, set GEMINI_API_KEY — browser auth requires a human to click, which breaks automation.
Hidden Features
When Gemini runs shell commands, --sandbox wraps them in gVisor container isolation. Safer for running Gemini on unfamiliar code or in shared environments. Slightly slower, much safer.
gemini --sandbox "run and fix these tests" The policy engine lets you pre-approve certain categories of actions (file writes, shell commands) while blocking others. More granular than --yolo. Configure in your settings to avoid per-action confirmations on safe operations.
Long analysis tasks can be interrupted by network drops, rate limits, or system sleep. With --checkpoint, Gemini saves its state and can resume exactly where it left off — no re-running the whole thing.
Common Mistakes
Browser auth requires a human to click through a consent screen. In CI or cron jobs it just blocks silently.
Set GEMINI_API_KEY for all non-interactive and automated use.--yolo skips all confirmations. On a live system, this can execute destructive commands without a prompt to stop you.
--yolo is for local dev only. Never on shared or production infrastructure.Piping your whole repo including node_modules will blow your token budget on irrelevant vendor code.
Always use -not -path "*/node_modules/*" in your find commands.