gemini-cli

An open-source AI agent that brings the power of Gemini directly into your terminal.

open-sourcetool-integration
99.6k
Stars
+2610
Stars/month
10
Releases (6m)

Star Growth

+540 (0.5%)
97.3k99.6k101.8kMar 27Apr 1

Overview

Gemini CLI 是一个开源AI代理工具,将Google Gemini模型的强大功能直接带入终端环境。作为专为开发者设计的命令行工具,它提供了访问Gemini 3模型的轻量级接口,支持100万token的上下文窗口和改进的推理能力。该工具内置了丰富的功能模块,包括Google搜索接地、文件操作、Shell命令执行和Web数据获取,让开发者能够在熟悉的终端环境中高效利用AI能力。通过支持MCP(模型上下文协议),Gemini CLI具备出色的可扩展性,允许用户集成自定义工具和服务。免费层提供每分钟60次请求和每日1000次请求的慷慨配额,使用个人Google账户即可开始使用。作为Apache 2.0许可的开源项目,它在GitHub上获得了99,285颗星的认可,体现了其在开发者社区中的广泛接受度。该工具特别适合那些日常工作依赖终端环境的开发者,提供了从提示到模型响应的最直接路径。

Deep Analysis

Key Differentiator

Unlike Claude Code ($20+/month) and Codex (ChatGPT subscription), Gemini CLI offers the most generous free tier (1,000 req/day) with 1M token context and built-in Google Search grounding

Capabilities

  • Terminal-first AI agent powered by Gemini 3 models with 1M token context window
  • Free tier: 60 requests/min and 1,000 requests/day with personal Google account
  • Built-in Google Search grounding for real-time information retrieval
  • MCP (Model Context Protocol) support for custom tool integrations
  • GitHub Actions integration for automated PR reviews and issue triage
  • Non-interactive headless mode for CI/CD scripting with JSON output
  • Conversation checkpointing to save and resume complex sessions

🔗 Integrations

Google SearchGitHub ActionsMCP serversVertex AIVS Code

Best For

  • Developers wanting a free, high-quota AI coding CLI with 1M token context for large codebases
  • CI/CD pipelines needing automated AI-powered PR reviews via GitHub Actions

Not Ideal For

  • Teams needing multi-model flexibility — use OpenHands or LiteLLM instead
  • Production agent orchestration — use LangGraph or CrewAI instead

Languages

TypeScriptJavaScript

Deployment

npm global installHomebrewMacPortsAnacondanpx (no install)

Pricing Detail

Free: 1,000 requests/day free with Google account login
Paid: Usage-based via Gemini API key or Vertex AI billing

Known Limitations

  • Locked to Google Gemini models only — no multi-provider support
  • Newer project with weekly release cadence — expect breaking changes
  • Google Search grounding may not be available in all regions

Pros

  • + 免费层慷慨配额,每分钟60次请求满足日常开发需求
  • + 内置丰富工具集成,包括Google搜索、文件操作和Shell命令
  • + 支持MCP协议的强大扩展性,可集成自定义工具和服务

Cons

  • - 依赖Google账户认证,可能存在地域访问限制
  • - 作为终端工具,缺乏图形界面可能不适合所有用户场景
  • - 免费层存在请求限制,高频使用可能需要付费升级

Use Cases

  • 自动化代码审查和重构,利用AI分析代码库并提供改进建议
  • 智能运维和故障排查,通过AI分析日志文件和系统状态
  • 快速原型开发和技术调研,在终端中直接查询和生成代码片段

Getting Started

1. 安装工具:运行 `npx @google/gemini-cli` 或 `npm install -g @google/gemini-cli` 全局安装;2. 配置认证:使用个人Google账户完成初始认证和API密钥配置;3. 开始对话:在终端中直接输入问题或命令,体验AI驱动的命令行交互

Compare gemini-cli