AI/TLDR

Gemini CLI

Google's open-source AI agent that brings Gemini straight into your terminal

Autonomous Coding AgentsOpen source
Language
TypeScript
License
Apache-2.0
Coverage
5 stories
$npx @google/gemini-cli

Overview

Gemini CLI is an open-source AI agent from Google that runs in your terminal and connects directly to Gemini models. Instead of switching to a web chat, you type prompts where you already work and the agent can read your code, edit files, run shell commands, and fetch information from the web. It is built for developers who spend most of their time on the command line.

The tool ships with a free tier: signing in with a personal Google account gives 60 requests per minute and 1,000 requests per day, with access to Gemini 3 models and a 1M-token context window. You can also use a Gemini API key or Vertex AI if you need specific model control or enterprise features.

Beyond chatting, Gemini CLI supports built-in tools like Google Search grounding and file operations, a non-interactive mode for scripting, conversation checkpointing, and custom GEMINI.md context files. It is extensible through the Model Context Protocol (MCP), so you can connect it to your own integrations. It is released under the Apache 2.0 license.

What it does

  • Connects your terminal to Gemini 3 models with a 1M-token context window and a free tier (60 requests/min, 1,000/day with a personal Google account)
  • Built-in tools for Google Search grounding, file operations, shell commands, and web fetching
  • Reads and edits large codebases, debugs with natural language, and generates apps from PDFs, images, or sketches using multimodal input
  • Extensible through the Model Context Protocol (MCP) for custom integrations, plus a GitHub Action for PR reviews and issue triage
  • Non-interactive mode with text, JSON, or streaming JSON output for scripting and automation
  • Conversation checkpointing to save and resume sessions, and custom GEMINI.md files to tailor behavior per project

Getting started

Gemini CLI runs on Node.js and installs from npm. You can run it instantly with npx or install it globally, then sign in with your Google account on first launch.

Run it instantly with npx

No installation needed. This downloads and starts Gemini CLI on the spot.

bashbash
npx @google/gemini-cli

Or install it globally with npm

Install once to get the gemini command available everywhere.

bashbash
npm install -g @google/gemini-cli

Start it in your project and sign in

Run gemini in your project directory, then choose Sign in with Google and follow the browser flow when prompted. This uses the free tier with a personal Google account.

bashbash
gemini

Run a one-off prompt for scripts

Use the non-interactive flag to get a single text response, which is handy inside scripts and automation.

bashbash
gemini -p "Explain the architecture of this codebase"

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Explore and understand a large or unfamiliar codebase by asking questions in plain language from the terminal
  • Edit code, fix bugs, and run shell commands as an agent without leaving the command line
  • Ground answers in real-time information using built-in Google Search
  • Automate operational tasks such as querying pull requests or handling complex rebases
  • Add Gemini CLI to GitHub workflows for automated pull request reviews and issue triage
  • Script AI tasks in non-interactive mode with JSON or streaming output

Gemini CLI in the news

  1. 2026-05-19MAJORGoogle Antigravity 2.0 — Standalone Agent-First Desktop App, Go-Based CLI, and SDK Replace Gemini CLI Ahead of June 18 Sunset
  2. 2026-04-30MAJORGemini CLI Headless-Mode RCE (CVSS 10) — Workspace Auto-Trust Lets Untrusted PRs Pop CI Hosts, Patched in 0.39.1
  3. 2026-04-15MAJORComment and Control — Prompt Injection via GitHub Comments Hits Claude Code, Gemini CLI, Copilot
  4. 2026-04-15NOTABLEGemini CLI Subagents — Delegate to Specialist Agents Directly from Your Terminal
  5. 2026-04-09NOTABLEGemini CLI v0.37.1 — Chapters and Dynamic Sandbox Expansion

From the AI/TLDR release feed — every item is source-verified when it ships.

How Gemini CLI compares

Gemini CLI alongside other open-source autonomous coding agents tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
opencode★ 208kOpenCode is an open source AI coding agent that runs in your terminal, with built-in build and plan agents and an optional desktop app.
Claude Code★ 146kAnthropic's agentic coding tool for the terminal, IDE and GitHub: it understands your codebase, executes routine tasks, explains code and handles git workflows from natural-language commands.
OpenAI Codex★ 125kOpenAI's cloud and CLI coding agent that writes features, fixes bugs, and proposes code changes across a repo, running tasks in parallel.
Gemini CLI★ 107kGoogle's open-source AI agent that brings Gemini straight into your terminal
Pi★ 107kMinimal terminal coding agent harness with four built-in tools, extended through TypeScript extensions, skills and prompt templates instead of forks.
autoresearch★ 96.2kKarpathy's minimal harness that hands a coding agent a single-GPU LLM training script and lets it run fixed five-minute experiments, keeping or discarding each change on its own.
OpenHands★ 88.4kAn open-source AI software-development agent that plans tasks, edits files, runs commands, and tests code, usable from a terminal CLI, a local web GUI, or a Python SDK.
Orca★ 71.4kOpen-source desktop workspace that runs Claude Code, Codex, OpenCode and other CLI coding agents in parallel, each in its own git worktree, with a mobile companion app.