How to Use Gemini CLI in 2026: Install It, Wire It Up, and Ship Your First Edits
How to Use Gemini CLI in 2026: Install It, Wire It Up, and Ship Your First Edits
Most "how to use Gemini CLI" guides still open with "sign in with your Google account and enjoy the free tier." In late 2026 that sentence needs a warning label. Google announced that Gemini CLI would stop serving free-tier and consumer-subscription users on June 18, 2026, in favour of a new product called Antigravity CLI. Gemini CLI itself still installs and runs, but who it runs for has changed. This guide gets you from zero to a first edit, and tells you which sign-in paths still make sense.
Method note: on October 26, 2026 I read Google's announcement, the Gemini CLI documentation site, the project README and the npm registry entry. I did not run a Gemini CLI session for this article, so nothing below is a hands-on test result. Every command is what the vendor docs instruct, and gaps are flagged as gaps. No one paid for placement and there are no affiliate links.
The 30-second answer
- Install:
npm install -g @google/gemini-cli(needs Node.js 20 or newer), then rungeminiin your project folder. - Auth that still works for sure: a Gemini API key (
GEMINI_API_KEY), Vertex AI, or a Google Workspace / Code Assist Standard or Enterprise license. - Auth that is in doubt: "Sign in with Google" on a free or personal account. Google's announcement says that path stopped being served on June 18, 2026.
- MCP: optional. Add an
mcpServersblock to~/.gemini/settings.jsononly when you need an outside system such as GitHub or a database. - Google's own nudge: the README says Gemini CLI is not optimized for the latest Gemini models and points to Antigravity CLI for those.
Read this first: what changed in 2026
Google's developer blog post of May 19, 2026 says Gemini CLI and the Gemini Code Assist IDE extensions would stop serving requests on June 18, 2026 for Google AI Pro and Ultra subscribers and for people using the free Gemini Code Assist for individuals tier. Enterprise customers on Gemini Code Assist Standard or Enterprise licenses keep access, and the post says Gemini CLI "will remain accessible via paid" API keys. The README and every docs page I opened carry a banner repeating that unpaid-tier and Google One users were moved to Antigravity CLI.
There is a conflict between sources that I will not resolve silently: the docs' quota page, last I read it, still lists a 1,000 requests per day limit for "Gemini Code Assist (Individual)" and 1,500 / 2,000 for AI Pro / Ultra under Google-account sign-in. That sits awkwardly with the announcement. My reading is that the quota page was not updated, but I cannot confirm that, so treat the individual Google-account rows as unreliable and check the banner on the docs site before you plan around them.
Install paths
The docs list Node.js 20.0.0+ as the runtime, Bash, Zsh or PowerShell as shells, and macOS 15+, Windows 11 24H2+ or Ubuntu 20.04+ as the recommended systems. The npm registry currently shows version 0.65.0 as latest, with a preview tag at 0.66.0-preview.0 and a nightly tag (I checked the registry on October 26, 2026; expect those numbers to move weekly).
| Route | Command or step | Notes from the docs |
|---|---|---|
| Try without installing | npx @google/gemini-cli | Fetches on demand, nothing global. |
| npm (Linux, macOS, Windows) | npm install -g @google/gemini-cli | The default path. Same command in PowerShell. |
| Homebrew (macOS/Linux) | brew install gemini-cli | Listed in the README. |
| MacPorts (macOS) | sudo port install gemini-cli | Listed in the README. |
| Restricted machines | Create a conda env with nodejs from conda-forge, then npm install inside it | The README's route when you cannot install Node system-wide. |
| VS Code | Run gemini in the integrated terminal and accept the prompt, or run /ide install | Installs the "Gemini CLI Companion" extension; also on the VS Code Marketplace and Open VSX for forks. |
Windows
I found no separate Windows installer in the docs. Windows is covered by the same npm route, with PowerShell listed as a supported shell and PowerShell variants given for setting environment variables. Install Node 20+ first, open PowerShell, and run the npm command above.
Release channels
Use @latest for the weekly stable build, @preview for next week's candidate and @nightly for daily builds the README says should be assumed to have pending validations. Stay on stable unless you are testing something specific.
Sign in: Google account vs. API key
| Auth method | How | Daily request limit per the quota page | Status after June 18, 2026 |
|---|---|---|---|
| Google account, personal | Run gemini, pick "Sign in with Google" | 1,000 (free), 1,500 (AI Pro), 2,000 (AI Ultra) | Conflicts with the announcement; likely not served. Verify. |
| Google Workspace / Code Assist license | Sign in with Google plus export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" | 1,500 (Standard), 2,000 (Enterprise) | Stated as unchanged. |
| Gemini API key, free | export GEMINI_API_KEY="...", pick "Use Gemini API key" | 250, Flash model only | Quota page still lists it. See caveat below. |
| Gemini API key, pay-as-you-go | Same variable, billing enabled in AI Studio | Varies by tier | Named by Google as the continuing route. |
| Vertex AI | ADC, service-account JSON or Cloud API key, plus GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION | Varies; Express mode has a 90-day no-billing window | Supported. |
On Windows, set the variable in PowerShell with $env:GEMINI_API_KEY="YOUR_KEY". The docs also describe making variables persistent, which you want if you do not like re-exporting every session. Keep the key out of your repo: use your shell profile or a secrets manager, not a committed file.
The API-key free tier's 250 requests per day comes from the Gemini CLI quota page. Google's separate Gemini API rate-limit page points you to AI Studio to see your active limits rather than giving one fixed number, so use the 250 figure as the CLI docs' statement, not a guarantee. One more quota fact worth knowing: the quota page says that with an API key you pay per token and call, which can cost more than a fixed plan for many small calls. Inside a session, /stats model shows your usage and applicable limits.
For how this auth picture changes the head-to-head with other agents, my honest Gemini CLI vs. Claude Code comparison covers the trade-offs; this post stays on setup.
Wire up MCP (only if you need it)
An MCP server is a program that exposes tools and resources to the CLI through the Model Context Protocol, so the model can act on systems beyond your file tree: a database, GitHub, an internal API. Gemini CLI reads servers from the mcpServers object in settings.json, either the user file ~/.gemini/settings.json or a project file .gemini/settings.json. It supports stdio, SSE and streamable HTTP transports.
Do you need it? Not for editing code. The CLI already ships built-in file system, shell and web fetch tools. Add MCP when the model needs live data or actions from somewhere your repo cannot supply.
The minimal working example below is Google's own tutorial config for the GitHub MCP server. It requires Docker and a GitHub personal access token in your environment:
{
"mcpServers": {
"github": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server:latest"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}" }
}
}
}
Restart the CLI, then run /mcp list. The tutorial says a healthy server shows as connected; if tools are missing, /mcp reload forces a re-query. The environment-variable mapping keeps the token out of the config file. The docs also describe mcp.allowed and mcp.excluded lists so you can restrict which servers connect. Grant the token the least access you can: the tutorial suggests read on metadata and contents, read/write on issues and pull requests.
Your first task, end to end
This is the sequence the docs support, written as instructions rather than a test log. Pick a small repo with tests and commit or stash your work first, so every change is easy to review and undo.
- Start in the project folder:
cd your-project, thengemini. Complete auth when prompted. - Orient it, read-only: ask "Explain the architecture of this codebase." The README shows the same request in one-shot form:
gemini -p "Explain the architecture of this codebase". - Add durable context. Put build, test and style rules in a
GEMINI.mdfile in the project root; the docs describe it as persistent context for the CLI. - Request one narrow edit. For example: "In utils/dates.js, replace the duplicated date-parsing blocks with one helper and update the callers. Do not change public function names. Run the tests afterwards."
- Review every approval prompt. In the default mode the CLI asks before executing tool calls. The config reference lists
default,auto_edit(auto-approves edits) andplan(read-only) as settable defaults; YOLO mode, which approves everything, can only be turned on from the command line. Leave it off for your first runs. - Review in your editor. With the VS Code companion connected (
/ide statusshows the link), proposed edits open in the native diff view, where you can edit before accepting. Caution: choosing "Allow for this session" means later changes are auto-accepted and stop appearing in the diff. - Undo if needed. The docs list a
/restorecommand and a checkpointing feature, and your owngit diffremains the real safety net.
Other flags worth knowing, all from the README and CLI reference: -m picks a model, --include-directories ../lib,../docs adds folders outside the current one, and --output-format json gives structured output for scripts.
Honest limits
- The product is in transition. Google's own docs say Gemini CLI is not optimized for its newest models and recommend Antigravity CLI for the best coding experience. New feature work is clearly going there.
- The free ride for individuals is, per Google's announcement, over. Plan on an API key with billing, or an organization license. The 250-requests API-key free tier is Flash-only according to the quota page.
- Not every paid plan counts. The quota page says tiers like Google AI Plus, and the Workspace AI Standard/Plus plans, are not supported, and that consumer "Gemini for Workspace" plans cover web products, not the API that powers the CLI.
- Region matters. The system requirements point to Gemini Code Assist supported locations.
- I have no benchmark to offer. I did not measure output quality, speed or token cost, and Google does not publish a coding-accuracy figure on these pages.
For the question of when to reach for something else, the three-way Claude Code vs. Codex CLI vs. Gemini CLI comparison is where I weigh them. Short version: if you do not hold an API key or an organization license, evaluate Antigravity CLI, Claude Code or Codex CLI before you build habits around a sign-in path that may be closed.
Honest verdict
Gemini CLI is still easy to install and the setup is genuinely short: one npm command, one environment variable, one folder. If your employer pays for Code Assist, or you are happy to put a billing-enabled API key behind it, the workflow above is sound, and the diff-in-your-editor loop is pleasant to review. If you were hoping for the old "log in with Google, get a thousand free requests a day" experience, Google's own announcement says that ended in June, and I would not start there.
Who it's NOT for
- Anyone counting on a free personal Google-account sign-in as a coding assistant. Verify it still works for you, or start with the replacement.
- People who want the newest Gemini models in the terminal, since Google says to use Antigravity for those.
- Teams that cannot send code to Google's cloud, or sit outside the supported locations.
- Anyone who wants fully hands-off, auto-approved edits on a repo with no tests and no version control. Don't enable YOLO mode there.
Keep reading
- Gemini CLI vs. Claude Code, honestly: the head-to-head after you have it installed.
- Claude Code vs. Codex CLI vs. Gemini CLI: the three-way comparison.
- 10 best AI coding tools in 2026: the wider field beyond terminal agents.
Questions or corrections? Write to nandminc2020@gmail.com.
Comments
Post a Comment