# Gemini CLI

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

- Category: AI Coding / Autonomous Coding Agents
- Language: TypeScript
- Licence: Apache-2.0
- Repository: https://github.com/google-gemini/gemini-cli
- Website: https://geminicli.com
- Canonical page: https://ai-tldr.dev/tools/gemini-cli/

## In short

Gemini CLI is an open-source AI agent from Google that runs in your terminal and connects directly to Gemini models. It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in TypeScript and licensed Apache-2.0. To get started: run it instantly with npx.

## 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.

1. Run it instantly with npx

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

```bash
npx @google/gemini-cli
```

2. Or install it globally with npm

   Install once to get the gemini command available everywhere.

```bash
npm install -g @google/gemini-cli
```

3. 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.

```bash
gemini
```

4. 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.

```bash
gemini -p "Explain the architecture of this codebase"
```

## 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
