# Gemini CLI

Open-source AI agent from Google that brings Gemini models into the terminal with file operations, shell commands, and Google Search grounding.

## Summary
Gemini CLI is an open-source terminal agent from Google that runs Gemini models locally with file editing, shell execution, and built-in Google Search grounding. It supports MCP servers, works with large codebases, and offers a generous free tier through Gemini API access.


## Guide
Gemini CLI is Google's open-source entry into the terminal coding agent space. It brings Gemini models directly into the developer's terminal with file editing, shell commands, and a unique capability: Google Search grounding.

### What it is
Gemini CLI is an Apache-2.0 licensed terminal agent that connects to Google's Gemini models. It can read and edit files, execute shell commands, search the web via Google Search, and connect to external tools through MCP servers. It runs entirely in the terminal with no GUI required.

### Why it matters
The terminal agent space has been dominated by proprietary tools. Gemini CLI changes that by being fully open source while leveraging Google's frontier models. The addition of Google Search grounding means the agent isn't limited to its training data — it can look up current documentation, recent API changes, and live examples.

### How it works
After installing via npm, run 'gemini' in any directory. The agent indexes your project structure, then enters an interactive loop. You describe tasks in natural language, and the agent reads files, makes edits, runs shell commands, and searches the web as needed. It supports MCP for extending its capabilities with custom tools.


## Use Cases
- Learning unfamiliar codebases: Ask Gemini CLI to explain architecture, trace data flows, and summarize how different modules interact in a project you just joined.
- API integration research: Use Google Search grounding to research third-party APIs, find current documentation, and generate integration code in one workflow.
- Automated code generation: Describe features in natural language and let Gemini CLI scaffold implementations, write tests, and iterate based on test results.

## Alternatives
- Use Claude Code for deeper reasoning on complex tasks vs Claude Code: Claude Code may handle complex multi-file refactors better, but Gemini CLI offers search grounding and a free tier that Claude Code does not.
- Use Codex CLI for a lighter Rust-based option vs Codex CLI: Codex CLI is built in Rust for speed and supports multiple model providers. Gemini CLI is Node.js-based but offers unique Google Search integration.

### Getting Started
- Read the documentation: https://github.com/google-gemini/gemini-cli#readme
- Inspect the repository: https://github.com/google-gemini/gemini-cli

### FAQ
- Is Gemini CLI open source?
  - Yes. Gemini CLI is released under the Apache-2.0 license, making it fully open source for inspection, modification, and redistribution.
- Who should use Gemini CLI?
  - Developers who want a free or low-cost terminal coding agent with access to Google's Gemini models and unique Google Search grounding capabilities.
- How does Gemini CLI compare to other coding agents?
  - Gemini CLI's main differentiators are its open-source license, Google Search grounding, and free tier. It may not match Claude Code on complex multi-file reasoning but offers capabilities that other terminal agents lack.
## Why It Matters
Gemini CLI is significant because it brings Google's frontier models into the terminal-agent category as a fully open-source project under Apache-2.0. Combined with free-tier Gemini API access and Google Search grounding, it lowers the barrier for developers to experiment with agentic coding workflows.


## Best For
- Developers who want free or low-cost access to frontier models in a terminal agent
- Teams building agentic workflows that benefit from Google Search grounding
- Engineers who prefer open-source tools they can inspect, modify, and self-host

## Not For
- Developers who need deep integration with non-Google model providers
- Teams that require mature plugin ecosystems or extensive community tooling

## What It Actually Does
- Google Search grounding: Gemini CLI can ground its responses in live Google Search results, giving it access to up-to-date information beyond its training data.
  - Why it matters: Most terminal agents are limited to their training data. Search grounding lets Gemini CLI answer questions about recent APIs, library versions, and current best practices.
- Fully open source under Apache-2.0: The entire codebase is open for inspection, modification, and redistribution under a permissive license.
  - Why it matters: Teams can fork, customize, and embed Gemini CLI in their own toolchains without licensing concerns.
- Generous free tier: Google offers substantial free Gemini API access, making Gemini CLI one of the most cost-effective terminal agents available.
  - Why it matters: Developers can experiment with agentic coding workflows without committing to expensive API subscriptions.

## Typical Use Cases
- Code exploration and understanding: Use Gemini CLI to navigate unfamiliar codebases, ask questions about architecture, and get explanations grounded in actual source code.
- Research-backed development: Leverage Google Search grounding to research APIs, compare libraries, and verify best practices before implementing features.
- Rapid prototyping: Scaffold new projects, generate boilerplate, and iterate on implementations with an agent that can run commands and edit files.

## How It Compares
- Choose Gemini CLI for search-grounded agentic coding vs Claude Code: Gemini CLI offers Google Search grounding and a generous free tier. Claude Code may have an edge on complex multi-file reasoning tasks but requires a paid API.

## Command Line
### Install Gemini CLI
Install globally via npm, then run 'gemini' in any project directory. You'll need a Google API key or can use the free tier.

```bash
npm install -g @anthropic-ai/gemini-cli
```

## Facts
- Category: agents
- Resource type: agent
- Open source: yes
- License: Apache-2.0
- Last verified: 2026-05-27
- GitHub repo: google-gemini/gemini-cli
- GitHub stars: 105000

## Capabilities
- mcp
- workflow-orchestration

## Structured Use Case Tags
- developer-workflow

## Getting Started
- Open the GitHub repository: https://github.com/google-gemini/gemini-cli
- Read the documentation: https://github.com/google-gemini/gemini-cli#readme
- Visit the project website: https://github.com/google-gemini/gemini-cli

## Links
- GitHub: https://github.com/google-gemini/gemini-cli
- Docs: https://github.com/google-gemini/gemini-cli#readme

## Structured Outputs
- JSON: https://www.openagent.bot/agents/gemini-cli.json
- Markdown: https://www.openagent.bot/agents/gemini-cli.md
- Canonical: https://www.openagent.bot/agents/gemini-cli
