gemini-cli: Bringing Gemini AI Power to Your Terminal

gemini-cli: Bringing Gemini AI Power to Your Terminal

Summary

gemini-cli is an open-source AI agent that integrates the power of Google's Gemini directly into your terminal. It offers a lightweight and direct path from your prompts to the Gemini model, making AI accessible for developers who prefer the command line. This tool is designed to enhance productivity by providing AI assistance within your familiar development environment.

Repository Info

Updated on October 24, 2025
View on GitHub

Tags

Click on any tag to explore related repositories

Introduction

gemini-cli is an open-source AI agent developed by Google Gemini, designed to bring the advanced capabilities of the Gemini model directly into your terminal. This command-line interface provides a lightweight and efficient way to interact with Gemini, offering a direct path from your prompts to the AI model. It is built for developers who live in the command line and seek powerful AI assistance without leaving their terminal environment. For comprehensive details, refer to the official documentation.

Installation

To get started with gemini-cli, you have several convenient installation options:

Quick Install

Run instantly with npx (no installation required)

npx https://github.com/google-gemini/gemini-cli

Install globally with npm

npm install -g @google/gemini-cli

Install globally with Homebrew (macOS/Linux)

brew install gemini-cli

System Requirements

  • Node.js version 20 or higher
  • macOS, Linux, or Windows

Examples

gemini-cli is designed for intuitive use, whether you're starting a new project, analyzing existing code, or automating tasks.

Basic Usage

Start in current directory

gemini

Include multiple directories

gemini --include-directories ../lib,../docs

Non-interactive mode for scripts

Get a simple text response:

gemini -p "Explain the architecture of this codebase"

For more advanced scripting, including how to parse JSON and handle errors, use the --output-format json flag to get structured output:

gemini -p "Explain the architecture of this codebase" --output-format json

Quick Examples

Start a new project

cd new-project/
gemini
# > Write me a Discord bot that answers questions using a FAQ.md file I will provide

Analyze existing code

git clone https://github.com/google-gemini/gemini-cli
cd gemini-cli
gemini
# > Give me a summary of all of the changes that went in yesterday

Why Use gemini-cli?

gemini-cli offers compelling reasons for developers to integrate AI into their workflow:

  • Free Tier Access: Enjoy 60 requests/min and 1,000 requests/day with a personal Google account, making powerful AI accessible.
  • Gemini 2.5 Pro: Access the advanced Gemini 2.5 Pro model with a 1M token context window for complex tasks.
  • Built-in Tools: Leverage integrated tools like Google Search grounding, file operations, shell commands, and web fetching.
  • Extensible: Support for the Model Context Protocol (MCP) allows for custom integrations and expanded capabilities.
  • Terminal-First Design: Optimized for developers who prefer to work within the command line environment.
  • Open Source: Licensed under Apache 2.0, encouraging community contributions and transparency.
  • GitHub Integration: Enhance your GitHub workflows with automated PR reviews, issue triage, and on-demand assistance via the Gemini CLI GitHub Action.

Links

For more information and to get involved, explore these resources: