Gemini CLI

Gemini CLI for one-shot Q&A, summaries, and generation. Use Gemini models from the command line.

Gemini CLI is Google's official open-source AI agent for the terminal, bringing the full power of Gemini models directly to your command line. It's not just a chat interface — it's an agentic coding tool with built-in tools for Google Search grounding, file operations, shell commands, web fetching, and MCP (Model Context Protocol) support for custom integrations. The killer feature is the free tier: 60 requests per minute and 1,000 requests per day with a personal Google account — no API key or credit card needed. Combined with Gemini 3's 1M token context window and improved reasoning, this makes it the most accessible AI coding CLI available. For developers who want to try AI-assisted coding without committing to a paid API, Gemini CLI is the zero-friction entry point. Gemini CLI supports multiple authentication methods: Google account login (free tier), Gemini Code Assist license (enterprise), API key, or ADC (Application Default Credentials). It has conversation checkpointing to save and resume sessions, custom context files (GEMINI.md — similar to CLAUDE.md), and can run non-interactively for scripted workflows. For OpenClaw users, Gemini CLI serves as an alternative AI engine for coding tasks. The skill wraps it for one-shot Q&A, summaries, and generation tasks. While Claude Code and Codex are generally stronger for agentic coding, Gemini CLI's free tier and Google Search grounding make it valuable for research-heavy tasks where real-time information matters. The tool is under active development with weekly stable releases (Tuesdays) and daily nightly builds. A GitHub Action is also available for CI/CD integration — automated PR reviews, issue triage, and on-demand assistance in pull requests. Best suited for: developers wanting free AI coding assistance, teams needing Google Search grounding in their AI workflows, anyone wanting an open-source alternative to proprietary AI CLIs, CI/CD automation with the GitHub Action.

Tags: ai, llm, gemini, google, generation

Category: AI

Use Cases

  • Free AI coding assistance for personal projects
  • Research-grounded code generation with Google Search
  • Automated PR reviews via GitHub Action
  • Quick code explanations and debugging
  • Non-interactive scripted generation in CI/CD pipelines
  • Exploring unfamiliar codebases with 1M token context

Tips

  • Use `npx @google/gemini-cli` for quick one-off use without installation
  • Create a GEMINI.md in your project root for persistent context (like CLAUDE.md)
  • Use `--non-interactive` for scripted workflows and CI/CD pipelines
  • Google Search grounding is the killer feature — use it for research-heavy tasks
  • Pair with the GitHub Action for automated PR reviews on your repos
  • Use conversation checkpointing to save and resume complex sessions
  • For OpenClaw, use as a secondary agent for tasks where real-time search matters

Known Issues & Gotchas

  • Free tier has rate limits: 60 requests/min and 1,000 requests/day — may not be enough for heavy use
  • Agentic coding quality lags behind Claude Code and Codex — the harness is less mature
  • Requires Node.js runtime (npm-based installation)
  • Google account login flow requires a browser — may not work in headless environments
  • MCP support is still evolving — not all MCP servers work perfectly
  • GEMINI.md context files are project-specific — no global config equivalent
  • Nightly builds may contain regressions — stick to stable releases for production use

Alternatives

  • Claude Code
  • Codex CLI (OpenAI)
  • Aider
  • Oracle (steipete)

Community Feedback

I'm a Principal SWE at my company. We've been heavily using Claude Code and Codex. My boss just got us Ultra Google plans because he believes Gemini CLI will be very very good. I've used it, and tbh it was so buggy and the harness itself was just not engineered very well even though the Gemini models are extremely capable.

— Reddit r/GeminiCLI

Gemini CLI is an open-source AI agent that brings the power of Gemini directly into your terminal. It provides lightweight access to Gemini, giving you the most direct path from your prompt to our model.

— Google Blog

Comparing Codex CLI vs Claude Code vs Gemini CLI — AI coding tools in your terminal. Each has distinct strengths: Codex for auto-building, Claude Code for thoughtful refactoring, Gemini CLI for research-grounded tasks.

— Medium

Gemini CLI stands out with its generous free tier (60 RPM, 1000 RPD), 1M token context, and Google Search integration for real-time info.

— Analytics Vidhya

Configuration Examples

Install and authenticate

# Install globally
npm install -g @google/gemini-cli

# Or use Homebrew
brew install gemini-cli

# First run triggers Google account auth
gemini

Non-interactive one-shot

# Quick code generation
gemini --non-interactive "Write a Python function to parse CSV files with error handling"

# With specific model
gemini --model gemini-3-pro --non-interactive "Explain this error: $(cat error.log)"

Project context file (GEMINI.md)

# GEMINI.md
## Project: My Web App
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Database: PostgreSQL with Prisma
- Style: Tailwind CSS
## Conventions
- Use server components by default
- Error handling: always use try/catch with typed errors

Installation

brew install gemini-cli

Homepage: https://ai.google.dev/

Source: bundled