Gemini CLI Getting Started: Install, Auth and Free Quotas
Gemini CLI needs Node.js 20 or later, and signing in with a Google account gives 1,000 requests a day for free. Install options, auth choices and GEMINI.md.
- Gemini CLI is Google's open-source tool for using Gemini from the terminal. It needs Node.js 20.0.0 or later, and the command is gemini.
- There are three ways to authenticate: a Google account, a Gemini API key, or Vertex AI. The daily limit is 1,000 requests with Gemini Code Assist for individuals and 250 on the unpaid API key tier, which is Flash only.
- Which terms of service and privacy notice apply depends on how you authenticate.
Gemini CLI is an open-source tool for using Google’s Gemini models from the terminal. This guide covers requirements and installation, the three ways to authenticate and their free quotas, a first session, GEMINI.md and settings files, and a few facts set side by side with Claude Code. If you are still choosing a tool, start with how to choose a coding agent.
On 2026-10-28 our test environment (macOS, Node.js v26.12.1) checked the package on npm: npm view @google/gemini-cli version engines returned 0.66.0 and { node: '>=20' }. We also ran npx -y @google/[email protected] --version, which printed 0.66.0, and --help, which listed the gemini mcp, gemini extensions, gemini skills and gemini hooks subcommands along with -p / --prompt, --approval-mode (default, auto_edit, yolo, plan) and -r / --resume. We did not log in, set no API key and called no model (not run). Everything else here comes from the docs in the project’s repository, checked the same day.
Requirements and installation
The docs recommend:
- OS: macOS 15+, Windows 11 24H2+, or Ubuntu 20.04+
- RAM: 4GB+ for casual use (short sessions, common edits), 16GB+ for long sessions and large codebases
- Node.js 20.0.0+
- Shell: Bash, Zsh or PowerShell
- A location supported by Gemini Code Assist, and an internet connection
The install options listed are:
# npm
npm install -g @google/gemini-cli
# Homebrew (macOS/Linux)
brew install gemini-cli
# MacPorts (macOS)
sudo port install gemini-cli
# Run without installing
npx @google/gemini-cli
Anaconda is also listed for restricted environments: create a conda environment with nodejs from conda-forge, then run the same npm install -g inside it. Gemini CLI comes pre-installed on Cloud Shell and Cloud Workstations. The command is gemini. There are three release channels: stable (weekly, the latest tag and the default), preview (weekly, @preview) and nightly (@nightly). We copied these commands from the docs and did not run any of them (not run).
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/installation.mdx (checked 2026-10-28)
For non-interactive runs, the docs list -p / --prompt, and --approval-mode with default, auto_edit, yolo and plan (plan is marked as still under development). -r / --resume resumes a previous session, with latest as the default.
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/reference/configuration.md (checked 2026-10-28)
Authentication and free quotas
You can sign in with a Google account, use a Gemini API key, or use Vertex AI. The docs give these daily limits:
| Auth method | Tier / subscription | Max requests per user per day |
|---|---|---|
| Google account | Gemini Code Assist (Individual) | 1,000 |
| Google account | Google AI Pro | 1,500 |
| Google account | Google AI Ultra | 2,000 |
| Gemini API key | Free tier (unpaid) | 250 |
| Gemini API key | Pay-as-you-go | Varies |
| Vertex AI | Express mode (free) | Varies |
| Vertex AI | Pay-as-you-go | Varies |
| Google Workspace | Code Assist Standard | 1,500 |
| Google Workspace | Code Assist Enterprise | 2,000 |
| Google Workspace | Workspace AI Ultra | 2,000 |
The unpaid API key tier sends requests to Flash models only. Vertex AI Express mode gives you 90 days before you need to enable billing. Tiers not in the table, including Google AI Plus, are not supported. Requests are also limited per user per minute. These numbers can change, so check the page before you pay for anything.
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/resources/quota-and-pricing.md (checked 2026-10-28)
The docs recommend signing in with Google for most users. An API key goes in the GEMINI_API_KEY environment variable. Company, school and Google Workspace accounts need a Google Cloud project, set through GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID. Headless mode needs an API key or Vertex AI.
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/authentication.mdx (checked 2026-10-28)
The terms that apply depend on how you authenticate. A Google account falls under the Gemini Code Assist terms and privacy notices, a Gemini API key under the Gemini API terms (separate for unpaid and paid services), and Vertex AI under the Google Cloud terms. The docs also say that accessing the services behind Gemini CLI through third-party software, for example by reusing Gemini CLI’s OAuth sign-in, violates the terms. Usage statistics can be turned off with privacy.usageStatisticsEnabled: false in settings.
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/resources/tos-privacy.md (checked 2026-10-28)
A first session
Start it in a dummy project. The first run asks you to pick a sign-in method.
cd ~/projects/todo-app
gemini
A safe first prompt is a question that doesn’t touch the code:
Describe how this project is organized and how to run its tests.
This needs a login, so we did not run it (not run). Commands you will use early on:
| Command | What it does |
|---|---|
/auth | Opens a dialog to change the auth method |
/init | Analyzes the current directory and generates a GEMINI.md |
/memory show | Shows the combined content of all loaded GEMINI.md files |
/model | Manages model configuration (/model set <model-name>) |
/stats model | Shows token usage and the limits of your current quota |
/compress | Replaces the chat context with a summary to save tokens |
/clear | Clears the conversation context and starts a new session |
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/reference/commands.md (checked 2026-10-28)
GEMINI.md and settings
GEMINI.md holds instructions that are sent to the model with every prompt. The CLI loads them from three places and joins everything it finds:
~/.gemini/GEMINI.md, for all projectsGEMINI.mdin the workspace directories and their parent directoriesGEMINI.mdfiles found just in time, when a tool touches a directory, from there up to a trusted root
A line such as @./components/instructions.md imports another file. The context.fileName setting changes the file name and accepts a list, such as ["AGENTS.md", "CONTEXT.md", "GEMINI.md"]. /memory reload re-scans all of them.
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/gemini-md.md (checked 2026-10-28)
Settings live in settings.json: ~/.gemini/settings.json for the user and .gemini/settings.json in the project root. Project settings override user settings, and a system settings file for administrators overrides both.
Source: https://github.com/google-gemini/gemini-cli/blob/main/docs/reference/configuration.md (checked 2026-10-28)
Compared with Claude Code
We only list facts we could confirm in both sets of docs. This is not a ranking.
| Item | Gemini CLI | Claude Code |
|---|---|---|
| Instruction file | GEMINI.md (context.fileName can add AGENTS.md) | CLAUDE.md; can also read a repository’s AGENTS.md |
| Free use | 1,000 requests/day with a Google account (individual) | Not included in the free claude.ai plan |
| User settings | ~/.gemini/settings.json | ~/.claude/settings.json |
| Project settings | .gemini/settings.json | .claude/settings.json |
Source: https://code.claude.com/docs/en/setup (checked 2026-10-28) Source: https://code.claude.com/docs/en/memory (checked 2026-10-28) Source: https://code.claude.com/docs/en/settings (checked 2026-10-28)
For the other CLIs, see getting started with Claude Code and getting started with Codex CLI. For keeping an instruction file short, see trimming CLAUDE.md.
Summary
- Gemini CLI needs Node.js 20.0.0 or later. Install it with
npm install -g @google/gemini-cli, Homebrew or MacPorts, and rungemini. The npm version on 2026-10-28 was 0.66.0. - A Google account on Gemini Code Assist for individuals allows 1,000 requests a day. The unpaid API key tier allows 250, Flash only.
- The terms and privacy notice that apply change with the auth method.
- Instructions go in
GEMINI.md, loaded from~/.gemini/, the workspace and its parents, and directories tools touch. - Settings are in
~/.gemini/settings.jsonand.gemini/settings.json, with the project file taking precedence. /stats modelshows usage against your quota.
FAQ
- How do I install Gemini CLI?
- Run npm install -g @google/gemini-cli. The docs also list Homebrew (brew install gemini-cli), MacPorts (sudo port install gemini-cli) and Anaconda, and npx @google/gemini-cli runs it without installing. Node.js 20.0.0 or later is required.
- Is Gemini CLI free?
- Signing in with a Google account under Gemini Code Assist for individuals allows up to 1,000 requests per user per day. A Gemini API key on the unpaid tier allows 250 requests per day, to Flash models only. Vertex AI Express mode can be used for 90 days before you need to enable billing.
- Which authentication method should I use?
- The docs recommend signing in with a Google account for most users. Company, school and Google Workspace accounts also need a Google Cloud project. For headless (non-interactive) mode, use a Gemini API key or Vertex AI.
- Where does Gemini CLI read instructions from?
- From GEMINI.md files: ~/.gemini/GEMINI.md for all projects, GEMINI.md in the workspace directories and their parents, and GEMINI.md files found when a tool touches a directory. The context.fileName setting can change the name or list several, such as AGENTS.md.
- How do I check how much of my quota I have used?
- Run /stats model in a session. It shows the current session's token usage and the limits that apply to your quota.