Skip to main content
9 – 17 UHR +49 8031 3508270 LUITPOLDSTR. 9, 83022 ROSENHEIM
DE / EN
Coding agent Google United States Terminal (CLI), VS Code

Gemini CLI

Gemini CLI is Google's open-source coding agent for the terminal. Features, models, MCP, sandbox and enterprise use of the agent harness explained.

Licence Apache-2.0
Interfaces Terminal (CLI), VS Code (companion extension)
Platforms macOS, Linux, Windows
Instruction file GEMINI.md

The seven building blocks in Gemini CLI

How Gemini CLI implements the building blocks of an AI harness

  1. 1

    Agent loop

    The core loop calls the model, evaluates its tool requests, executes them in the runtime environment and returns results; in non-interactive mode (`-p`/`--prompt`) it ends with exit codes 0 (success), 1 (error), 42 (input error) or 53 (turn limit exceeded).

  2. 2

    Tools and execution environment

    Built-in tools for the file system, shell commands, and web fetch/search are extended via the Model Context Protocol (MCP) with external servers configured in `~/.gemini/settings.json` and addressed in chat with `@servername`.

  3. 3

    Context management

    Project instructions live in `GEMINI.md` files at global, workspace and just-in-time level, merged automatically by the CLI; `/memory show` displays the loaded context, `/memory reload` rescans it, and the filename can be changed in `settings.json`, e.g. to `AGENTS.md`.

  4. 4

    State and memory

    Sessions are saved automatically and can be resumed via `/resume` in the interactive session browser or with the `--resume` flag by index or UUID.

  5. 5

    Permissions

    A YOLO mode for automatic approval can be disabled, tools can be restricted via a `tools.core` allowlist, and administrators can enforce Google sign-in via `security.auth.enforcedType` as well as mandate sandboxing centrally.

  6. 6

    Verification and feedback

    Checkpointing creates a commit in a shadow Git repository under `~/.gemini/history/<project_hash>` before every approved file change; `/restore` reverts files and conversation history, but requires `general.checkpointing.enabled` and an installed Git.

  7. 7

    Orchestration

    Built-in subagents such as the “Codebase Investigator” or a “Generalist” handle scoped subtasks with their own context; the Agent-to-Agent protocol (A2A) additionally allows remote subagents to be connected.

Models and model access

Which models the harness uses and how they are obtained

Models and model access
Models Gemini models (Gemini 3 family)
Access routes Gemini API (Google AI Studio), Vertex AI, Gemini Code Assist (enterprise licence), Gemini Enterprise Agent Platform
Free choice of model No
Custom endpoint / LLM gateway Yes
Gemini CLI runs exclusively with Gemini models; access is via Google sign-in, a Gemini API key (`GEMINI_API_KEY` environment variable) or Vertex AI with `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`. For the API-key and Vertex AI sign-in methods, the base URL can be redirected to a custom proxy via `GOOGLE_GEMINI_BASE_URL` or `GOOGLE_VERTEX_BASE_URL` respectively.
Features
MCP servers Sub-agents Hooks Skills Plugins / extensions Sandbox Headless / CI SDK IDE integration Checkpoints Resume sessions
Running it with herdr
Supported by herdr Yes
State detection Detected but, per the herdr documentation, less thoroughly tested than the other supported agents
Integration not specified in detail in the herdr documentation
As of 20 September 2026, herdr lists Gemini CLI together with Cline separately as “detected but less thoroughly tested”.
More about herdr →

Enterprise use

Data processing, controls and pricing model according to the vendor

Enforced Google sign-in

Organisations can mandate Google sign-in exclusively via `security.auth.enforcedType` in `settings.json` and restrict access to their own Google Workspace domain via the `X-GoogApps-Allowed-Domains` HTTP header.

Sandbox and tool policies

Administrators can enforce sandboxing centrally (`tools.sandbox`), allowlist tools via `tools.core` and approve MCP servers via `mcp.allowed`; the YOLO mode for automatic approvals can be disabled centrally.

OpenTelemetry telemetry disabled, usage statistics enabled by default

OpenTelemetry-based telemetry (traces, metrics, logs) must be actively enabled via `GEMINI_TELEMETRY_ENABLED` or `settings.json` before data is sent to Google Cloud, local files or a custom OTLP endpoint. Separately, the anonymous usage-statistics setting `privacy.usageStatisticsEnabled` in `settings.json` is, per the configuration reference, enabled by default (opt-out). For enterprise settings, the documentation explicitly recommends setting `telemetry.logPrompts` to `false`.

Access via Vertex AI or enterprise licence

Besides Google sign-in, Gemini CLI supports Vertex AI with Application Default Credentials, a service account key or a Google Cloud API key, as well as access via a Gemini Code Assist Standard or Enterprise licence with unchanged functionality.

Free access for the unpaid tier discontinued since June 2026

Per Google's official announcement of 19 May 2026 (“An important update: Transitioning Gemini CLI to Antigravity CLI”, published as part of Google I/O 2026), Google discontinued the service for Google AI Pro and Ultra as well as Gemini Code Assist for individuals as of 18 June 2026; a banner in the Gemini CLI documentation confirms this (“Gemini CLI was replaced by Antigravity CLI on June 18th, 2026.”) and additionally names Google One users as affected. Organisations with a Code Assist Standard or Enterprise licence and users with paid API access via the Gemini or Gemini Enterprise Agent Platform API are unaffected by this change.

Strengths
  • Fully open source under Apache-2.0 with a weekly release cadence (preview, stable, nightly)
  • Direct access via a Gemini API key or Vertex AI without being tied to a desktop IDE
  • Broad extension system of MCP servers, extensions, hooks, subagents and agent skills
  • Built-in checkpointing via a shadow Git repository without touching the project repository
  • Multiple sandbox technologies (Seatbelt, Docker/Podman, gVisor, Windows sandbox) per operating system
  • GitHub Action for automated PR reviews and issue triage
Limitations
  • Free access for the unpaid tier and for Google One users has, per the Gemini CLI documentation, been discontinued since 18 June 2026; production use now requires Vertex AI, paid API access, or a Code Assist licence
  • Tied exclusively to Gemini models; switching to models from other providers is not documented as supported
  • Sandboxing and enforcement policies are explicitly documented as not a defence against a determined local attacker

Use cases

Typical tasks for this harness

Understanding and generating code in existing repositories
Automating recurring terminal tasks such as rebases or PR summaries
CI/CD workflows via non-interactive mode with JSON or streaming JSON output
Automated PR reviews and issue triage via the Gemini CLI GitHub Action
Multimodal prototyping from sketches, PDFs or images

Building on the basics of an AI Harness: Gemini CLI is Google’s open-source coding agent for the terminal, turning Gemini models into a working AI agent with tools for the file system, shell and web plus MCP extensibility — licensed under Apache-2.0, made by Google. As of 20 September 2026.

What is Gemini CLI?

Gemini CLI is developed and published by Google as an open-source project on GitHub (google-gemini/gemini-cli) under the Apache-2.0 licence, with weekly preview, stable and nightly releases. It is installed with npm install -g @google/gemini-cli, run instantly via npx @google/gemini-cli, or installed with Homebrew (brew install gemini-cli); the interactive session starts with the gemini command in a project directory. Its primary surface is the terminal, complemented by a VS Code companion extension for IDE integration.

Gemini CLI as an AI harness

Gemini CLI’s agent loop calls the model, evaluates its tool requests and executes them in a controlled environment — unsandboxed or in one of five sandbox variants (macOS Seatbelt, Docker/Podman containers, native Windows sandbox, gVisor/runsc, or experimental LXC/LXD on Linux). Tools are extended via the Model Context Protocol (MCP), addressed in chat with @servername. Project context comes from GEMINI.md files at global, workspace and just-in-time level, automatically merged by the CLI and managed via /memory show and /memory reload. Checkpointing saves the state in a shadow Git repository under ~/.gemini/history/<project_hash> before every file change; /restore reverts changes together with the conversation history. For split work, subagents are available, including the built-in “Codebase Investigator”, plus remote subagents via the Agent-to-Agent protocol (A2A). Extensions bundle prompts, MCP servers, custom commands, hooks, subagents and agent skills into installable GitHub packages (gemini extensions install <repo-url>).

Models and model access

Gemini CLI is tied exclusively to Gemini models from the Gemini 3 family. Access works via three routes: Google sign-in (OAuth) with a limited free allowance, a Gemini API key via the GEMINI_API_KEY environment variable, or Vertex AI with GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION for Application Default Credentials, a service account key, or a Google Cloud API key. For the latter two authentication routes, the configuration reference documents a redirectable base URL — GOOGLE_GEMINI_BASE_URL for API-key sign-in, GOOGLE_VERTEX_BASE_URL for Vertex AI sign-in, both restricted to HTTPS (or localhost). This makes operation through a central proxy such as the AI Gateway possible, provided that proxy offers the API format Gemini CLI expects — the Gemini API or Vertex AI protocol.

Enterprise use: data protection and governance

OpenTelemetry-based telemetry (GEMINI_TELEMETRY_ENABLED) is disabled by default and must be actively switched on before logs, metrics and traces can be sent to Google Cloud, local files, or a custom OTLP endpoint. Separate from this is the anonymous usage-statistics setting (privacy.usageStatisticsEnabled), which, per the configuration reference, is enabled by default and can be turned off in settings.json. For enterprise settings, the documentation explicitly recommends setting telemetry.logPrompts to false so prompt content is not logged. Administrators can enforce Google sign-in via security.auth.enforcedType, restrict access to their own Workspace domain via X-GoogApps-Allowed-Domains, restrict tools via an allowlist (tools.core), and mandate sandboxing centrally. The Gemini CLI documentation does not state a specific EU data residency or GDPR commitment; Vertex AI users set the region themselves via GOOGLE_CLOUD_LOCATION. Regardless of the auth route: source code and prompts go to the chosen model provider (Google) and belong in the record of processing activities beforehand. Since 18 June 2026, per Google’s official announcement of 19 May 2026 (published as part of Google I/O 2026) and a banner in the Gemini CLI documentation, free access for Google AI Pro and Ultra, Gemini Code Assist for individuals, and Google One users has been discontinued (Google points to Antigravity CLI as the replacement); Code Assist licences and paid API access are unaffected.

Orchestrating Gemini CLI with herdr

The terminal multiplexer herdr detects Gemini CLI, but as of 20 September 2026 its own agent overview classifies the integration, together with Cline, as “detected but less thoroughly tested” — unlike agents with a documented screen manifest or lifecycle hooks, the state of this integration is not yet fully specified.

Where it fits: developer harness and enterprise harness

Like other coding harnesses, Gemini CLI targets developers working in the terminal. For business users without a terminal workflow, CompanyGPT is the matching harness — with tools via MCP servers, integrations and n8n instead of shell commands. The AI Gateway provides the shared cost and governance layer across all model access in an organisation. An overview of further harnesses is available on the AI harness overview page. We help organisations fit Gemini CLI and other coding harnesses cleanly into an existing AI governance concept.

From developer harness to enterprise harness

Coding harnesses are tools for developers. Business users, cost control and governance need two more layers.

CompanyGPT – the harness for business users

CompanyGPT gives any language model tools via MCP servers, integrations and n8n, company knowledge via companyRAG, roles from Entra ID or Keycloak, and audit logs – operated in your Azure environment or sovereignly on STACKIT.

Discover CompanyGPT
AI Gateway – cost and governance for every agent

The AI Gateway bundles the model access of your tools and coding agents behind an OpenAI-compatible API: authentication via Entra ID, budgets and cost centres per team, user and agent, guardrails and complete logging.

View the AI Gateway

Frequently Asked Questions

What is Gemini CLI?

Gemini CLI is an open-source AI agent from Google that brings Gemini models directly into the terminal. It provides tools for the file system, shell and web, manages context via `GEMINI.md` files, and can be extended with custom servers via MCP.

Is Gemini CLI open source?

Yes. Gemini CLI is licensed under Apache-2.0, the full source code is in the `google-gemini/gemini-cli` GitHub repository, and the community actively contributes via pull requests.

Which models does Gemini CLI support?

Gemini CLI works exclusively with Gemini models from the current Gemini 3 family. Switching to models from other providers such as Claude or GPT is not documented as supported.

Is Gemini CLI still free to use?

Free access for the unpaid tier (including Gemini Code Assist for individuals) and for Google One users has, per the Gemini CLI documentation, been discontinued since 18 June 2026; Google points to Antigravity CLI as the replacement. Gemini CLI remains available via a paid Gemini API key, Vertex AI, or a Gemini Code Assist licence.

What is the difference between Gemini CLI and Antigravity CLI?

Antigravity CLI is the successor Google announced for individual users and, per Google, shares the same agent harness as the Antigravity 2.0 desktop application. Gemini CLI continues as an independent open-source project, mainly for enterprise licences and API access.

Does Gemini CLI work with herdr?

Yes, herdr detects Gemini CLI, but as of 20 September 2026 its own documentation classifies the integration as less thoroughly tested than for the other supported agents.

Introduce coding agents safely in your company

We support selection, model access in the EU, permission design and cost control.