Skip to main content
← Coding

Gemini CLI

Google
Coding Terminal Local Open source 8 axes checked Active Checked 2026-10-23

Read the two badges separately: the first is whether this page is backed by evidence, the second is whether the product is still maintained. An archived product can have complete evidence; complete evidence does not mean the product is active.

30-second check: should it make your shortlist?

In one line

Google's official open-source terminal agent — npx, no install required. Explicit MCP…

How you use it

Local / self-hosted · CLI

Licence / commercial use

Open licence

Read the original licence before commercial use
Mainland China

Direct in mainland · Not in filing list

These four cards help you rule things out, not decide for you. The real differences are in the eight questions and sources below.

Information not confirmed

  • The concrete available model list and version mapping — the official README does not list them fully (configuration page checked)
  • The semantic-indexing (RAG) algorithm and large-repo performance — not stated officially

Google's official open-source terminal agent — npx, no install required. Explicit MCP support, plus a non-interactive script mode.

When to use it, when not to

Three scenarios fit:

  • You want a quick trial without installing anything (npx leaves no install footprint)
  • You need MCP extensions, especially wiring Gemini's multimodal generation (Imagen / Veo / Lyria) into an agent workflow
  • You need scripted non-interactive runs, for example in CI

Three kinds of people also fit:

  • Anyone who needs a large context window — 1M tokens, one of the few in this track that states a limit
  • Anyone who needs a revert guarantee — shadow Git checkpoints plus /restore
  • Anyone who needs a project-level long-term instruction file — GEMINI.md

Not a fit for treating quota as unlimited. The free tier has clear daily limits: 6,000 code requests + 240 chats/day. And CLI and agent-mode quota are counted together.

China availability domestic / direct access / CAC filing · snapshot 2026-10-23

Origin
foreign-made foreign entity (no matching filing entity in the CAC registry).
Direct access
direct OK Hosted on GitHub — direct reachability from mainland fluctuates (200/000 mixed on the same day); npm / PyPI install routes measured stable.
CAC filing
not in filing list:not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.

Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.

8 questions, one table

8 questions, each comparable item by item with its peers.

Model & openness

Uses Google's own Gemini family; models can be switched. The context ceiling is explicitly stated as 1M tokens.

README first-screen wording: "Powerful Gemini 3 models: Access to improved reasoning and 1M token context window"

Switching models: specify via gemini -m gemini-2.5-flash on the command line. When signing in with a Gemini API Key, the official description is:

"Model selection: Choose specific Gemini models"

Three access modes (README "Authentication Options"):

  • Google account OAuth login — the free tier uses this: 60 requests/min, 1,000 requests/day, no key to manage
  • Gemini API Key — get a key in AI Studio, pay per usage
  • Vertex AI — for enterprises, requires a project and region

Model routing: Plan Mode can use general.plan.modelRouting. It switches automatically between Pro (planning) and Flash (implementation). There is also experimental Local Model Routing (Gemma).

The exact list of switchable models on the CLI side and their version mapping: the official docs do not give a complete list. (Repository docs and the reference/configuration page both checked.)

Where it runs

A local process, running in the terminal, launchable without installation via npx.

The official docs make "no installation" a first-screen selling point of the repository — this is how it lowers the entry barrier.

README wording: "Using npx (no installation required)"

Local files

Built-in file tools default to the workspace as root, with a clear boundary.

Official "File system tools" page wording: All file system tools operate within a rootDirectory (the current working directory or workspace root) for security

Tool set:

  • list_directory
  • read_file — supports text / images / audio / PDF
  • write_file
  • replace
  • glob
  • grep_search

Which ones need your nod to act:

  • write_file and replace — officially marked "Requires manual user approval"

Extending directories: launch with gemini --include-directories ../lib,../docs. Within a session use /directory add <path> (disabled under restricted sandbox configs).

Ignore boundary: respects .gitignore, and supports .geminiignore with the same syntax.

Changes are revertible: when you approve a file-changing tool, the CLI commits a snapshot. It lands in a shadow Git repository, not interfering with your own project repo. /restore reverts.

The repo location recorded on the checkpointing page: ~/.gemini/history/<project_hash>

Original wording: "It does not interfere with your own project's Git repository"

The semantic-indexing (Code Customization / RAG) algorithm and large-repo time cost are not stated officially. (file-system and configuration pages checked; only debug switches like general.logRagSnippets exist.)

Tasks after shutdown

A local CLI; it cannot keep running after shutdown.

Non-interactive / headless is scripting, not background. It still runs on your own machine.

Official "Headless mode" page wording: "Headless mode provides a programmatic interface to Gemini CLI... without an interactive terminal UI"

Triggers:

  • non-TTY environments
  • -p/--prompt

Output can be JSON or stream-json for CI and automation to consume.

The execution environment is yours: the official docs provide no vendor-hosted resident execution environment. The GitHub Action in the repository also runs on your repo's CI runners.

Interruption is recoverable: checkpointing and /chat save / /resume can save and restore sessions. The switch is general.checkpointing.enabled. general.sessionRetention defaults to 30 days. Expired sessions are cleaned up automatically.

Quota is exactly the daily request ceilings in the official usage policy. The official docs set no separate cloud quota.

Tools & extensions

MCP is explicitly supported and is one of its headline features.

README wording: "🔌 Extensible: MCP (Model Context Protocol) support for custom capabilities"

MCP has its own docs page: /docs/tools/mcp-server. The example it gives is using MCP to connect multimodal generation:

"Use MCP servers to connect new capabilities, including media generation with Imagen, Veo or Lyria"

This example deserves its own note: here MCP is not just connecting tools, it can also connect Google's multimodal generation capabilities (image / video / audio). This usage is not emphasized on the first screen of other CLI tools' repositories.

Built-in tool list:

  • Google Search grounding
  • shell

There is also non-interactive mode for script automation. The official docs have a dedicated section "Non-interactive mode for scripts".

Context & memory

1M-token context + layered GEMINI.md context + automatic history compression — all three have dedicated official pages.

Context window: the README first screen says Gemini 3 models with 1M token context window.

Context layers (official "GEMINI.md" page):

  • ① global ~/.gemini/GEMINI.md
  • ② GEMINI.md in workspace directories and their parents
  • ③ JIT — when a tool accesses a directory, it scans that directory's and its ancestors' GEMINI.md (up to the trusted root)

The file name can be changed via context.fileName (e.g. AGENTS.md / CONTEXT.md).

GEMINI.md page: supports imports via @file.md syntax. /memory show and /memory reload inspect and reload.

Compaction strategy verified (official core page):

"When a conversation approaches the token limit... the core automatically compresses the conversation history"

The threshold is controlled by model.compressionThreshold. The default is 0.5. You can also /compress to manually replace the whole context with a summary.

Cross-session memory: the official Memory tool writes durable facts into GEMINI.md (project / global two levels), injected into later sessions via the layered context. Token caching is only available to API key / Vertex users.

Permissions & limits

Sandbox, approvals and trusted folders each have dedicated official pages — the most finely documented permission surface in this section.

Sandbox: the official "Sandboxing" page gives these mechanisms.

  • macOS Seatbelt — default profile permissive-open: deny by default, writes limited to the project directory, but reads and network allowed
  • Docker / Podman
  • native Windows
  • gVisor / runsc
  • LXC / LXD (experimental)

Enabling:

  • -s/--sandbox
  • GEMINI_SANDBOX
  • tools.sandbox

Tool-level additionally has security.toolSandboxing.

Sandbox expansion: when a command fails due to permission limits, a "Sandbox Expansion Request" pops up. Approving case by case relaxes it temporarily. Out-of-bounds directories can be mounted via SANDBOX_MOUNTS.

Approval modes (configuration page): general.defaultApprovalMode has three values:

  • default — ask each time
  • auto_edit
  • plan — read-only

--yolo (auto-approve everything) can only be enabled on the command line.

Policy engine ("Policy engine" page): ~/.gemini/policies/*.toml defines allow / deny / ask_user via rules. Match conditions can key on tool name, arguments, approval mode, and interactive / non-interactive environment. Rules have four tiers: Default / Extension / User / Admin. Admin can force-override.

Trusted Folders: off by default. The switch is security.folderTrust.enabled. When untrusted it enters safe mode — ignoring workspace .gemini/settings.json and .env, disabling tool auto-accept, not connecting MCP, not loading custom commands. To bypass in CI there are two routes:

  • --skip-trust
  • GEMINI_CLI_TRUST_WORKSPACE=true

The configuration page also has an environment-variable redaction section.

Best for

Fits three scenarios:

  • wanting an install-free quick trial (npx, leaving no installation trace)
  • needing MCP extensions, especially wiring Gemini's multimodal generation (Imagen / Veo / Lyria) into an agent workflow
  • needing scripted non-interactive runs, e.g. wiring into CI

Three more kinds of people also fit:

  • those needing a large context window — 1M tokens, one of the few in this section with an explicit ceiling stated
  • those needing a "changes are revertible" guarantee — shadow-Git checkpoints plus /restore
  • those needing a project-level standing instruction file — GEMINI.md

Not a fit for treating the quota as unlimited. The free tier has explicit daily ceilings: 6,000 code requests + 240 chats/day. And CLI and proxy-mode quotas are counted together.

Top misconception

  • Assuming open source means unlimited use — the free tier has clear daily limits (6,000 code requests + 240 chats/day)
  • Assuming the npx form pollutes your local environment — it runs temporarily with no install
  • Overlooking MCP support — the repository README lists it explicitly as an extensibility feature

Evidence sources

Checked 2026-10-23,Content updated 2026-09-29。This is the date of the entry, not a claim that every field was rechecked that day.

TypeNameLink
repoGoogle · Gemini CLI repository READMEhttps://github.com/google-gemini/gemini-cli
changelogGoogle · Gemini CLI Releaseshttps://github.com/google-gemini/gemini-cli/releases
docsGoogle · Gemini CLI official documentationhttps://google-gemini.github.io/gemini-cli/
docsOfficial docs · Sandboxing (-s/GEMINI_SANDBOX, Seatbelt default profile permissive-open, Docker/Podman/Windows/gVisor/LXC, toolSandboxing, Sandbox Expansion)https://www.geminicli.com/docs/cli/sandbox
docsOfficial docs · Trusted Folders (off by default, safe-mode prohibitions, --skip-trust, GEMINI_CLI_TRUST_WORKSPACE)https://www.geminicli.com/docs/cli/trusted-folders
docsOfficial docs · Policy Engine (~/.gemini/policies/*.toml, allow/deny/ask_user tiers)https://www.geminicli.com/docs/reference/policy-engine
docsOfficial docs · GEMINI.md (three-layer context hierarchy, @file.md imports, context.fileName, /memory)https://www.geminicli.com/docs/cli/gemini-md
docsOfficial docs · Core (chat history compression: automatic compaction, model.compressionThreshold)https://www.geminicli.com/docs/core
docsOfficial docs · Headless mode (-p/--prompt, JSON / stream-json, exit codes)https://www.geminicli.com/docs/cli/headless
docsOfficial docs · Checkpointing (shadow-Git snapshot on approving file-changing tools, /restore, off by default)https://www.geminicli.com/docs/cli/checkpointing
docsOfficial docs · File system tools (tool set, rootDirectory boundary, write/replace need approval)https://www.geminicli.com/docs/tools/file-system
docsOfficial docs · Memory files (durable facts written into GEMINI.md, project/global two levels)https://www.geminicli.com/docs/tools/memory
docsOfficial docs · Ignoring files (.geminiignore)https://www.geminicli.com/docs/cli/gemini-ignore
docsOfficial docs · Token caching (API key / Vertex users only)https://www.geminicli.com/docs/cli/token-caching
docsOfficial docs · Configuration (approval mode, sandbox, checkpointing, sessionRetention, context.fileName, RAG logging switch)https://www.geminicli.com/docs/reference/configuration
docsGoogle · Gemini CLI MCP Server docshttps://www.geminicli.com/docs/tools/mcp-server

Test notes

This site has not completed measured runs. The test protocol is at protocols/coding/_protocol.md.

Suggested measurement: focus on three things (capabilities officially advertised but not yet verified here):

  1. the actual startup speed of npx no-install launch
  2. whether non-interactive mode really works in CI (no TTY) environments
  3. shadow-Git checkpoint behavior on Windows — the docs say the path is ~/.gemini/history/; whether Windows has compatibility issues is pending verification

Release-channel note

VersionDate
v0.63.0-nightly.20260929.gfe63502382026-09-29

Note the version shape: it publishes nightly tags, with the commit hash embedded in the version number. That means it follows nightly rolling releases. When citing a version number, write it in full — do not abbreviate to v0.63.0. Nightly patch contents differ day by day.

Three explicit engineering capabilities

① npx, no installation

README wording: "Using npx (no installation required)"

This is a design that lowers the usage barrier — good for quick trials or temporary use, leaving no installation trace locally.

② MCP support is an officially labeled core feature

MCP is marked as a core feature, symbolized by that plug icon:

"🔌 Extensible: MCP (Model Context Protocol) support for custom capabilities"

It also uses MCP to connect multimodal generation:

"Use MCP servers to connect new capabilities, including media generation with Imagen, Veo or Lyria"

This example deserves its own note: MCP here is not just connecting tools; it can also connect Google's multimodal generation capabilities (image / video / audio). This is a usage other CLI tools do not emphasize on their repository first screens.

The official docs have a dedicated page: /docs/tools/mcp-server

③ Non-interactive mode

The README has a dedicated section "Non-interactive mode for scripts", positioned as workflow automation.

This is the only one of the three CLI tools that spells out non-interactive capability on the repository first screen — a signal of CI-integration friendliness.

Permission-grading note

Why confidence: partial:

  • ✅ verified: repository, license (Apache-2.0), version shape and date, star count (107,524 · rolling check 2026-10-23), MCP support and its docs page, non-interactive mode, npx install method, the official example of MCP connecting multimodal generation
  • ✅ added in the 2026-10-08 round: quota policy (Code Assist individuals 6,000/240 etc.), three access modes and -m model switching, GEMINI.md three-layer context and automatic history compression, sandbox / approvals / trusted folders / policy engine permission mechanics
  • ❌ not verified: the complete list of switchable models on the CLI side and version mapping (not fully listed officially), the semantic-indexing (RAG) algorithm and large-repo time cost (not stated officially)

Two things worth noting separately

① Checkpoints use shadow Git, not polluting your repo

When you approve a file-changing tool (write_file / replace), the CLI commits a snapshot.

  • the snapshot repo lives at ~/.gemini/history/<project_hash>
  • it is a separate Git repository; it will not touch your project repo
  • to revert, use /restore

The source is the checkpointing doc:

original wording: "It does not interfere with your own project's Git repository"

This is one of the few in this section that builds the "safety net" into the mechanism — most tools rely on "auto-committing into your repo" or "letting you undo yourself".

② GEMINI.md is the project-level standing instruction

It is like writing "how this project does things" into a file; multiple forms (CLI / VS Code / JetBrains) all read it. This is the same class of mechanism as Cline's .clinerules and Claude Code's CLAUDE.md — worth a cross-tool comparison.

Related entries

Same-category peers

Look at these three before reading further

Selected by overlap in jobs, not ranked. Compare where it runs, licence and status first; if one of the three fails, skip it.

ObjectWhereLicenceEvidence / statusWhat it is for
AmpCloud / APINot checked8 questions checked
Active
Sourcegraph's Amp: a frontier coding agent spanning CLI + cloud orbs + r
Claude Code CLILocal / self-hostedNot checked8 questions checked
Active
A terminal coding and tool-execution product, with a CHANGELOG and Atom
Codex CLILocal / self-hostedNot checked8 questions checked
Active
OpenAI's official terminal coding agent, written in Rust, architecturall

This page is generated from the ai-handbook data layer (CC BY 4.0). For the judging criteria and method notes, see METHODOLOGY.md.