Post your build ideas
LocalASO Track App Store keyword ranks in every countryFind your vibe. Find you job which is just for you and your dataDealtab Brand Deal Tracker That Does The Work For YouIs Major Cooked? Free AI risk score + roast for your college majorWiral.Social LinkedIn, Scheduler, Scheduling Tool, Ghostwriter
Solo Era solo activities, solo maxxing, sidequests, challengeCadentiq daily routine, wellbeing, self care, healthy habitsTexeva Your businessKeepsake Project Management, Freelancers, DesignersOrvyx AI You create

What is Gemini CLI? Install, sign in and use it in 2026

Gemini CLI is Google's open-source AI agent for the terminal. You run gemini in a project folder and it reads files, edits code and runs commands. Install it with npm install -g @google/gemini-cli. Since June 18, 2026, free individual use and Google AI Pro and Ultra subscriptions moved to Antigravity CLI, so Gemini CLI now serves Gemini Code Assist Standard and Enterprise licenses, plus paid API and Vertex AI keys.

What is Gemini CLI?

Gemini CLI is an open-source AI agent from Google that runs in your terminal. You start it with the command gemini inside a project directory, describe a task in plain English, and it can query and edit a codebase, run shell commands, debug problems and automate chores such as handling a complex rebase. Its GitHub repository says it can also generate apps from PDFs, images or sketches using multimodal input, and connect extra tools through MCP servers.

It launched in 2025 with free access for individuals, and that history is why most search results still call it free. The next section explains why that is no longer the whole story.

Is Gemini CLI still available, and is it still free?

It is still available, but not on the free tier. Google's announcement on its developers blog, dated May 19, 2026, says that on June 18, 2026 Gemini CLI and the Gemini Code Assist IDE extensions stop serving requests for Google AI Pro and Ultra subscribers and for people using them free of charge through Gemini Code Assist for individuals. Google moved those users to Antigravity CLI, a new terminal tool in its Antigravity platform.

The repository README now opens with a status notice that says the same thing. Gemini CLI is designed for Gemini Code Assist Standard and Enterprise licenses and Code Assist for GitHub on Google Cloud, plus legacy paid API and Vertex AI keys. It also says Gemini CLI is not tuned for the Gemini 4 series and should not be used to benchmark Gemini models.

Who can use Gemini CLI, as of October 2026
How you access Google AIGemini CLIWhat to use
Free individual accountNo longer served since June 18, 2026Antigravity CLI
Google AI Pro or Ultra subscriptionNo longer served since June 18, 2026Antigravity CLI
Gemini Code Assist Standard or Enterprise licenseAccess unchangedGemini CLI
Code Assist for GitHub on Google CloudAccess unchangedGemini CLI
Paid Gemini API key or Vertex AI keyRemains accessibleGemini CLI

How do you install Gemini CLI?

The installation guide lists these requirements: Node.js 20.0.0 or later, macOS 15+, Windows 11 24H2+ or Ubuntu 20.04+, a Bash, Zsh or PowerShell shell, an internet connection, and 4 GB or more of RAM for casual use (16 GB or more for long sessions on large codebases).

Ways to install Gemini CLI
MethodCommand
Try without installingnpx @google/gemini-cli
npm, globalnpm install -g @google/gemini-cli
Homebrew (macOS, Linux)brew install gemini-cli
MacPorts (macOS)sudo port install gemini-cli
Anaconda, for restricted environmentsconda create -y -n gemini_env -c conda-forge nodejs, then conda activate gemini_env, then npm install -g @google/gemini-cli

Then run gemini in the folder of your project. Releases follow three channels: stable (the latest tag, published weekly on Tuesdays at 20:00 UTC), preview (published weekly on Tuesdays at 23:59 UTC and not fully vetted) and nightly (a daily build from the main branch). Install a channel with npm install -g @google/gemini-cli@preview, @latest or @nightly.

How do you sign in to Gemini CLI?

Gemini CLI offers three ways to authenticate, described in the authentication guide. Run gemini, pick the method when prompted, or change it later with the /auth command.

Gemini CLI authentication methods
MethodBest forWhat you set
Sign in with GoogleOrganization users with a Code Assist license, company, school or Workspace accountsPick it in the CLI and sign in through your browser. Organization accounts also set GOOGLE_CLOUD_PROJECT to a Google Cloud project ID.
Gemini API keyPeople who want a specific model and usage-based billing, and headless useCreate a key in Google AI Studio, then export GEMINI_API_KEY.
Vertex AIEnterprise teams and production workloadsSet GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION, then use application default credentials, a service account key file or a Google Cloud API key.
Gemini API key setup (macOS or Linux)
# 1. Create a key at https://aistudio.google.com/apikey
# 2. Put it in your environment
export GEMINI_API_KEY="YOUR_API_KEY"

# 3. Start the CLI in your project and choose the API key option
cd my-project
gemini

Treat API keys as secrets. Google's docs warn that a leaked key can be misused under your account. If you already exported GOOGLE_API_KEY or GEMINI_API_KEY and want to use Vertex AI with application default credentials, unset them first. To keep variables between terminal sessions, add them to your shell profile. For automated jobs, the docs recommend a Gemini API key or Vertex AI credentials.

What is GEMINI.md and how do you write one?

GEMINI.md is a context file that gives the agent standing instructions, so you do not repeat them in every prompt. Gemini CLI loads these files and sends their combined content with each prompt, per the context file documentation. It looks in three places.

  1. Global: ~/.gemini/GEMINI.md, for defaults across all your projects.
  2. Workspace: GEMINI.md files in your workspace directories and their parent directories.
  3. Just-in-time: when a tool reads a file or directory, the CLI also scans that directory and its ancestors, up to a trusted root, for more GEMINI.md files.

Run /init and Gemini CLI analyzes the current directory and generates a tailored GEMINI.md for you. Use /memory show to print the full combined context, /memory list to see which files are loaded and /memory refresh to reload after you edit one. You can split a long file with imports, writing @./components/instructions.md on its own line, and you can rename the file through the context.fileName setting in settings.json. For example, setting it to a list that includes AGENTS.md makes the CLI read that file too. See the AGENTS.md guide for the cross-tool version of this idea.

Starter GEMINI.md for a small web app
# Project: [name]

## What this is
[One sentence: who it is for and the one thing it does.]

## Stack
- [Language and framework]
- [Database or storage]
- Run locally: [command]. Run tests: [command].

## Rules
- Make the smallest change that solves the task. Do not refactor unrelated code.
- Follow the existing code style and naming.
- Ask before adding a new dependency.
- Never print or commit secrets. Read them from environment variables.
- After a change, run the tests and tell me the result.

## Out of scope
- [Things the agent must not touch, such as the billing code or the migrations folder]

What are the core Gemini CLI commands?

Inside a session, three prefixes control the tool. Slash commands (/) manage the session and settings. The at sign (@) injects a file or directory into your prompt, as in @src/ Summarize the code in this directory. The exclamation mark (!) runs a shell command, and typing ! alone toggles shell mode. The command reference lists them all. These are the ones worth learning first.

Useful Gemini CLI slash commands
CommandWhat it does
/helpShows help and available commands
/initGenerates a GEMINI.md for the current directory
/memoryShows, lists or refreshes the loaded GEMINI.md context
/planSwitches to Plan Mode, which is read-only, and shows the current plan
/modelManages the model configuration
/mcpManages configured MCP servers
/toolsLists the tools currently available
/statsShows statistics for the current session
/compressReplaces the chat context with a summary to save tokens
/clearClears the conversation and starts a new session
/resume (alias /chat)Browses and resumes earlier sessions and manual checkpoints
/restoreRestores project files to how they were just before a tool ran
/rewindSteps back through the conversation, with the option to revert changes
/authChanges the authentication method
/permissionsManages folder trust and other permissions
/settingsOpens the settings editor
/extensionsLists, installs and updates extensions
/quitExits

Outside a session, a few flags matter. Use gemini -p "your prompt" for a one-shot answer in scripts, add --output-format json for structured output or stream-json for newline-delimited events, gemini -m to pick a model, gemini --include-directories ../lib,../docs to add folders, and gemini --sandbox to run inside a container.

What does a first session look like?

  1. Create or open a project folder and run git init, so you can see and undo every change.
  2. Run gemini, choose an authentication method, and run /init to generate GEMINI.md. Edit it down to the rules you actually care about.
  3. Switch to Plan Mode with /plan and ask for a plan before any edits.
  4. Approve the plan, let it build one small piece, and run your tests.
  5. Commit, then repeat. If something goes wrong, use /restore or git to go back.
First task prompt for a command-line tool
Plan, then build, a small command-line tool: [one-sentence description].

Version one does only this: [input] in, [output] out.
Language: [language]. No new dependencies without asking.

First, list the files you will create and the tests you will write, and stop. Do not edit anything until I say go.

A small tool is the right size to learn on. The board has plenty of candidates, such as Explain this cron expression in plain English, and the reverse, posted under developer tools. Browse more in developer tools ideas.

How does Gemini CLI relate to Antigravity CLI?

Google describes Antigravity CLI as the single product it is putting its effort into. It is built in Go, runs on the same agent engine as the Antigravity 2.0 desktop app, and runs multiple agents in the background. Google says it keeps Agent Skills, Hooks, Subagents and Extensions (now called plugins), though without one-to-one feature parity at launch. The command is agy.

The three Google command-line tools in the repository README
ToolCommandBest for
Antigravity CLIagyInteractive multi-agent coding. Use it for Gemini 4 models, free accounts, Google AI Pro and Ultra, or Google Cloud.
Gemini API CLIgemini-apiA stateless API command line for scripts, CI and other agents. Not a coding agent.
Gemini CLIgeminiOrganizations with Gemini Code Assist Standard or Enterprise, or Code Assist for GitHub, plus legacy paid API and Vertex keys.

If you move, Google's migration guide says agy detects legacy Gemini CLI settings on first launch, and agy plugin import gemini converts extensions to plugins. Antigravity CLI keeps reading your existing GEMINI.md and AGENTS.md files and the global ~/.gemini/GEMINI.md, so your instructions carry over. Workspace skills move from .gemini/skills/ to .agents/skills/, and MCP servers move out of settings.json into a separate mcp_config.json file.

For the head-to-head with Anthropic's agent, see Claude Code vs Gemini CLI. For another vendor's terminal agent, see Codex CLI.

Frequently asked questions

Is Gemini CLI free?

Not for individuals any more. Since June 18, 2026, Gemini CLI no longer serves free individual users or Google AI Pro and Ultra subscribers, who were moved to Antigravity CLI. Gemini CLI remains for Gemini Code Assist Standard and Enterprise licenses and for paid Gemini API and Vertex AI keys, which are billed by usage.

Is Gemini CLI open source?

Yes. The code is public in the google-gemini/gemini-cli repository on GitHub, with weekly releases and a community of contributors. Open source describes the code, not the access: using Google's models still requires an eligible license or an API key, and since June 2026 that no longer includes free individual use.

How do I install Gemini CLI?

Install Node.js 20 or later, then run npm install -g @google/gemini-cli. You can also use Homebrew with brew install gemini-cli, MacPorts, or try it without installing through npx @google/gemini-cli. Start it by running gemini in your project folder and choose how to authenticate.

What is GEMINI.md?

GEMINI.md is a context file with standing instructions for the agent, such as your stack, code style and rules. Gemini CLI loads a global file from ~/.gemini/GEMINI.md plus files in your workspace and parent folders, and sends them with every prompt. Run /init to generate one and /memory show to inspect what is loaded.

What replaced Gemini CLI?

Google is moving consumer and free use to Antigravity CLI, a Go-based terminal tool started with the agy command. It keeps skills, hooks, subagents and extensions, which are now plugins. Gemini CLI itself continues for enterprise Code Assist customers and paid API users, so it is not shut down.

Can I use my Gemini API key with Gemini CLI?

Yes. Create a key in Google AI Studio, set the GEMINI_API_KEY environment variable, run gemini and choose the API key option. Billing is usage-based on your Gemini API plan. This is also the documented route for headless and automated use, alongside Vertex AI credentials.

Created with AI assistance and edited for this site. Examples are illustrative and do not represent customer research. About the publisher.