Install Gemini CLI on macOS, Windows, and Linux

One command installs it. The part that catches people in 2026 is the step after: a successful install signed in to a personal Google account no longer serves requests, so the login you choose matters more than the installer you use.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Install Gemini CLI with npm install -g @google/gemini-cli (Node 20 or newer), or brew install gemini-cli on macOS and Linux. Windows uses the same npm command in PowerShell. Ubuntu needs a Node from nvm or NodeSource, because the apt package is older than 20 on every LTS through 24.04. After installing, set GEMINI_API_KEY: as of August 2026 personal Google sign-in no longer serves the CLI.

What you need to know
  • npm install -g @google/gemini-cli is the primary route. Node 20.0.0+.
  • brew install gemini-cli works but lags npm: 0.46.0 versus 0.54.4 in August 2026.
  • Windows is the same npm command. There is no separate installer or winget package.
  • Ubuntu's apt Node is too old: 12.22.9 on 22.04, 18.19.1 on 24.04.
  • Installing is not enough: set GEMINI_API_KEY, because personal sign-in stopped working on 18 June 2026.
  • Never sudo npm install -g. Set a user-writable prefix instead.

Before you install: pick the auth rail first

This is out of order on purpose. Gemini CLI installs cleanly and then fails on the first request if you sign in the way most tutorials still describe.

What to have ready, by situation. Checked August 2026.

You areGet this firstThen install
An individual, any Google AI planA Gemini API key from AI StudioGemini CLI, or agy
On a Google Cloud projectProject id and region for Vertex AIGemini CLI
On a Workspace Code Assist licenseNothing; your license still worksGemini CLI
Just trying it outA free API key, 250 requests per dayGemini CLI

Requirements

Google's published specifications.

ItemRequirement
Node.js20.0.0 or newer
macOS15 or newer
Windows11 24H2 or newer
LinuxUbuntu 20.04 or newer
ShellBash, Zsh, or PowerShell
RAM, short sessions4 GB
RAM, large codebases16 GB
Check before you start.
node -v      # must be v20.0.0 or higher
npm -v

npm install (every platform)

npm install -g @google/gemini-cli
gemini --version

This is the route Google documents first and the one that gets updates the day they ship. It works identically on macOS, Linux, Windows PowerShell, and WSL.

If it fails with EACCES

A global npm install writing into a root-owned prefix is the classic failure. Do not fix it with sudo: that leaves root-owned files in your npm tree and breaks every later install for your user.

The correct fix: a user-writable prefix.
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

npm install -g @google/gemini-cli

Release channels

npm install -g @google/gemini-cli@latest     # stable, weekly on Tuesdays
npm install -g @google/gemini-cli@preview    # weekly, unvetted
npm install -g @google/gemini-cli@nightly    # daily, from main

Stay on stable unless you are chasing a specific fix. Preview and nightly are explicitly documented as potentially containing regressions.

brew install gemini-cli

brew install gemini-cli
gemini --version

# later
brew upgrade gemini-cli

Homebrew is the tidier option on macOS and Linuxbrew: one command to install, one to upgrade, no npm prefix to reason about. The cost is version lag. In August 2026 the formula was on 0.46.0 while npm shipped 0.54.4, which is roughly two months of releases.

Which one is running?
which -a gemini
brew list --versions gemini-cli
npm ls -g @google/gemini-cli

MacPorts

sudo port install gemini-cli

Install on Windows

There is no standalone Windows installer, no winget package, and no MSI. Windows uses npm, which means installing Node first.

01

Install Node 20 or newer

winget install OpenJS.NodeJS.LTS

# open a NEW PowerShell window, then
node -v

A terminal opened before the Node install will not see it. This is the most common "it says command not found" on Windows and it is not a Gemini CLI problem.

02

Install the CLI

npm install -g @google/gemini-cli
gemini --version
03

Set the key so it survives a reboot

Session only
$env:GEMINI_API_KEY="YOUR_KEY"
Permanent, for your user
[Environment]::SetEnvironmentVariable("GEMINI_API_KEY","YOUR_KEY","User")
# then open a new terminal

Windows paths worth knowing.

ThingWhere
npm global packages%AppData%\npm
The gemini shim%AppData%\npm\gemini.cmd
User config%UserProfile%\.gemini\

WSL

Inside WSL you are on Linux, so follow the Ubuntu instructions below. Do not install once on Windows and once in WSL and expect a shared config: they have separate home directories, so they have separate ~/.gemini directories and separate credentials.

Install on Ubuntu and other Linux

nvm: the least invasive route.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
exec $SHELL -l

nvm install 22
nvm use 22
node -v

npm install -g @google/gemini-cli
gemini --version
NodeSource: a system-wide Node, better for servers and CI images.
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v

npm install -g @google/gemini-cli

Homebrew on Linux

brew install gemini-cli

Works, with the same version lag as macOS.

Run it without installing

npx: no global package, cached per invocation.
npx @google/gemini-cli

# straight from main, for testing unreleased work
npx https://github.com/google-gemini/gemini-cli

npx is the right call for a one-off evaluation, a shared build machine, or a locked-down environment where a global install is not allowed. It is the wrong call for daily use: every invocation pays a resolution cost, and the cache is easy to lose.

Container sandbox

Gemini CLI can execute its tools inside a container rather than on your host, which is the isolation model to reach for on a repository you do not fully trust.

gemini --sandbox -y -p "explain this repository"

Anaconda

For restricted environments where you cannot install Node globally but can create a conda environment.

conda create -y -n gemini_env -c conda-forge nodejs
conda activate gemini_env
npm install -g @google/gemini-cli

First run

01

Export the key

export GEMINI_API_KEY="YOUR_KEY"
echo 'export GEMINI_API_KEY="YOUR_KEY"' >> ~/.zshrc
02

Start it in the repository root

cd ~/code/your-project
gemini

The working directory becomes the workspace, so launch from the repository root unless you have a reason not to.

03

Choose Use Gemini API key

Not Sign in with Google. On a personal account that path completes the browser flow and then fails on the first request.

04

Give it a GEMINI.md

/init

Then trim the generated file down to your real build and test commands. A narrow test command is the single highest-value line in it, because an agent that runs your whole suite on every change burns quota on waiting.

When the install goes wrong

SymptomCauseFix
gemini: command not foundShell opened before the installOpen a new terminal, or exec $SHELL -l
Still not found in a new shellnpm prefix is not on PATHnpm prefix -g, then add its bin to your profile
EACCES during installRoot-owned npm prefixSet a user prefix. Do not use sudo
Crashes immediately on launchNode older than 20node -v, then nvm or NodeSource
Disappeared after upgrading NodeGlobal prefix moved with the versionReinstall under the current Node
Installs, then every request failsSigned in with a personal Google accountSet GEMINI_API_KEY and re-pick the auth method
A documented flag is unknownHomebrew build is behind npmgemini --version, then brew upgrade or switch to npm
Two versions behaving differentlynpm and Homebrew both installedwhich -a gemini, remove one

Questions people ask

npm install -g @google/gemini-cli, with Node 20 or newer. On macOS and Linux you can use brew install gemini-cli instead. Then set GEMINI_API_KEY and run gemini in a project directory.

Node.js 20.0.0 or newer. The Homebrew formula depends on Node too, so it does not remove the requirement. Check with node -v before installing.

Install Node with winget install OpenJS.NodeJS.LTS, open a new PowerShell window, then run npm install -g @google/gemini-cli. There is no standalone Windows installer or winget package for the CLI itself.

Do not use the apt nodejs package: it is 12.22.9 on 22.04 and 18.19.1 on 24.04, both below the required Node 20. Install Node 22 with nvm or NodeSource first, then npm install -g @google/gemini-cli.

No. The Homebrew formula lags. In August 2026 it was on 0.46.0 while npm shipped 0.54.4. Use npm if you need current flags, Homebrew if you prefer one upgrade command.

Homebrew and MacPorts both package it, and npx @google/gemini-cli runs it with no permanent install. All of them still require Node on the machine except the container sandbox image.

No. It creates root-owned files in your npm tree that break later installs for your user. Set a user-writable prefix with npm config set prefix ~/.npm-global and add that bin directory to PATH.

If you are an individual developer on a Google AI plan, Antigravity CLI is what Google supports as of August 2026 and it installs with one script. Gemini CLI still makes sense on a Gemini API key, on Vertex AI, or on an enterprise Code Assist license.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Gemini CLI installation documentation commands, specs, release channels
  2. @google/gemini-cli on npm published version, Node engine
  3. gemini-cli Homebrew formula formula version
  4. Transitioning Gemini CLI to Antigravity CLI
Try it

Installed once,
driven from anywhere.

Continuum runs Google, Anthropic, and OpenAI agents from one workbench on your own logins, with no markup.

free app · your subscriptions · local-first