Install Gemini CLI on a Mac or on Windows

Install Node.js, then Google's Gemini CLI with one command, check that it works, and sign in with a Google account. Includes fixes for common errors.

Checked against official docs on 12 Oct 2026

On this page

Gemini CLI is an AI assistant from Google that works in the terminal. The terminal is a window where you type commands instead of clicking. It can read and change files, run commands and search the web.

Before you start, check three things:

  • Your account. A personal Google account works. Google's quota page lists up to 1,000 requests a day for free when you sign in with Google. Paid Google plans give higher limits. If you pay, you pay Google directly.
  • Your computer. Google recommends macOS 15 or newer, or Windows 11 (24H2) or newer, with at least 4 GB of memory.
  • Node.js 20 or newer. Node.js is a free program that Gemini CLI runs on. It comes with npm, a tool that installs programs such as Gemini CLI.

New to the terminal? First read How to open the terminal.

Install Node.js

Go to nodejs.org/en/download. Download the LTS version for your computer. LTS means "long-term support": the stable version. Open the downloaded file and click through the installer with the default options.

Open the terminal

  • Mac: press Command + Space, type Terminal, then press Return.
  • Windows: press the Windows key, type PowerShell, then press Enter.

If the terminal was open before you installed Node.js, close it and open a new one.

Install Gemini CLI

Paste this line and press Return or Enter:

npm install -g @google/gemini-cli

-g means "install for all folders on this computer". Wait until the prompt comes back.

If you use Homebrew (an app installer for the Mac), you can skip Node.js and npm and use this line instead:

brew install gemini-cli

Check that it worked

Close the terminal, open a new one, then type:

gemini --version

You see a version number. If you see an error instead, go to If it did not work below.

Start Gemini CLI and sign in

gemini

When Gemini asks how you want to sign in, choose Sign in with Google. A browser window opens. Pick your Google account and click Sign in. Gemini CLI remembers the sign-in for later sessions.

Company, school and Google Workspace accounts need extra setup. See Google's sign-in page.

Next, read Your first session with Gemini CLI.

If it did not work

zsh: command not found: gemini (Mac)

The install finished, but the terminal does not find the program. Close the terminal, open a new one, and try again. You can also start Gemini CLI without an install:

npx @google/gemini-cli

npm error Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@google' (Mac)

npm may not write to a system folder. Do not add sudo (a command that runs things as the administrator) unless you know why. If you use Homebrew, install with brew install gemini-cli instead.

npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. (Windows)

A Windows safety setting blocks npm's helper script in PowerShell. Anthropic's install help explains this same npm error. Its fix allows scripts that you made on your own computer, for your user only. Run this, then run the install line again:

powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Sources