Terminal agent
Gemini CLI
Coding agent from Google. Runs on: macOS, Linux, Windows, Terminal. Supports MCP servers.
Checked 2026-10-31
Install
npm install -g @google/gemini-cliCommands come from the project's own docs or registry entry. Check them against the source before you run them.
Loading poll...
Gemini CLI is Google's open-source terminal coding agent, licensed Apache-2.0. Since 18 June 2026 it is meant for organizations with Gemini Code Assist Standard or Enterprise on Google Cloud. Individuals and Google AI Pro or Ultra subscribers were moved to Antigravity CLI. Checked 31 October 2026.
At a glance
Gemini CLI | |
|---|---|
Vendor | |
License | Apache-2.0 |
Command |
|
Install |
|
Who it is for now | Gemini Code Assist Standard or Enterprise, Code Assist for GitHub, plus legacy paid API or Vertex keys |
Auth | Google sign-in with a Cloud project, a Gemini API key, or Vertex AI |
Project context file |
|
Extending | MCP servers in |
Replacement for individuals | Antigravity CLI |
The status change you need to know first
Most older guides and videos still describe Gemini CLI as a free agent with a generous individual tier. That is out of date. The README now opens with a warning box, and its main points are:
- Enterprise Code Assist only. The tool is designed for Gemini Code Assist Standard or Enterprise licenses and Code Assist for GitHub on Google Cloud. Access for those customers is unchanged.
- No free tier or Google AI plans. Free individual access and Google AI Pro and Ultra moved to Antigravity CLI on 18 June 2026.
- Not tuned for Gemini 4 and later. The README says it is not optimized for the Gemini 4 series or later generations.
- Not for benchmarks. The README says not to use it to benchmark Gemini models because its harness "produces unrepresentative scores."
The Google developers blog post on the transition adds that Gemini CLI also remains available through paid Gemini and Gemini Enterprise Agent Platform API keys, and that Antigravity CLI keeps Agent Skills, hooks, subagents and extensions, which are now called Antigravity plugins. It warns that feature parity is not one-to-one at launch.
So the first decision is not "Gemini CLI or Claude Code". It is "which of Google's tools do I belong to".
Which Google CLI do you need?
The README has its own table. In our words:
If you are | Use |
|---|---|
An individual, a free user, or a Google AI Pro or Ultra subscriber | Antigravity CLI |
An organization with Code Assist Standard or Enterprise on Google Cloud | Gemini CLI (this page) |
Writing scripts or CI that need raw Gemini model calls, not a coding agent | The separate Gemini API CLI ( |
Install
The README lists four ways to install, plus the option to run without installing.
# Run with no install
npx @google/gemini-cli
# npm, global
npm install -g @google/gemini-cli
# Homebrew (macOS and Linux)
brew install gemini-cli
# MacPorts (macOS)
sudo port install gemini-cliFor locked-down machines the README suggests Anaconda: create a conda environment with nodejs from conda-forge, activate it, and run the npm install inside it.
Release channels
Gemini CLI ships on a fixed weekly rhythm, which is useful if you manage it for a team:
Channel | Schedule | Install tag |
|---|---|---|
Stable | Weekly, Tuesdays at 20:00 UTC; the promotion of last week's preview plus fixes |
|
Preview | Weekly, Tuesdays at 23:59 UTC; not fully vetted |
|
Nightly | Daily at 00:00 UTC, straight from main |
|
npm install -g @google/gemini-cli@latestPin a version in CI instead of floating on latest, and let a small group run preview a week ahead.
Authentication
There are three options in the README.
- Sign in with Google. Run
geminiand follow the browser flow. With a paid Code Assist license from your organization, set the Cloud project first:
`bash
export GOOGLECLOUDPROJECT="YOURPROJECTID"
gemini
`
- Gemini API key. Get a key from Google AI Studio and export
GEMINI_API_KEY. This lets you choose specific models and gives usage-based billing. - Vertex AI. Export
GOOGLE_API_KEYandGOOGLE_GENAI_USE_VERTEXAI=true. The README positions this for enterprise teams, with higher rate limits on a billing account.
Google Workspace accounts and other methods are covered in the authentication guide.
Everyday use
gemini # start in the current directory
gemini --include-directories ../lib,../docs # add more folders
gemini -m gemini-2.5-flash # pick a model
gemini -p "Explain the architecture of this codebase"
gemini -p "Run tests and deploy" --output-format stream-json-p runs once without the interactive screen. --output-format json returns structured output for scripts, and stream-json streams newline-delimited events, which suits long jobs.
The documented feature set:
- querying and editing large codebases
- building apps from PDFs, images or sketches, using multimodal input
- debugging in natural language
- automating tasks such as querying pull requests or handling a complex rebase
- checkpointing, to save and resume conversations
- token caching
- trusted folders, which control execution policy per folder
- sandboxing for safer command execution
- a VS Code companion
- telemetry and an enterprise guide for rollout
Models
You choose a model with -m or through the API key route. The README's own example uses gemini-2.5-flash. Because the CLI is not tuned for Gemini 4 and later, the practical answer for newer Gemini models is to use Antigravity instead.
MCP, extensions and custom commands
MCP servers are set in ~/.gemini/settings.json, and then you call them by name in the prompt, as in the README's examples (@github List my open pull requests). Beyond MCP:
- Custom commands are reusable prompts you define yourself.
- Context files (
GEMINI.md) hold standing instructions for a project. - Extensions bundle commands and tools to share.
The best MCP servers are the same ones you would add to any agent. Start with GitHub MCP and Context7, then browse the MCP server list.
Context files, in detail
The GEMINI.md file is the most useful thing you can set up, and the docs describe it as a hierarchy, not a single file. The CLI loads several and joins them before each prompt.
Level | Location | Use it for |
|---|---|---|
Global |
| Habits that apply to every project, such as your preferred style |
Workspace |
| Build commands, conventions, folders to avoid |
Just-in-time |
| Rules for one component, loaded only when it is used |
The footer shows how many context files are loaded, which is a quick check that your file was found. Two commands help while you write them. /memory show prints the full combined context the model receives, so you can see exactly what it is told. /memory reload rescans after you edit a file. Run /memory show the first time, because a surprise in that output, such as a stale global file contradicting your project file, explains many odd results.
Large files can be split into modules. The docs describe an @file.md import syntax, with relative or absolute paths, so a short top-level file can pull in @docs/testing.md and @docs/style.md. That keeps each piece small and reviewable.
If your team already writes an AGENTS.md for other tools, point Gemini CLI at it instead of duplicating. The setting lives in ~/.gemini/settings.json or the project's settings:
{
"context": {
"fileName": ["AGENTS.md", "GEMINI.md"]
}
}With that list, the CLI looks for both names. Keep the shared rules in AGENTS.md and Gemini-specific notes in GEMINI.md. The same idea works the other way, but check the other tool's documentation for its setting.
What the API-key route costs
Organizations on Code Assist pay through their licence, so the per-token maths matters for the API-key and Vertex routes. Google's published rate for Gemini 3.8 Flash is $0.75 per million input tokens and $3.75 per million output tokens until 31 December 2026, then $1.50 and $7.50, according to the Gemini API pricing page our pricing writer checked. The token volumes below are assumptions to show the arithmetic.
Monthly use | Input / output tokens | Until 31 Dec 2026 | From 1 Jan 2027 |
|---|---|---|---|
Light | 3M in, 0.3M out | $2.25 + $1.13 = about $3.40 | about $6.75 |
Steady | 30M in, 3M out | $22.50 + $11.25 = about $34 | about $67.50 |
Heavy | 150M in, 15M out | $112.50 + $56.25 = about $169 | about $338 |
Agent loops resend context on each step, so real input counts run far higher than the size of the files you open. The CLI's token caching helps, and the README lists it as a feature, but the discount for cached input depends on the model. Read the usage numbers from your own account after a week and adjust. See Gemini API pricing for the full table and the rate changes.
Scripting and CI use
The -p flag makes the CLI usable in scripts, and --output-format json gives something a script can parse. A few rules keep a pipeline safe:
- Pin the version. Use
npm install -g @google/gemini-cli@VERSIONin CI, so a Tuesday release cannot change behaviour overnight. - Keep it read-only where you can. A job that summarizes a diff or drafts release notes needs no write access. Give a write job its own branch and a token with the narrowest scope.
- Handle failure. Check the exit code and the JSON for errors, and fail the job on malformed output. Do not retry blindly, since each retry costs tokens.
- Cap the input. Pass the diff and the files that matter, not the whole repository.
- Never put secrets in the prompt. Environment variables for the CLI itself are fine. Text sent to the model is not.
- Review the output. A model-written change goes through the same review as a human one.
A typical safe job: on each pull request, run gemini -p "Summarize this diff for a reviewer and list any files that lack tests" --output-format json, post the summary as a comment, and stop there. It adds value with almost no risk, which is the right place to start. Move to code-changing jobs only after a month of clean summaries.
Limits, privacy and data handling
Prompts and the files the agent reads go to Google's models, so the privacy answer depends on how you sign in: a Code Assist license, an API key or Vertex each fall under different Google Cloud terms.
What the README does document is control on your side: trusted folders, sandboxing and telemetry settings. The enterprise guide covers corporate deployment.
Other limits:
- No free individual tier any more.
- Not tuned for Gemini 4 and later.
- Google says to expect differences if you migrate to Antigravity CLI, so confirm your hooks and skills still work.
Who it suits
- Teams already paying for Gemini Code Assist Standard or Enterprise.
- Organizations that want an open-source agent they can audit and pin by release.
- Developers on legacy paid API or Vertex keys who do not want to switch tools yet.
It does not suit a solo developer looking for a free agent. That person should start at Antigravity or look at the free AI agents list.
Moving to or from Gemini CLI
From Gemini CLI to Antigravity CLI. Install with curl -fsSL https://antigravity.google/cli/install.sh | bash on macOS or Linux, then follow the migration guide at antigravity.google/docs/gcli-migration. Skills, hooks, subagents and extensions carry over under the name plugins, but not one to one.
From Gemini CLI to Claude Code. Copy the contents of GEMINI.md into a CLAUDE.md, re-add each MCP server with claude mcp add, and recreate custom commands as skills. See Claude Code.
From Claude Code to Gemini CLI. Do the reverse, and keep AGENTS.md if your team uses it, since several agents read that name.
A first session, step by step
The README's own examples give a good first hour.
- Make a scratch folder and start the agent:
cd new-project/thengemini. - Ask for something small and checkable, such as the README's "Write me a Discord bot that answers questions using a FAQ.md file I will provide".
- Switch to an existing repository: clone one, run
geminiinside it, and ask "Give me a summary of all of the changes that went in yesterday". Reading history is a low-risk way to judge how well it understands a codebase. - Add a second folder with
--include-directorieswhen the task spans a library and its docs. - Run the same question once with
-pso you see what the scripted version returns.
None of those steps edits anything risky. Only after that is it worth giving the agent write access to a branch you care about.
Rolling it out to a team
Because the tool targets organizations, the rollout questions matter more than the install line.
Question | Where the answer is |
|---|---|
Which licence covers the developers? | Your Gemini Code Assist Standard or Enterprise agreement |
Which Cloud project is billed? |
|
Which version is allowed? | Pin the npm tag; follow the weekly stable channel |
Which folders can the agent run in? | Trusted folders settings |
How is commands' blast radius limited? | Sandboxing settings |
What is logged? | Telemetry and monitoring settings |
Where do people get help? | The troubleshooting guide, the FAQ, and |
Write the answers into a short internal page, and put the shared rules in a GEMINI.md committed to each repository so every developer starts from the same context.
Common questions
Can I still install it as an individual? The package installs, but the README says free individual access moved to Antigravity CLI, so you should expect it not to serve you. Check the transition post before you spend time on it.
Does it read `AGENTS.md`? Not by default. The docs say GEMINI.md is the default filename, and that you can change it with the context.fileName setting, which accepts a list such as AGENTS.md, CONTEXT.md and GEMINI.md.
Can it run in CI? Yes, with -p and --output-format json. The headless mode page in the docs covers errors and parsing.
What do I do about Gemini 4? Use Antigravity. The README says Gemini CLI is not tuned for that series.
Is the project active? Judging from the repository, yes. The last push we saw was on 30 October 2026, the release schedule is weekly, and the README links a public roadmap. Activity is not the same as a good fit, but it means a bug you report has a place to land.
Alternatives and duos
Compare with | Page |
|---|---|
Claude Code | |
Codex CLI | |
Antigravity | |
Other open-source agents |
Our take
This is a reading of the README and Google's own announcement. We have not tested Gemini CLI for this page.
The honest summary is that Gemini CLI is no longer the default answer for Google's models. It is open source and still maintained on a weekly cadence, with about 108,600 stars and a push on 30 October 2026, but Google itself says to use Antigravity for newer models and for individual accounts. If you are a paying Code Assist customer, it is a sensible, auditable tool. If you are not, you will spend your time on a tool that is not meant for you.
The part worth admiring is the release discipline: three channels, fixed times, and pinning by tag. If you manage agents across a team, that is the model other tools should copy.
Checklist
- Confirm which Google license you hold before you install
- Set
GOOGLE_CLOUD_PROJECTfor Code Assist logins - Pin the version in CI and choose a release channel
- Put project rules in
GEMINI.md - Add one MCP server in
~/.gemini/settings.json - If you are an individual, test Antigravity CLI instead
Mentioned here
Codex vs Gemini CLI: Which to Pick
Antigravity
Google Antigravity is an agent platform with four surfaces: an IDE, a terminal CLI, a desktop app for running agents in parallel, and an SDK.
- AI code editor
- MCP
Free tier + paid
Claude Code
Claude Code is Anthropic's coding agent for the terminal, VS Code, JetBrains, a desktop app and the web.
- Terminal agent
- MCP
Subscription · 153,977 stars
Codex CLI
Codex CLI is OpenAI's Apache-2.0 coding agent for the terminal, signed in with a ChatGPT plan or an API key.
- Terminal agent
- Open source
- MCP
Subscription · 131,919 stars
OpenCode
OpenCode is an MIT-licensed coding agent for the terminal, a desktop app and IDEs.
- Terminal agent
- Open source
- MCP
Free · 223,319 stars
Goose
Goose is an Apache-2.0 agent from Block, built in Rust, available as a desktop app, a CLI and an API.
- Terminal agent
- Open source
- MCP
Free · 55,977 stars
Aider
Aider is an Apache-2.0 terminal coding agent that maps your repository and commits each change to git, so every edit can be reviewed or undone with ordinary git commands.
- Terminal agent
- Open source
Free · 49,833 stars
AI Coding Agents: The Directory and How to Choose
Checked 2026-10-31
Questions
Is Gemini CLI still free?
Not for individuals. The README says free individual access and Google AI Pro and Ultra access moved to Antigravity CLI on June 18, 2026.
Who can still use Gemini CLI?
Organizations with Gemini Code Assist Standard or Enterprise, or Code Assist for GitHub on Google Cloud, plus legacy paid API or Vertex keys.
Is it open source?
Yes, under Apache-2.0.
What replaced it for individuals?
Google points individuals to Antigravity CLI, installed with a curl script from antigravity.google.
Loading poll...
Reviews
Loading reviews…
Only members can review this page. Sign in
Sources
Add-ons that work with Gemini CLI
All add-onsbrowser-use MCP
Browser Use is an open-source Python library for AI browser agents, and our entry covers its MCP route.
- MCP server
- Official
browser-use · 119,597 stars
Scrapling MCP Server
Scrapling is a Python web scraping framework from D4Vinci, described on GitHub as handling everything from a single request to a full-scale crawl, and this entry is its MCP server.
- MCP server
D4Vinci · 90,477 stars
Netdata MCP
Netdata is an observability platform, and this entry is its hosted MCP endpoint at app.netdata.cloud, reached over streamable HTTP.
- MCP server
netdata · 81,227 stars
claude-flow MCP
Claude Flow is published on npm as claude-flow, and its repository now sits at ruvnet/ruflo, which the GitHub description calls the original agent harness for deploying multi-agent swarms and coordinating autonomous workflows.
- MCP server
ruvnet · 80,298 stars
tldraw MCP
tldraw is an infinite-canvas SDK for React, and this entry is a hosted MCP endpoint run on a tldraw Workers address, reachable over streamable HTTP and SSE.
- MCP server
tldraw · 51,163 stars
Metabase MCP
Metabase is an open-source business intelligence and embedded analytics tool, and this entry is the MCP endpoint its server exposes at your own host under /api/mcp, over streamable HTTP.
- MCP server
metabase · 50,029 stars
Codebase Memory MCP
Codebase Memory is an npm package from DeusData, installed with npx -y codebase-memory-mcp over stdio.
- MCP server
DeusData · 47,863 stars
CCXT MCP
CCXT is a unified trading API covering more than 100 crypto exchanges and prediction markets, written for JavaScript, TypeScript, Python, C#, PHP, Go, Java and Rust, and this entry is its npm MCP package, installed with npx -y ccxt-mcp over stdio.
- MCP server
ccxt · 44,630 stars
Alternatives
Amp
Amp, from Sourcegraph, runs each coding agent on its own remote machine, called an Orb, and works from the web, apps and a CLI.
- Terminal agent
- MCP
Free tier + paid
Crush
Crush is a terminal coding agent from Charm, with MCP support, for macOS, Linux and Windows.
- Terminal agent
- MCP
Free · 28,890 stars
Factory Droid
Factory's Droid is a coding agent that runs in the terminal and on the web, with MCP support, aimed at software teams and enterprises.
- Terminal agent
- MCP
Subscription