Skip to content
OpenSourceSoftware.ai

GitHub stars

108,612
—Awaiting first sync

Awaiting first sync

No measured star history yet

What is Gemini CLI?

Gemini CLI brings a Gemini-powered coding assistant into the terminal, where it can read your code, run commands and make changes for you. Because it is open source under Apache 2.0, teams can inspect it, extend it with MCP servers and custom commands, and run it in their own pipelines. Google now aims it at companies using Gemini Code Assist on Google Cloud, and points free and Google AI Pro or Ultra users to Antigravity CLI.

Gemini CLI is Google's open-source AI agent for the terminal. It reads and edits codebases, runs shell commands, fetches web pages and connects to MCP servers, using Gemini models. It is now maintained for organisations with Gemini Code Assist Standard or Enterprise licences, and still accepts Gemini API and Vertex AI keys.

Core capabilities

  • Query and edit large codebases and run shell commands from a chat in the terminal.
  • Add project instructions in GEMINI.md files and extra tools through MCP servers.
  • Run headless in scripts with plain text, JSON or streaming JSON output.

A coding agent in the terminal

Gemini CLI can query and edit large codebases, debug problems described in plain language and generate apps from PDFs, images or sketches. Built-in tools cover file system operations, shell commands and web fetch and search. Slash commands such as /help and /chat control the session, while custom commands and checkpointing let you reuse prompts and resume conversations. A VS Code companion connects it to the editor.

  • AI coding
  • Terminal
  • Shell
  • VS Code

Context, extensions and sandboxing

GEMINI.md files supply instructions at global, project and subfolder level and are sent with every prompt. MCP servers configured in ~/.gemini/settings.json add tools, and extensions package commands that can be shared. Sandboxing can run the agent under macOS Seatbelt, Docker or Podman, gVisor or LXC. Trusted folders set execution policies for each directory.

  • GEMINI.md
  • MCP
  • Extensions
  • Sandbox

Install, sign-in and licence

Gemini CLI is licensed under Apache 2.0 and installs with npm, Homebrew or MacPorts, or runs once with npx @google/gemini-cli. Stable versions ship weekly, with preview and nightly channels for testing. Sign-in options are a Google account, a Gemini API key or Vertex AI. Since 18 June 2026, free individual access and Google AI Pro and Ultra plans have moved to Antigravity CLI, so Gemini CLI is now aimed at Gemini Code Assist Standard or Enterprise licences on Google Cloud.

  • Apache-2.0
  • npm
  • Homebrew
  • Code Assist

Where it fits

Use cases

  1. 01

    Understand and change an unfamiliar codebase

    Run gemini in the project folder, adding other folders with --include-directories if needed. Ask it to explain the architecture or summarise recent changes, then request edits, which it makes with its file system and shell tools. Start it with --sandbox to run it in a macOS Seatbelt profile or a Docker or Podman container.

  2. 02

    Give the agent your team's coding rules

    Write build commands and conventions in a GEMINI.md file in the project, or in ~/.gemini/GEMINI.md for every project. Gemini CLI loads these files and sends them with each prompt, and /memory show displays what it has loaded. Set context.fileName in settings.json to read files such as AGENTS.md as well.

  3. 03

    Automate code tasks in scripts and CI

    Use gemini -p with a prompt to run without the interactive interface. Add --output-format json for structured output that scripts can parse, or stream-json for live events during long tasks. In pipelines, authenticate with a Gemini API key or Vertex AI credentials set as environment variables.