Photo by Gabriel Heinzer on Unsplash Source

Gemini CLI is an open-source AI agent that puts Gemini 3 models directly into your terminal, and it costs nothing to start. With 94,400 GitHub stars, a free tier of 60 requests per minute (1,000/day), and Google Search grounding baked in, it has become the fastest-growing terminal AI agent in 2026. Google’s own SRE teams now use it to diagnose production outages and generate postmortems, which tells you something about how far it has moved beyond a demo.

Unlike Google ADK, which is a framework for building agents, Gemini CLI is a finished agent you can use right now. Run npx @google/gemini-cli, authenticate with your Google account, and you have an AI reasoning engine that can read your codebase, run shell commands, search the web, and chain tools together autonomously.

Related: AI Agent Frameworks Compared: LangGraph, CrewAI, AutoGen

What Gemini CLI Actually Does

Gemini CLI uses a ReAct (Reason and Act) loop: it receives your prompt, reasons about what tools to call, executes them, observes the results, and repeats until the task is done. This is the same agentic pattern described in our guide to AI agents, but packaged as a single binary you install and run.

The built-in tools cover four categories:

File operations. Read, write, edit, and search files across your project. Gemini CLI maps your repository structure automatically, so it understands how modules connect before proposing changes.

Shell execution. Run any command in your terminal. Gemini CLI can execute test suites, run builds, manage containers, and chain commands together. It asks for confirmation before destructive operations.

Google Search grounding. This is Gemini CLI’s strongest differentiator. Every response can pull live data from Google Search, which means it always references current documentation, recent CVE advisories, and up-to-date API references. Claude Code and Codex CLI do not have this capability natively.

Web fetching. Retrieve and parse content from URLs directly. Useful for pulling documentation pages, checking API status endpoints, or reading issue threads.

Beyond the built-ins, Gemini CLI supports MCP (Model Context Protocol) servers for extensibility. You can connect it to databases, CI/CD pipelines, issue trackers, or any custom tool exposed via MCP. A GEMINI.md context file (similar to .cursorrules or CLAUDE.md) lets you define project-specific instructions that persist across sessions.

How Google SREs Use It in Production

The most compelling evidence for Gemini CLI’s maturity comes from inside Google. The Cloud SRE team published a detailed case study in February 2026 describing how they use it to handle real incidents.

Incident Triage and Diagnosis

When an alert fires, SREs pipe monitoring data directly into Gemini CLI. The agent cross-references error logs, metric dashboards, and recent deployments to narrow down the root cause. Because it has Google Search grounding, it can simultaneously look up known issues with specific service versions or infrastructure components. The team reports reduced Mean Time to Mitigation (MTTM) because the agent surfaces relevant context faster than manual log spelunking.

Automated Postmortems

After an incident is resolved, SREs use a custom Gemini CLI command that generates a structured Markdown postmortem. The agent pulls data from the incident timeline, formats it against Google’s standard SRE postmortem template, and suggests concrete action items. Through MCP integration with their issue tracker, it can create follow-up bugs, assign owners, and export the document to Google Docs in a single workflow.

Infrastructure Monitoring

Platform engineers use Gemini CLI as a conversational interface to their monitoring stack. Instead of writing PromQL queries or clicking through Grafana dashboards, they describe what they want to check in natural language. The agent translates that into the appropriate queries, interprets the results, and flags anything that deviates from established baselines.

This SRE workflow pattern is specific to Gemini CLI. Claude Code excels at complex code refactoring. Codex CLI integrates tightly with GitHub Actions for async automation. Gemini CLI’s niche is operational intelligence: the combination of live search grounding, shell access, and MCP tool chaining makes it particularly effective for infrastructure and incident response work.

Setup in Three Minutes

Getting started requires a Google account and Node.js 18+.

Option 1: Run without installing

npx @google/gemini-cli

Option 2: Install globally

npm install -g @google/gemini-cli

Option 3: Homebrew (macOS)

brew install gemini-cli

On first run, Gemini CLI prompts you to authenticate with your Google account. The free tier gives you access to Gemini 3 Flash with a 1 million token context window, 60 requests per minute, and 1,000 requests per day. No API key, no credit card, no billing setup.

For teams that need Gemini 3 Pro or higher rate limits, you can configure a Vertex AI project or a Gemini API key in the settings. But the free tier is generous enough for individual developers and small teams to use it as a daily driver.

Project Configuration

Create a GEMINI.md file in your project root to give the agent persistent context:

# Project Context

This is a Python FastAPI backend with PostgreSQL.
Use pytest for testing. Run tests with `pytest -v`.
Never modify files in /migrations without explicit approval.
Deployment uses Docker Compose on GCP Cloud Run.

Gemini CLI reads this file at the start of every session, similar to how Claude Code reads CLAUDE.md and Cursor reads .cursorrules.

The Terminal Agent Wars: Gemini CLI vs. Claude Code vs. Codex CLI

Three companies are now betting heavily on terminal-native AI agents: Google, Anthropic, and OpenAI. Each tool reflects its maker’s broader strategy.

FeatureGemini CLIClaude CodeCodex CLI
Stars/Users94.4K GitHub starsPart of Claude Pro (millions)Part of ChatGPT (millions)
Free tier60 req/min, 1K/dayNone (requires Pro $20/mo)None (requires Plus $20/mo)
Context window1M tokens1M tokens (beta)200K tokens
Search groundingGoogle Search built-inNo native searchNo native search
MCP supportYesYesLimited
Async executionNoNoYes (cloud-based)
GitHub integrationPR reviews, issue triageGit operationsNative GitHub Actions
Best forSRE, DevOps, operational tasksComplex refactoring, multi-file editsCI/CD automation, async tasks

Gemini CLI wins on accessibility. The free tier is unmatched. No other terminal AI agent lets you make 1,000 requests per day without spending anything. For developers evaluating tools or teams with tight budgets, this alone makes it worth trying first.

Claude Code wins on code quality. Multiple independent benchmarks show Claude Code produces cleaner first-attempt code with fewer retries needed. For complex refactoring jobs that touch dozens of files, Claude Code’s deep codebase understanding is hard to beat.

Codex CLI wins on automation. Its cloud-based async execution means you can fire off tasks and check results later. Native GitHub Actions integration makes it ideal for CI/CD workflows where you want an AI agent running in the pipeline, not in your terminal.

For a broader comparison including IDE-integrated tools like Cursor and Copilot, see our AI coding agents comparison.

Related: MCP and A2A: The Protocols Making AI Agents Talk

Gemini-Kit: 27 Community Agents Built on Gemini CLI

The open-source community has not waited around. Gemini-Kit packages 27 specialized agents that run on top of Gemini CLI, each targeting a specific engineering workflow:

  • @security-auditor: Scans dependencies for known CVEs and suggests patches
  • @docker-compose-helper: Generates and debugs multi-container configurations
  • @terraform-planner: Reviews infrastructure-as-code changes before apply
  • @log-analyzer: Parses and summarizes logs from CloudWatch, Stackdriver, or ELK
  • @migration-assistant: Plans and executes database schema migrations

These community agents work because Gemini CLI’s architecture is intentionally extensible. The combination of built-in tools, MCP servers, and the GEMINI.md context file gives agent builders a solid foundation without requiring them to manage model access, authentication, or token budgets separately.

When to Choose Gemini CLI

Gemini CLI makes the most sense in three scenarios:

You need live information. If your workflow involves checking current documentation, security advisories, or API status pages, Google Search grounding saves you from constantly switching between your terminal and a browser. No other terminal agent does this natively.

You are budget-constrained. The 1,000 requests/day free tier is real. For individual developers, open-source contributors, or teams evaluating terminal AI agents before committing budget, Gemini CLI removes the financial barrier entirely.

You work in DevOps or SRE. The combination of shell execution, log analysis, search grounding, and MCP extensibility maps directly to infrastructure operations. Google’s own SRE team using it daily is not marketing copy; it is a signal that the tool handles production-grade operational complexity.

If your primary need is complex code refactoring across large repositories, Claude Code is the stronger choice. If you need async cloud execution integrated with GitHub, Codex CLI fits better. The terminal agent market is not winner-take-all. Most teams will end up with two of these three in their toolkit.

Related: What Are AI Agents? A Practical Guide for Business Leaders

Frequently Asked Questions

Is Gemini CLI free to use?

Yes. Gemini CLI offers a free tier with 60 requests per minute and 1,000 requests per day using a personal Google account. It provides access to Gemini 3 Flash with a 1 million token context window. No API key or credit card is required. For higher rate limits or Gemini 3 Pro access, you can configure a Vertex AI project or paid API key.

How does Gemini CLI compare to Claude Code?

Gemini CLI and Claude Code serve different strengths. Gemini CLI has a generous free tier and built-in Google Search grounding for live information access, making it strong for DevOps and SRE workflows. Claude Code produces higher-quality code on first attempts and excels at complex multi-file refactoring. Gemini CLI has 94,400 GitHub stars and runs Gemini 3 models, while Claude Code requires a Claude Pro subscription starting at $20/month.

What can Gemini CLI do that IDE-based AI tools cannot?

Gemini CLI operates as a terminal-native agent that can execute shell commands, manage infrastructure, analyze logs, and chain tools via MCP servers. IDE-based tools like Cursor or GitHub Copilot focus on code editing within the editor. Gemini CLI can run builds, manage Docker containers, query monitoring systems, and automate postmortem generation, making it suited for DevOps, SRE, and infrastructure tasks beyond pure code writing.

Does Gemini CLI support MCP (Model Context Protocol)?

Yes. Gemini CLI supports both local and remote MCP servers, allowing you to connect it to databases, CI/CD pipelines, issue trackers, and custom tools. Google’s SRE teams use MCP integration to connect Gemini CLI to their incident management and documentation systems. This extensibility is a core part of its architecture.

How do I install Gemini CLI?

The fastest method is npx @google/gemini-cli, which runs without installation. For permanent installation, use npm install -g @google/gemini-cli or brew install gemini-cli on macOS. You need Node.js 18+ and a Google account. Authentication happens on first run through a browser-based OAuth flow.