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.
Gemini CLI is now mainly for companies. Google's README says: "Enterprise Code Assist only: Designed for Gemini Code Assist Standard / Enterprise licenses and Code Assist for GitHub on Google Cloud". It also says: "No free tier or Google AI plans". If you have a personal Google account, use Google's Antigravity CLI instead. If you have a personal account shows how to install it. The README also says Gemini CLI is "Not optimized for Gemini 4+".
Check your account first
On 18 June 2026, Google stopped Gemini CLI for most personal accounts. Google's README says: "Free individual access and Google AI Pro / Ultra (Google One) moved to Antigravity CLI on June 18, 2026". Google's announcement names Google AI Pro, Google AI Ultra and Gemini Code Assist for individuals.
| Your account | Can you use Gemini CLI? |
|---|---|
| A personal Google account with no paid plan | No. Use Antigravity CLI (see below). |
| Google AI Pro or Google AI Ultra | No. Use Antigravity CLI (see below). |
| A company licence for Gemini Code Assist Standard or Enterprise | Yes, with Sign in with Google. |
| A paid Gemini API key from Google AI Studio | Yes, with Use Gemini API Key. Google's README calls this a legacy route. |
| A Google Cloud project with Vertex AI | Yes, with Vertex AI. Google's README calls Vertex keys a legacy route. |
An API key is a secret code that lets a program use your Google account. With an API key or Vertex AI, Google bills each use. Daily limits depend on your account. Google's quota page lists them. Before you start, read What AI assistants cost.
If you have a personal account
Google's replacement for Gemini CLI is Antigravity CLI. Google's announcement says it "keeps the most critical features of Gemini CLI: Agent Skills, Hooks, Subagents, and Extensions (now as Antigravity plugins)". Google's download page gives these install lines.
Mac or Linux:
curl -fsSL https://antigravity.google/cli/install.sh | bashWindows (PowerShell):
irm https://antigravity.google/cli/install.ps1 | iexThen go to your project folder and start it with agy. Google's guide says to sign in with your personal Google account when it asks. Google's Antigravity guide explains the first start. The rest of this page is for Gemini CLI only.
Before you install, check two more things
- 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 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-cliCheck that it worked
Close the terminal, open a new one, then type:
gemini --versionYou 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 CLI asks how you want to sign in. Choose the option that matches your account in the table above.
Company licence (Code Assist Standard or Enterprise). Your company gives you a Google Cloud project ID: the name of its project in Google Cloud. Set it, then start Gemini CLI:
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
geminiOn Windows PowerShell, the first line is $env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID". Choose Sign in with Google. A browser window opens. Pick your work account and click Sign in. Gemini CLI remembers the sign-in for later sessions.
Gemini API key. Make a key at aistudio.google.com/apikey. Google's announcement names paid API keys for Gemini CLI, so turn on billing for the key's project in AI Studio first. Set it, then start Gemini CLI:
export GEMINI_API_KEY="YOUR_API_KEY"
geminiOn Windows PowerShell, the first line is $env:GEMINI_API_KEY="YOUR_API_KEY". Choose Use Gemini API Key. Keep the key secret. Anyone with the key can use it on your bill.
Vertex AI. This is for teams that already use Google Cloud. Follow Google's sign-in page.
If you choose Sign in with Google with a personal account, Google does not serve the request. Gemini CLI can show a notice about Antigravity CLI with its install line. Go back to If you have a personal account.
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-clinpm 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:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserSign in with Google fails with a personal account
This is expected since 18 June 2026. Use Antigravity CLI. A paid API key still works, but Google's README calls it a legacy route.
Sources
- github.com/google-gemini/gemini-cli/blob/main/README.md
- github.com/google-gemini/gemini-cli/commit/b8fa817155731c783d47dc6eaeee63163c0ec723
- developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli
- developers.google.com/gemini-code-assist/docs/deprecations
- geminicli.com/docs/get-started/installation
- geminicli.com/docs/get-started/authentication
- geminicli.com/docs/resources/quota-and-pricing
- geminicli.com/docs/cli/cli-reference
- antigravity.google/download
- antigravity.google/docs/getting-started?tab=cli
- nodejs.org/en/download
- github.com/google-gemini/gemini-cli/issues/2225
- github.com/google-gemini/gemini-cli/issues/1648
- code.claude.com/docs/en/troubleshoot-install