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.
npx @google/gemini-cliOr install it globally with npm
Install once to get the gemini command available everywhere.
npm install -g @google/gemini-cliStart 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.
geminiRun a one-off prompt for scripts
Use the non-interactive flag to get a single text response, which is handy inside scripts and automation.
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
How Gemini CLI compares
Gemini CLI alongside other open-source autonomous coding agents tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| opencode | ★ 176k | OpenCode is an open source AI coding agent that runs in your terminal, with built-in build and plan agents and an optional desktop app. |
| Gemini CLI | ★ 105k | Google's open-source AI agent that brings Gemini straight into your terminal |
| OpenHands | ★ 77.8k | An 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. |
| Goose | ★ 49.8k | Goose is an open-source AI agent that runs on your machine for code, research, automation, and more, with a desktop app, CLI, and API built in Rust. |
| Continue | ★ 34.1k | Continue is an open-source coding agent available as a CLI, VS Code extension, and JetBrains plugin, plus version-controlled AI checks that run on pull requests in CI. |
| Vibe Kanban | ★ 27.1k | Vibe Kanban lets you plan tasks on a kanban board, run coding agents like Claude Code and Codex in isolated workspaces, then review their diffs and ship pull requests. |
| Serena | ★ 25.6k | Serena is an open-source MCP toolkit that gives any LLM coding agent symbol-level code retrieval, editing, and refactoring across 40+ languages. |
| Crush | ★ 25.5k | Crush is a terminal coding agent from Charm. It connects your code, tools, and workflows to any OpenAI- or Anthropic-compatible LLM, with LSP context and MCP plugins. |