Gemini CLI vs Claude Code is Google’s terminal agent against Anthropic’s. Gemini CLI is an open-source (Apache 2.0) AI agent that runs Gemini models in your terminal: it reads and edits files, runs shell commands, searches the web, connects to MCP servers and takes project instructions from GEMINI.md. Claude Code does the same job with Claude models and CLAUDE.md. The biggest news is not a feature: since June 18, 2026, Gemini CLI no longer serves free personal accounts. Unpaid tier and Google One users were moved to Antigravity CLI, and Gemini CLI is now for paid API keys, Vertex AI and Code Assist business licenses.
This post explains what Gemini CLI is today, how to install and sign in, how GEMINI.md, MCP and the sandbox work, and how it compares with Claude Code. No benchmark scores; they change with every model release. For the other big comparison, see Claude Code vs Codex.
What is Gemini CLI?
Gemini CLI is Google’s command-line coding agent. You run gemini in a project folder and talk to it. Built-in tools let it read and write files, run shell commands, fetch web pages and search Google. It works interactively or headless with -p, so you can call it from scripts and CI.
# interactive
gemini
# one-shot, with JSON output for scripts
gemini -p "summarize the changes in the last commit" --output-format json
# pick a model and add another directory to the context
gemini -m gemini-2.5-flash --include-directories ../shared
The source is on GitHub under Apache 2.0. Stable releases ship weekly, with preview and nightly channels for people who want changes earlier.
The June 2026 change: Antigravity CLI
Google announced that Gemini CLI is being replaced by Antigravity CLI for consumer users. According to Google’s developer blog and the Gemini CLI README:
- From June 18, 2026, Gemini CLI stopped serving requests for Google AI Pro and Ultra users and for Gemini Code Assist for individuals at no charge. The README puts it as “Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI.”
- Access stays the same for organizations on Gemini Code Assist Standard or Enterprise, for Code Assist for GitHub through Google Cloud, and for paid Gemini API keys.
- The README also says Gemini CLI has not been optimized for Google’s newest models and points to Antigravity for those.
Antigravity CLI runs as agy. It detects existing Gemini CLI setups, reads GEMINI.md and AGENTS.md, keeps agent skills, hooks and subagents, and converts Gemini CLI extensions into Antigravity plugins with agy plugin import gemini. Google says there won’t be one-to-one feature parity, so check the migration guide before you switch a team.
If you used Gemini CLI because it was free, this is the part that matters. The rest of this post applies to Gemini CLI with a paid key or a business license, and much of it carries over to Antigravity.
Install
Gemini CLI is a Node.js package:
# try it without installing
npx @google/gemini-cli
# install globally
npm install -g @google/gemini-cli
# or with Homebrew
brew install gemini-cli
Release channels are npm tags: @latest (stable, weekly), @preview (weekly) and @nightly.
Auth options
When you start gemini for the first time it asks how to authenticate. The documented options:
| Method | What you set | Status after June 18, 2026 |
|---|---|---|
| Sign in with Google | Browser login; a paid Code Assist license also needs GOOGLE_CLOUD_PROJECT | Works for Code Assist Standard and Enterprise; personal and Google One accounts moved to Antigravity |
| Gemini API key | GEMINI_API_KEY from Google AI Studio | Paid keys keep working |
| Vertex AI | GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION, plus ADC (gcloud auth application-default login), a service account or GOOGLE_API_KEY | Keeps working |
export GEMINI_API_KEY="your-key"
gemini
Workspace and organization accounts need a Google Cloud project. Google’s quota page has listed daily request numbers per auth type; some of those figures predate the June change, so check the current page and your Cloud console rather than a number in a blog post.
GEMINI.md: project instructions
GEMINI.md is Gemini CLI’s answer to CLAUDE.md. It loads in layers:
- Global:
~/.gemini/GEMINI.mdfor rules you want everywhere. - Workspace:
GEMINI.mdfiles in your workspace directories and their parents. - Just in time: when a tool touches a path, Gemini CLI also picks up
GEMINI.mdfiles near that path.
You can split a long file and import pieces with @file.md. Inside a session, /memory show prints the combined context and /memory reload re-reads the files.
To share one file with other agents, change the file name it looks for in ~/.gemini/settings.json or the project’s .gemini/settings.json:
{
"context": {
"fileName": ["AGENTS.md", "GEMINI.md"]
}
}
Claude Code reads CLAUDE.md and can import AGENTS.md with @AGENTS.md. With both settings in place, one AGENTS.md drives both agents. How to write CLAUDE.md and AGENTS.md covers what to put in it.
MCP in Gemini CLI
Gemini CLI connects to MCP servers declared under mcpServers in settings.json. A server can be a local command (command, args, env, cwd) or a remote one (url for SSE, httpUrl for streamable HTTP).
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "$GITHUB_TOKEN" }
}
}
}
Or add one from the command line:
gemini mcp add -s user -t http docs https://example.com/mcp
-s picks the scope (project by default, or user) and -t the transport (stdio, sse or http). In a session, /mcp lists servers and their tools, and /mcp auth handles OAuth for servers that need it. Claude Code’s side looks almost the same: claude mcp add, with project servers in .mcp.json. New to the protocol? Start with what an MCP server is.
Sandbox and approvals
This is where Gemini CLI is strongest. Sandboxing is off by default and you turn it on with --sandbox (-s), the GEMINI_SANDBOX environment variable, or "sandbox": true under tools in settings.
- macOS: Seatbelt (
sandbox-exec), with thepermissive-openprofile by default; other profiles throughSEATBELT_PROFILE. - Containers: Docker or Podman, using the
ghcr.io/google/gemini-cliimage. - Others: a native Windows sandbox, gVisor (
runsc) and LXC (experimental).
gemini --sandbox
GEMINI_SANDBOX=docker gemini
Approval modes are separate from the sandbox. default asks before edits and commands, auto_edit applies file edits without asking, and plan is read-only. YOLO (approve everything) is only available from the command line with --yolo or --approval-mode=yolo. Turn on checkpointing in settings and /restore can roll files back to a snapshot taken before a tool ran.
Claude Code has permission modes (ask, accept edits, plan, bypass) and an opt-in sandbox for its Bash tool. Gemini CLI gives you more sandbox backends to choose from. Whichever you use, the safe rule is the same: never give an agent full access outside a container or a throwaway worktree. AI coding agent security goes into the threats.
Gemini CLI vs Claude Code at a glance
| Gemini CLI | Claude Code | |
|---|---|---|
| Vendor, models | Google, Gemini models | Anthropic, Claude models |
| Source | Open source, Apache 2.0 | Proprietary |
| Install | npm install -g @google/gemini-cli, brew install gemini-cli | curl -fsSL https://claude.ai/install.sh | bash, Homebrew, WinGet |
| Who can use it now | Paid Gemini API keys, Vertex AI, Code Assist Standard/Enterprise | Claude paid plans or Anthropic API |
| Instructions file | GEMINI.md (configurable with context.fileName) | CLAUDE.md |
| MCP | mcpServers in settings.json, gemini mcp add | .mcp.json, claude mcp add |
| Sandbox | Seatbelt, Docker/Podman, Windows, gVisor, LXC | Opt-in sandbox for the Bash tool |
| Approval modes | default, auto_edit, plan, YOLO by flag | Default, accept edits, plan, bypass |
| Undo | Checkpointing with /restore | Checkpoints with rewind |
| Headless | gemini -p, JSON and stream-JSON output | claude -p, JSON and stream-JSON output |
| Extras | Extensions, web search built in | Hooks, skills, subagents, plugins |
When to use which
Use Gemini CLI when:
- Your company already buys Gemini through Google Cloud or has Code Assist Standard or Enterprise.
- You want a real sandbox backend (Docker, gVisor, Seatbelt profiles) wired into the agent.
- You want to read or change the agent’s source; it is open source.
- You need Google Search grounding built in.
Use Claude Code when:
- You have a Claude subscription and want the agent tuned for Claude models.
- You rely on plan mode, hooks, skills or subagents.
- You want to run it in the terminal, an IDE extension, the desktop app and the web with the same setup.
Consider Antigravity CLI if you were a personal or Google One user of Gemini CLI. That is where Google sends you now.
Running both
Running two agents from two vendors is common for the same reasons as with any pair: a second opinion on important changes, a second usage pool when one runs out, and picking the model that suits the task. The setup that works:
- One rules file. Put shared rules in
AGENTS.md, set Gemini’scontext.fileNameto include it and import it fromCLAUDE.md. - Separate folders. Give each agent its own git worktree and branch so they never edit the same file.
- Separate MCP config. Each tool keeps its own MCP settings; add the same servers to both, or register them once in AgentVera, which passes them to both.
- One reviewer. Let one agent review the other’s branch before you merge.
Gemini CLI, Antigravity and Claude Code in AgentVera
AgentVera is a desktop app for macOS, Windows and Linux that runs terminal coding agents in real terminals, in a grid per project, with your existing logins. Gemini CLI, Antigravity CLI and Claude Code are all in the New agent dialog; a CLI that isn’t installed yet shows as Not installed.
| Need | In AgentVera |
|---|---|
| Sign in | Gemini CLI uses its own Google login or GEMINI_API_KEY; AgentVera doesn’t replace it |
| Pick a model | Leave it empty for Gemini CLI’s default, or pick one and it is passed with --model |
| Permissions | Ask, Auto or Full access per agent; for Gemini CLI, Auto is --approval-mode auto_edit and Full access is --approval-mode yolo |
| Keep sessions | Each Gemini agent starts with its own --session-id and reopens with --resume |
| Check the work | Automatic code review when a turn ends |
| Chain agents | Flows: Gemini CLI can be the source or the target (Pro and Team) |
Be clear about the limits too. AgentVera’s MCP servers and its browser do reach Gemini CLI: they attach on every launch and merge by name with your own mcpServers. Gemini CLI has no extra-instructions flag, so the Role and instructions field doesn’t reach it; use AGENTS.md or GEMINI.md. And Full access never asks, so keep it for agents in a worktree or container.
The grid, worktrees and code review are on the free plan. Download AgentVera, open a Gemini CLI or Antigravity agent next to Claude Code in two worktrees, and compare them on your own repo.
The short answer
Gemini CLI is a capable, open-source terminal agent with a wide choice of sandbox backends, but since June 2026 it is a tool for paid API keys and Google Cloud customers. Claude Code is the stronger pick if you are on a Claude plan and want hooks, skills and subagents. If you were on Gemini CLI’s free tier, look at Antigravity CLI. And if you can, keep one AGENTS.md and run two agents.