Gemini CLI is Google's open-source terminal coding agent, installed with npm install -g @google/gemini-cli or brew install gemini-cli. As of August 2026 it needs a Gemini API key, Vertex AI, or an enterprise Gemini Code Assist license: personal Google sign-in for free, AI Pro, and AI Ultra accounts stopped being served on 18 June 2026. Google's replacement for individuals is Antigravity CLI, a Go binary called agy. The npm package is still shipping releases, so Gemini CLI remains a working tool on the auth rails that are left.
- Install:
npm install -g @google/gemini-cli. Needs Node 20+. - Personal Google sign-in stopped working on 18 June 2026 for free, Pro, and Ultra.
- What still works: a Gemini API key, Vertex AI, or an enterprise Code Assist license.
- Google's successor for individuals is Antigravity CLI (
agy), a Go binary. - The repo is still active:
v0.54.4shipped on 7 August 2026. - Non-interactive mode is
gemini -p "...", with-o jsonfor structured output.
What Gemini CLI is, and what changed in June
Gemini CLI is an open-source (Apache 2.0) agent that runs in your terminal, reads your repository, edits files, runs shell commands, and calls tools over MCP. It is the same shape as Claude Code and the Codex CLI: a REPL you launch in a project directory, plus a non-interactive mode for scripts.
The complication is that Google reorganised its developer tooling at I/O on 19 May 2026 and consolidated everything under the Antigravity brand. On 18 June 2026, Gemini CLI stopped serving requests for individual accounts: free tier, Google AI Pro, and Google AI Ultra. The project itself was not deleted, archived, or abandoned. Only that authentication rail was switched off.
Status of each rail, as of August 2026.
| How you authenticate | Status | What to do |
|---|---|---|
| Personal Google sign-in (free tier) | Not served since 18 June 2026 | Move to an API key, or to Antigravity CLI |
| Personal Google sign-in (AI Pro / AI Ultra) | Not served since 18 June 2026 | Your subscription now runs Antigravity, not Gemini CLI |
GEMINI_API_KEY from AI Studio | Works | Metered, or the free API tier |
| Vertex AI (ADC, service account, or API key) | Works | Needs a Google Cloud project |
| Enterprise Gemini Code Assist license | Works | Standard and Enterprise licenses were explicitly unaffected |
That table is the single most important thing on this page. Everything below assumes you are on a rail that still resolves.
Install it
npm install -g @google/gemini-cli
# macOS and Linux, via Homebrew
brew install gemini-cli
# macOS, via MacPorts
sudo port install gemini-cli
# no install at all
npx @google/gemini-cli
gemini --version
Google's recommended specifications.
| Requirement | Value |
|---|---|
| Runtime | Node.js 20.0.0 or newer |
| macOS | 15 or newer |
| Windows | 11 24H2 or newer |
| Linux | Ubuntu 20.04 or newer |
| RAM, light use | 4 GB or more |
| RAM, large codebases | 16 GB or more |
| Shell | Bash, Zsh, or PowerShell |
Homebrew lags npm by a meaningful margin. When this guide was checked in August 2026 the npm package was on 0.54.4 and the Homebrew formula was on 0.46.0. If a flag in this guide is missing from your build, check gemini --version before assuming the documentation is wrong.
There are three release channels. Stable ships weekly on Tuesdays and is what you get by default. Preview ships weekly and is unvetted. Nightly ships daily from main.
npm install -g @google/gemini-cli@latest # stable, the default
npm install -g @google/gemini-cli@preview
npm install -g @google/gemini-cli@nightly
Authentication that still resolves
Two rails are available to an individual developer in August 2026: a Gemini API key from AI Studio, or Vertex AI through a Google Cloud project. Both bill separately from any Google AI subscription you hold.
Get an API key from AI Studio
Create one at aistudio.google.com/app/apikey. The free API tier is capped at 250 model requests per day and is restricted to Flash-class models. Enabling billing on the key lifts both.
Export it
export GEMINI_API_KEY="YOUR_KEY"
# make it stick
echo 'export GEMINI_API_KEY="YOUR_KEY"' >> ~/.zshrc
$env:GEMINI_API_KEY="YOUR_KEY"
Start it and pick the key
cd ~/code/your-project
gemini
On first run, choose Use Gemini API key. If you pick Sign in with Google on a personal account, the flow will complete and then fail on the first request.
Vertex AI instead
Vertex AI is the route when you want higher limits, an organisation-owned billing account, or Express Mode's 90-day no-billing window. It needs two variables set regardless of which credential type you use.
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_LOCATION="us-central1"
# then one of:
gcloud auth application-default login # ADC
# or a service account JSON key, or a Google Cloud API key
Daily request quotas by rail. Figures published by Google; checked August 2026.
| Rail | Requests per user per day |
|---|---|
| Gemini API key, free tier | 250, Flash models only |
| Gemini API key, pay as you go | Varies with your billing account |
| Vertex AI Express Mode | Varies; billing required after 90 days |
| Vertex AI, pay as you go | Varies |
| Code Assist Standard (Workspace) | 1,500 |
| Code Assist Enterprise (Workspace) | 2,000 |
Gemini CLI commands
There are three layers: the shell command and its flags, subcommands like gemini mcp, and slash commands inside the REPL. The flags are where the behaviour actually lives.
Shell-level commands.
| Command | What it does |
|---|---|
gemini | Start the interactive session |
gemini "query" | Start with a prompt already loaded, then stay interactive |
gemini -p "query" | Run once, print the answer, exit |
gemini -i "query" | Run the prompt, then drop into the REPL |
cat logs.txt | gemini | Pipe content in as context |
gemini -r latest | Resume the most recent session |
gemini -r <id> "query" | Resume a specific session with a new prompt |
gemini update | Update in place |
gemini mcp | Add, list, and remove MCP servers |
gemini extensions | Manage extensions |
The flags worth knowing.
| Flag | Alias | Effect |
|---|---|---|
--model | -m | Model or alias: auto, pro, flash, flash-lite |
--prompt | -p | Non-interactive run |
--prompt-interactive | -i | Prompt first, then stay in the REPL |
--approval-mode | default, auto_edit, yolo, or plan | |
--sandbox | -s | Run tools inside a container |
--output-format | -o | text, json, or stream-json |
--resume | -r | Resume a session by latest, id, or index |
--include-directories | Add directories to the workspace | |
--worktree | -w | Start in a new git worktree (needs experimental.worktrees) |
--debug | -d | Verbose logging when something is silently failing |
Slash commands inside the session
| Command | Use it for |
|---|---|
/init | Generate a first GEMINI.md for the repository |
/memory | Show, add to, or reload the loaded context files |
/model | Switch model mid-session |
/plan | Plan before editing |
/mcp | List and reload MCP servers |
/tools | See which tools are exposed |
/permissions | Inspect what the agent may do without asking |
/compress | Summarise the conversation to reclaim context |
/restore and /rewind | Undo file changes or roll the conversation back |
/stats | Token counts and session cost |
/resume | Load a previous session |
/bug | File an issue with session details attached |
How to use it on a real repository
The default install answers questions well and edits files badly, because it knows nothing about your project. Three files close most of that gap.
Write a GEMINI.md
This is the standing-instructions file, the same role CLAUDE.md plays for Claude Code and AGENTS.md for Codex. Run /init to get a draft, then cut it down to things that are true and specific.
# Project
TypeScript monorepo, pnpm workspaces, Postgres via Prisma.
## Commands
- Test one package: `pnpm --filter @app/api test` (NOT `pnpm test`, that is 9 minutes)
- Typecheck: `pnpm -r typecheck`
- Regenerate the client after a schema change: `pnpm prisma generate`
## Conventions
- Every route handler returns a typed Result, never throws across a boundary.
- packages/generated is generated. Never hand-edit it.
## Do not
- Do not add dependencies without asking.
- Do not touch prisma/migrations unless the task is a migration.
Add a .geminiignore
Same syntax as .gitignore, and it keeps the agent out of directories that waste context: build output, fixtures, vendored code, large data files. Gemini CLI respects it during searches by default.
printf 'dist/\ncoverage/\n*.snap\ntestdata/large/\n' > .geminiignore
Pick an approval mode deliberately
gemini --approval-mode plan # read and propose, no edits
gemini --approval-mode auto_edit # edit files freely, ask for shell commands
gemini --approval-mode yolo # approve everything, for throwaway containers
auto_edit is the setting most people want and few people find. It removes the per-file confirmation loop without handing over your shell.
Non-interactive runs
The -p flag is what makes Gemini CLI scriptable, and -o json is what makes it parseable.
gemini -p "summarize the changes in the last 5 commits"
# structured output for a pipeline
gemini -p "list every TODO in src/ as JSON" -o json | jq
# stdin as context
git diff --staged | gemini -p "write a commit message for this diff"
Antigravity CLI is the successor
Google's replacement for individual developers is the Antigravity CLI: a Go binary called agy, sharing an agent core with the Antigravity 2 desktop app. It installs from a script rather than npm, and it is faster to start because it is a single compiled binary rather than a Node process.
curl -fsSL https://antigravity.google/cli/install.sh | bash
agy
What carries over, and what you have to move by hand.
| Gemini CLI | Antigravity CLI | Automatic? |
|---|---|---|
~/.gemini/ | ~/.gemini/antigravity-cli/ | Offered on first run |
GEMINI.md, AGENTS.md | Same files, same places | Yes, unchanged |
.gemini/skills/ | .agents/skills/ | No. Rename the folder yourself |
MCP servers in settings.json | ~/.gemini/config/mcp_config.json | Partly. The url key becomes serverUrl |
| Extensions | Plugins, via agy plugin import gemini | One command |
gemini -p "..." | agy -p "..." | Same idea, same flag |
When it breaks
| Symptom | Cause | Fix |
|---|---|---|
| Worked yesterday, fails on every request now | Personal Google sign-in, switched off 18 June 2026 | Set GEMINI_API_KEY, or install agy |
gemini: command not found | PATH not reloaded, or a Node version change moved the npm prefix | Open a new shell; check npm root -g |
| Quota exhausted after a handful of prompts | Free API-key tier is 250 requests per day | Enable billing on the key, or use Vertex AI |
| Edits are proposed but never applied | Approval mode is default or plan | --approval-mode auto_edit |
| It ignores your GEMINI.md | Context files load at start | /memory reload, and check /memory show |
| An MCP server never appears | Config edited after launch | /mcp reload, then gemini mcp list |
| A documented flag is rejected | Homebrew build is behind npm | gemini --version, then update |
If you are moving off it entirely, remove the package and then decide what to do with ~/.gemini, because that directory is now shared with Antigravity CLI.
Questions people ask
The tool is free and open source under Apache 2.0. Access is not. As of August 2026 the free personal Google sign-in rail no longer serves the CLI, so free usage means a Gemini API key on the free API tier, capped at 250 model requests per day and limited to Flash-class models.
Not the project. Google stopped serving it for individual accounts on 18 June 2026 and directs individuals to Antigravity CLI, but the repository is still active and version 0.54.4 shipped on 7 August 2026. Enterprise Code Assist licenses and API key authentication were explicitly unaffected.
Google consolidated its developer tooling under the Antigravity brand at I/O on 19 May 2026. On 18 June the CLI stopped serving requests authenticated with personal Google accounts, covering free tier, Google AI Pro, and Google AI Ultra. Nothing about your local install changed.
npm install -g @google/gemini-cli with Node 20 or newer, or brew install gemini-cli on macOS and Linux. npx @google/gemini-cli runs it without installing. Then set GEMINI_API_KEY and run gemini in a project directory.
Run gemini inside a repository to start an interactive session, or gemini -p "your prompt" for a single non-interactive answer. Write a GEMINI.md with your build and test commands, add a .geminiignore, and pass --approval-mode auto_edit so it can edit without confirming every file.
Gemini CLI is a Node package published to npm as @google/gemini-cli. Antigravity CLI is a Go binary called agy installed from a script, sharing an agent core with the Antigravity desktop app, and it is the path Google now supports for individual developers. Your GEMINI.md carries over; workspace skills and MCP config need moving.
In ~/.gemini/, holding settings.json, oauth_creds.json, google_accounts.json, trustedFolders.json, and a tmp/ directory of per-project state. Project-level settings live in .gemini/settings.json inside the repository. GEMINI_CLI_HOME relocates the user-level root.
Yes, with a Gemini API key or Vertex AI credentials. Use gemini -p for a single run and -o json when something downstream has to parse the answer. A personal sign-in will not work, which is why many pipelines broke on 18 June 2026.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.
- Gemini CLI on GitHub install, commands, quotas
- Transitioning Gemini CLI to Antigravity CLI the 18 June 2026 cutover
- Antigravity CLI documentation
- @google/gemini-cli on npm version and Node requirement