How to Install Gemini CLI on Windows, Mac and Linux
Gemini CLI installs with one npm command once Node.js 20 or later is in place. The requirements, the install on each system, the other routes (Homebrew, MacPorts, npx, conda), which sign-in still works after June 18, 2026, checking and updating the install, and the errors people hit.
7 min read
To install Gemini CLI, install Node.js 20 or later, then run npm install -g @google/gemini-cli in a terminal and start it with gemini. The same command works on Windows, macOS and Linux; on a Mac or Linux you can use brew install gemini-cli instead, and npx @google/gemini-cli runs it without installing anything. The part that changed is signing in. Since June 18, 2026, a personal Google account no longer gets you in, so most people working alone should have a Gemini API key from Google AI Studio ready before the first run. Companies with a Gemini Code Assist Standard or Enterprise license, and Vertex AI users on Google Cloud, sign in as before.
This guide covers getting it installed and signed in. What to do once it runs, such as GEMINI.md, approval modes, sandboxing and extensions, is in Gemini CLI best practices.
Before you install: requirements
Google’s installation page (opens in a new tab) lists the requirements as of September 30, 2026:
- Operating system: macOS 15 or later, Windows 11 24H2 or later, or Ubuntu 20.04 or later. Windows 10 is not on the list.
- Node.js 20.0.0 or later. The npm package declares the same minimum.
- Memory: 4 GB of RAM for short sessions and everyday edits; Google suggests 16 GB or more for long sessions and large codebases.
- A shell: Bash, Zsh or PowerShell, and an internet connection.
- Location: somewhere Gemini Code Assist is available. Elsewhere, sign-in fails with a message saying the account is not eligible in your location.
Check Node.js first, because an old version is the most common reason the install fails or gemini will not start:
node --version # must print v20.0.0 or higher npm --version
If node is missing or older than 20, install a current LTS release from nodejs.org or with a Node version manager, then open a new terminal and check again.
Install Gemini CLI on Windows
Gemini CLI runs natively in PowerShell; you do not need WSL. After installing Node.js, open a new PowerShell window so it sees the updated PATH:
npm install -g @google/gemini-cli gemini --version gemini
gemini is not recognized: close and reopen the terminal. If it persists, the npm global folder (usually%AppData%\npm) is not on your PATH;npm prefix -gprints where it is.running scripts is disabled on this system: PowerShell’s execution policy is blocking npm’s launcher script. Allowing signed and local scripts for your user withSet-ExecutionPolicy -Scope CurrentUser RemoteSignedis the common fix; your company may manage this setting for you.- Inside WSL, use the Linux steps below with a Node.js installed inside the distribution, not the Windows one.
Install on macOS and Linux
# npm (any system with Node.js 20+) npm install -g @google/gemini-cli # or Homebrew (macOS and Linux) brew install gemini-cli # or MacPorts (macOS) sudo port install gemini-cli gemini --version
Do not put sudo in front of npm install -g. If npm answers with an EACCES permissions error, npm’s own guide to fixing EACCES errors (opens in a new tab) calls reinstalling Node.js through a version manager the best way to avoid them. Homebrew is the other easy way out on a Mac.
Other ways to run it
- Without installing:
npx @google/gemini-clidownloads and runs the latest release each time. Handy for trying it, slower for daily use. - Restricted machines: Google documents a conda route, creating an environment with Node.js from conda-forge and running the npm install inside it.
- In a container: Google publishes a sandbox image for Docker or Podman, and
gemini --sandboxruns tools inside a container once Gemini CLI is installed. - Release channels:
@latestis the weekly stable release,@previewa weekly build that is less vetted, and@nightlya daily build. Stay on stable unless you are testing a fix.
Sign in: what still works after June 18, 2026
The first time you run gemini it asks “How would you like to authenticate for this project?” Before choosing, know where you stand. Google’s deprecation notice for Code Assist for individuals (opens in a new tab) says that from June 18, 2026 you can no longer use the Login with Google option to reach Gemini CLI on the Gemini Code Assist for individuals, Google AI Pro and Google AI Ultra tiers, and points those users to the Antigravity family of products. The Gemini CLI documentation adds that for unpaid tier and Google One users, Gemini CLI was replaced by Antigravity CLI on that date.
Google’s own pages do not all say this yet. The authentication page (opens in a new tab) carries the June 18 notice but still labels Sign in with Google as recommended, and the repository README still describes a free tier for personal Google accounts. Go by the notice: on a personal account, use an API key.
- Working alone: create a key in Google AI Studio, set it as
GEMINI_API_KEY, rungeminiand choose “Use Gemini API key”. - A company Code Assist Standard or Enterprise license: Sign in with Google still works for that account. Organization and Workspace accounts also set
GOOGLE_CLOUD_PROJECTto their project ID. - Google Cloud: choose Vertex AI, with
GOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATIONset, and credentials fromgcloud auth application-default login, a service account key file inGOOGLE_APPLICATION_CREDENTIALS, or a Google Cloud API key inGOOGLE_API_KEY. - Scripts and CI: an API key or Vertex AI through environment variables. Headless runs reuse cached credentials if there are any, and never open a browser.
# macOS and Linux (add to ~/.bashrc or ~/.zshrc to keep it) export GEMINI_API_KEY="YOUR_GEMINI_API_KEY" # Windows PowerShell (add to $PROFILE to keep it) $env:GEMINI_API_KEY="YOUR_GEMINI_API_KEY" # Or put GEMINI_API_KEY=... in ~/.gemini/.env
Keep the key in your shell profile or ~/.gemini/.env, not in a project’s .env that could be committed. Changed your mind later? /auth inside a session reopens the sign-in choice. How the CLI relates to Code Assist licenses is covered in Gemini CLI vs Gemini Code Assist, and Google’s Antigravity in Antigravity vs Claude Code.
Check the install
gemini --version(or-v) prints the version number and exits. Run it in a new terminal./aboutinside a session shows version details; Google asks you to include them when filing an issue./helplists the slash commands, and/quitleaves.- A first prompt such as “summarize what this folder contains” in a project directory confirms sign-in works end to end.
Update and uninstall
Gemini CLI’s command reference lists gemini update for moving to the latest version. You can also update the way you installed: run npm install -g @google/gemini-cli@latest again, or brew upgrade gemini-cli for a Homebrew install. Stable releases arrive weekly, so an install that is a month old is several versions behind.
gemini update # or reinstall: npm install -g @google/gemini-cli@latest npm uninstall -g @google/gemini-cli # or: brew uninstall gemini-cli # Optional: settings, GEMINI.md and history live here # ~/.gemini (Windows: %USERPROFILE%\.gemini)
When the install or sign-in fails
Google’s troubleshooting page (opens in a new tab) matches the common messages to fixes:
command not foundafter installing: the npm global binary folder is not on your PATH. Add it, or reinstall withnpm install -g @google/gemini-cli@latest.- “Failed to sign in. Message: Request contains an invalid argument”: common with Workspace or Cloud accounts linked to Gmail. Set
GOOGLE_CLOUD_PROJECTto your project ID, or switch to an API key. - “You must be a named user on your organization’s Gemini Code Assist Standard edition”: a leftover
GOOGLE_CLOUD_PROJECTorGOOGLE_CLOUD_PROJECT_IDis set. Remove it from your shell profile and any.envfile. - “not currently available in your location”: your region is not supported for this sign-in.
UNABLE_TO_GET_ISSUER_CERT_LOCALLY: a corporate proxy is inspecting traffic. SetNODE_USE_SYSTEM_CA=1, or pointNODE_EXTRA_CA_CERTSat your company’s CA certificate.- Sign in with Google loops or is refused on a personal account: that is the June 18, 2026 change, not a bug. Use an API key.
First thing after installing
A new install knows your code but not your list of work. If you use fenbs, add the board once with gemini mcp add fenbs https://fenbs.ai/api/mcp --transport http, or put it under mcpServers in ~/.gemini/settings.json with httpUrl set to that address, then run /mcp auth fenbs inside a session to sign in through the browser. A CI job uses a token issued by hand under Settings, with a name, scopes and an optional expiry, instead. From then on Gemini can read the board and the Decisions and rules page, file a feature, enhancement or bug with a note and a plan, and move it through To Do, Next Up, In Progress and Completed, with History recording each change under its name. The full setup is on Gemini CLI on fenbs.
Next steps
Using it well: Gemini CLI best practices and Gemini CLI plan mode. Running it inside your editor: Gemini CLI in VS Code. How it compares: Gemini CLI vs Claude Code vs Codex CLI. Connecting a board: the MCP docs.