Gemini CLIGemini CLI
Google 官方的开源终端 agent,npx 免安装启动。 明确支持 MCP,另有非交互脚本模式。
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
它适合这些场景:
- 需要 npx 免安装快速试用
- 需要 MCP 扩展
- 需要脚本化非交互运行(CI)
- 想把 Gemini 多模态生成(Imagen / Veo / Lyria)接进工作流
也适合这些人:
- 需要大上下文窗口的人 —— 1M token,本分区里明确写出上限的少数
- 需要「改动可回退」保证的人 —— shadow Git 检查点加
/restore - 需要项目级长期指令文件的人 —— GEMINI.md
不适合把额度当成无限用的场景: 免费层有明确日额度(6,000 代码请求 + 240 对话)。 而且 CLI 与代理模式额度合并计算。
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-20
- 出品属地Origin
- 国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
- 国内使用Direct access
- 大陆可直连direct OK 官网仓库在 GitHub,大陆直连波动(同日实测 200/000 混合);npm / PyPI 安装源实测稳定可达。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:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。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.
备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。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.
固定坐标系Fixed coordinate system
8 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.
- 模型与开放条件Model & openness
用 Google 自家的 Gemini 系列,模型可以换。 上下文上限明确标了 1M token。
README 首屏原文:「Powerful Gemini 3 models: Access to improved reasoning and 1M token context window」
换模型:命令行用
gemini -m gemini-2.5-flash指定。 用 Gemini API Key 登录时,官方描述是:"Model selection: Choose specific Gemini models"
三种接入方式(README「Authentication Options」):
- Google 账号 OAuth 登录 —— 免费层用这个,60 请求/分、1,000 请求/日,不用管 key
- Gemini API Key —— 在 AI Studio 取 key,按量计费
- Vertex AI —— 企业用,需要项目和区域
模型路由:Plan Mode 可用
general.plan.modelRouting。 它在 Pro(规划)与 Flash(实现)之间自动切换。 另有实验性的 Local Model Routing(Gemma)。CLI 侧可切换模型的具体清单与版本映射:官方未给出完整列表。 (已查仓库文档与 reference/configuration 两页。)
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-flashon 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
本地进程,在终端里跑,靠 npx 免安装启动。
官方把「免安装」写成仓库首屏的卖点,这是它降低上手门槛的地方。
README 原文:「Using npx (no installation required)」
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
内置文件工具默认以工作区为根,边界明确。
官方「File system tools」页原文:All file system tools operate within a
rootDirectory(the current working directory or workspace root) for security工具集:
list_directoryread_file—— 支持文本 / 图片 / 音频 / PDFwrite_filereplaceglobgrep_search
哪些要你点头才能动:
write_file与replace—— 官方标注 "Requires manual user approval"
扩目录:启动加参数
gemini --include-directories ../lib,../docs。 会话内用/directory add <path>(受限沙箱配置下禁用)。忽略边界:遵守
.gitignore,也支持同语法的.geminiignore。改动可回退:批准改文件的工具时,CLI 会提交一次快照。 它落在 shadow Git 仓库里,不干扰你自己的项目仓库。 可用
/restore回退。checkpointing 页记的仓库位置:
~/.gemini/history/<project_hash>原文:「It does not interfere with your own project's Git repository」
语义索引(Code Customization / RAG)的算法与大仓库耗时官方未说明。 (已查 file-system 与 configuration 两页,只有
general.logRagSnippets这类调试开关。)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 securityTool set:
list_directoryread_file— supports text / images / audio / PDFwrite_filereplaceglobgrep_search
Which ones need your nod to act:
write_fileandreplace— 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.geminiignorewith 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.
/restorereverts.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.logRagSnippetsexist.)- 关机后的任务Tasks after shutdown
本地 CLI,不支持关机续跑。
非交互 / headless 是脚本化,不是后台。 它仍跑在你自己的机器上。
官方「Headless mode」页原文:"Headless mode provides a programmatic interface to Gemini CLI... without an interactive terminal UI"
触发方式是:
- 非 TTY 环境
-p/--prompt
输出可选 JSON 或 stream-json,供 CI 与自动化调用。
执行环境归你:官方未提供厂商托管的常驻执行环境。 仓库里的 GitHub Action 也跑在你仓库的 CI runner 上。
中断可恢复:checkpointing 与
/chat save//resume可以保存和恢复会话。 开关是general.checkpointing.enabled。general.sessionRetention默认保留 30 天。 超期自动清理。额度就是官方用量口径里的每日请求上限。 官方未另设云端额度。
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//resumecan save and restore sessions. The switch isgeneral.checkpointing.enabled.general.sessionRetentiondefaults 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,而且是它标注的核心特性。
README 原文:「🔌 Extensible: MCP (Model Context Protocol) support for custom capabilities」
MCP 另有独立文档页:
/docs/tools/mcp-server。 它举的例子是把 MCP 用来接多模态生成:「Use MCP servers to connect new capabilities, including media generation with Imagen, Veo or Lyria」
这条例子值得单独记:MCP 在这里不只是接工具, 还能接 Google 的多模态生成能力(图像 / 视频 / 音频)。 这个用法在其它 CLI 工具的仓库首屏里没被强调。
内置工具清单:
- Google Search grounding(搜索接地)
- shell
另有非交互模式做脚本自动化。官方有独立章节 「Non-interactive mode for scripts」。
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 上下文 + GEMINI.md 分层上下文 + 自动历史压缩,三项都有官方专页。
上下文窗口:README 首屏写 Gemini 3 models with 1M token context window。
上下文层级(官方「GEMINI.md」页):
- ① 全局
~/.gemini/GEMINI.md - ② 工作区目录及其父目录的
GEMINI.md - ③ JIT —— 工具访问某目录时,扫描它和祖先目录的
GEMINI.md(至 trusted root)
文件名可由
context.fileName改(如 AGENTS.md / CONTEXT.md)。GEMINI.md 页:支持用
@file.md语法导入。/memory show与/memory reload可查看与重载。压缩策略已核到(官方 core 页):
"When a conversation approaches the token limit... the core automatically compresses the conversation history"
阈值由
model.compressionThreshold控制。 默认值是 0.5。 也可以/compress手动把整个上下文替换为摘要。跨会话记忆:官方 Memory 工具把持久事实写进
GEMINI.md(项目 / 全局两级), 随分层上下文注入后续会话。token caching 仅 API key / Vertex 用户可用。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.mdin 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.mdsyntax./memory showand/memory reloadinspect 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/compressto 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
沙箱、审批、信任目录三层官方都有专页,是本分区里权限面写得最细的一条。
沙箱:官方「Sandboxing」页给了这些方式。
- macOS Seatbelt —— 默认档
permissive-open:默认拒绝、写限项目目录,但允许读与网络 - Docker / Podman
- Windows 原生
- gVisor / runsc
- LXC / LXD(实验)
启用方式:
-s/--sandboxGEMINI_SANDBOXtools.sandbox
工具级另有
security.toolSandboxing。沙箱扩张:命令因权限受限失败时,会弹 "Sandbox Expansion Request"。逐次批准可临时放宽。 越界目录可用
SANDBOX_MOUNTS挂载。审批模式(configuration 页):
general.defaultApprovalMode有三个值:default—— 逐次询问auto_editplan—— 只读
--yolo(全部自动批准)只能在命令行开。策略引擎(「Policy engine」页):
~/.gemini/policies/*.toml用规则定义allow/deny/ask_user。 匹配条件可按工具名、参数、审批模式与交互 / 非交互环境。 规则分 Default / Extension / User / Admin 四级。 Admin 可强制覆盖。Trusted Folders:默认关闭。 开关是
security.folderTrust.enabled。 未信任时进 safe mode —— 忽略工作区.gemini/settings.json与.env、 禁用工具自动接受、不连 MCP、不加载自定义命令。 CI 想绕过的话,有两条路:--skip-trustGEMINI_CLI_TRUST_WORKSPACE=true
configuration 页另有环境变量脱敏一节。
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/--sandboxGEMINI_SANDBOXtools.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.defaultApprovalModehas three values:default— ask each timeauto_editplan— read-only
--yolo(auto-approve everything) can only be enabled on the command line.Policy engine ("Policy engine" page):
~/.gemini/policies/*.tomldefinesallow/deny/ask_uservia 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.jsonand.env, disabling tool auto-accept, not connecting MCP, not loading custom commands. To bypass in CI there are two routes:--skip-trustGEMINI_CLI_TRUST_WORKSPACE=true
The configuration page also has an environment-variable redaction section.
- macOS Seatbelt —— 默认档
- 适合什么任务Best for
适合三类场景:
- 想免安装快速试用(npx,不留安装痕迹)
- 需要 MCP 扩展,尤其是把 Gemini 的多模态生成能力(Imagen / Veo / Lyria)接进 Agent 工作流
- 需要脚本化非交互运行,比如接进 CI
另外三类人也合适:
- 需要大上下文窗口的人 —— 1M token,是本分区里明确写出上限的少数
- 需要「改动可回退」保证的人 —— shadow Git 检查点加
/restore - 需要项目级长期指令文件的人 —— GEMINI.md
不适合把额度当成无限用的场景。 免费层有明确日额度,数字是 6,000 代码请求 + 240 对话/日。 而且 CLI 与代理模式额度合并计算。
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
- 以为开源就无限用 —— 免费层有明确日额度(6,000 代码请求 + 240 对话/日)Assuming open source means unlimited use — the free tier has clear daily limits (6,000 code requests + 240 chats/day)
- 以为 npx 形态会污染本地环境,实际是免安装的临时运行Assuming the npx form pollutes your local environment — it runs temporarily with no install
- 忽略 MCP 能力,README 明确把它列为可扩展特性Overlooking MCP support — the repository README lists it explicitly as an extensibility feature
未知项清单Known unknowns
- 具体可用模型清单与版本映射 —— 官方 README 未列全(已查 configuration 页)
- 语义索引(RAG)算法与大仓库表现 —— 官方未说明
- 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
证据来源Evidence sources
判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-23,内容更新日content updated on 2026-09-29。
| 类型Type | 名称Name | 链接Link |
|---|---|---|
| repo | Google · Gemini CLI 仓库 READMEGoogle · Gemini CLI repository README | https://github.com/google-gemini/gemini-cli |
| changelog | Google · Gemini CLI ReleasesGoogle · Gemini CLI Releases | https://github.com/google-gemini/gemini-cli/releases |
| docs | Google · Gemini CLI 官方文档Google · Gemini CLI official documentation | https://google-gemini.github.io/gemini-cli/ |
| docs | 官方文档 · Sandboxing(-s/GEMINI_SANDBOX、Seatbelt 默认档 permissive-open、 Docker/Podman/Windows/gVisor/LXC、toolSandboxing、Sandbox Expansion)Official 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 |
| docs | 官方文档 · Trusted Folders(默认关闭、safe mode 禁项、--skip-trust、 GEMINI_CLI_TRUST_WORKSPACE)Official docs · Trusted Folders (off by default, safe-mode prohibitions, --skip-trust, GEMINI_CLI_TRUST_WORKSPACE) | https://www.geminicli.com/docs/cli/trusted-folders |
| docs | 官方文档 · Policy Engine(~/.gemini/policies/*.toml、 allow/deny/ask_user 层级)Official docs · Policy Engine (~/.gemini/policies/*.toml, allow/deny/ask_user tiers) | https://www.geminicli.com/docs/reference/policy-engine |
| docs | 官方文档 · GEMINI.md(三层上下文层级、@file.md 导入、context.fileName、/memory)Official docs · GEMINI.md (three-layer context hierarchy, @file.md imports, context.fileName, /memory) | https://www.geminicli.com/docs/cli/gemini-md |
| docs | 官方文档 · Core(Chat history compression:自动压缩、model.compressionThreshold)Official docs · Core (chat history compression: automatic compaction, model.compressionThreshold) | https://www.geminicli.com/docs/core |
| docs | 官方文档 · Headless mode(-p/--prompt、JSON / stream-json、退出码)Official docs · Headless mode (-p/--prompt, JSON / stream-json, exit codes) | https://www.geminicli.com/docs/cli/headless |
| docs | 官方文档 · Checkpointing(改文件工具批准时 shadow Git 快照、/restore、默认关闭)Official docs · Checkpointing (shadow-Git snapshot on approving file-changing tools, /restore, off by default) | https://www.geminicli.com/docs/cli/checkpointing |
| docs | 官方文档 · File system tools(工具集、rootDirectory 边界、write/replace 需批准)Official docs · File system tools (tool set, rootDirectory boundary, write/replace need approval) | https://www.geminicli.com/docs/tools/file-system |
| docs | 官方文档 · Memory files(持久事实写入 GEMINI.md 分项目/全局两级)Official docs · Memory files (durable facts written into GEMINI.md, project/global two levels) | https://www.geminicli.com/docs/tools/memory |
| docs | 官方文档 · Ignoring files(.geminiignore)Official docs · Ignoring files (.geminiignore) | https://www.geminicli.com/docs/cli/gemini-ignore |
| docs | 官方文档 · Token caching(仅 API key / Vertex 用户可用)Official docs · Token caching (API key / Vertex users only) | https://www.geminicli.com/docs/cli/token-caching |
| docs | 官方文档 · Configuration(approval mode、sandbox、checkpointing、 sessionRetention、context.fileName、RAG 日志开关)Official docs · Configuration (approval mode, sandbox, checkpointing, sessionRetention, context.fileName, RAG logging switch) | https://www.geminicli.com/docs/reference/configuration |
| docs | Google · Gemini CLI MCP Server 文档Google · Gemini CLI MCP Server docs | https://www.geminicli.com/docs/tools/mcp-server |
实测记录Measured runs
本档未跑端到端编码任务;能力结论来自官方文档,编码向测量协议见 protocols/coding/_protocol.md。
实测建议:重点放在三处(官方明确宣传、但还没验证过的能力):
1. npx 免安装的实际启动速度 2. 非交互模式在 CI(无 TTY)环境下是否真的可用 3. shadow Git 检查点在 Windows 上的行为 —— 文档说路径是 ~/.gemini/history/,Windows 上是否有兼容问题待验
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
| 版本 | 日期 |
|---|---|
v0.63.0-nightly.20260929.gfe6350238 | 2026-09-29 |
注意版本形态:它发布的是 nightly 标签,版本号里带 commit hash。 说明它走 nightly 滚动发布。 引用版本号时要完整写,不要简写成 v0.63.0。 nightly 的补丁内容每天不同。
| Version | Date |
|---|---|
v0.63.0-nightly.20260929.gfe6350238 | 2026-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 免安装
README 原文:「Using npx (no installation required)」
这是降低使用门槛的设计,适合快速试用或临时使用,不会在本地留下安装痕迹。
② MCP 支持是官方标注的核心特性
MCP 被它标成核心特性,标记就是那个插头图标:
「🔌 Extensible: MCP (Model Context Protocol) support for custom capabilities」
它还用 MCP 接多模态生成:
「Use MCP servers to connect new capabilities, including media generation with Imagen, Veo or Lyria」
这条例子值得单独记:MCP 在这里不只是接工具, 还能接 Google 的多模态生成能力(图像 / 视频 / 音频)。 这是其它 CLI 工具没在仓库首屏里强调的用法。
官方文档另有独立页:/docs/tools/mcp-server
③ 非交互模式
README 有独立章节 「Non-interactive mode for scripts」,定位是 workflow automation。
这是三个 CLI 工具里唯一在仓库首屏就明确标出非交互能力的 —— CI 集成友好度的信号。
① 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
confidence: partial 的原因:
- ✅ 已核验:仓库、许可(Apache-2.0)、版本形态与日期、star 数(107,524 · 滚动核验 2026-10-23)、 MCP 支持及文档页、非交互模式、npx 安装方式、MCP 接入多模态生成的官方举例
- ✅ 2026-10-08 补充:额度政策(Code Assist individuals 6,000/240 等)、 三种接入方式与
-m换模型、GEMINI.md 三层上下文与自动历史压缩、 沙箱 / 审批 / 信任目录 / 策略引擎权限机制
- ❌ 未核验:CLI 侧可切换模型的完整清单与版本映射(官方未列全)、 语义索引(RAG)算法与大仓库耗时(官方未说明)
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
-mmodel 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
① 检查点用 shadow Git,不污染你的仓库
批准一个改文件的工具(write_file / replace)时,CLI 会提交一次快照。
- 快照仓库在
~/.gemini/history/<project_hash> - 它是独立的 Git 仓库,不会动你的项目仓库
- 要回退就
/restore
出处是 checkpointing 那份文档:
原文:「It does not interfere with your own project's Git repository」
这是本分区里把「安全网」做进机制的少数 —— 多数工具靠「自动提交到你的仓库」,或者「让你自己 undo」。
② GEMINI.md 是项目级长期指令
它相当于把「这个项目怎么做事」写进一个文件, 多形态(CLI / VS Code / JetBrains)都会读它。 这与 Cline 的 .clinerules、Claude Code 的 CLAUDE.md 是同一类机制,值得横向对照。
① 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
- Codex CLICodex CLI同类 OpenAI 官方工具the analogous OpenAI official tool
- CrushCrush同类工具,MCP 传输方式标注更细a similar tool; its MCP transport documentation is more granular
- Google ADK(Agent Development Kit)Google ADK(Agent Development Kit)另一层 · 框架与运行时Other layer · Frameworks & runtimes
本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0).
方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.