Dev tools
Gemini CLI: How to Install It and the Antigravity Switch
Gemini CLI is Google's open-source AI agent for the terminal. How to install and use it, who it's for now, the move to Antigravity CLI and how it compares.
Gemini CLI is Google's open-source AI agent for the terminal: it reads your code, edits files, runs commands and connects to tools through the Model Context Protocol (MCP), using Google's Gemini models. It's free and open source under the Apache 2.0 licence, and you install it with npm install -g @google/gemini-cli. But its role has changed: on June 18, 2026, Google moved free users and Google AI Pro and Ultra subscribers to a new terminal agent, Antigravity CLI (command agy), which shares its engine with the Antigravity desktop app. Gemini CLI now mainly serves organizations using Gemini Code Assist Standard or Enterprise and some paid API and Vertex AI setups. If you're an individual starting today, Antigravity CLI is usually the tool to install.
This guide covers what Gemini CLI is, how to install and use it, who should still use it, how to move to Antigravity CLI, and how it compares with Claude Code.
What Is Gemini CLI?
Gemini CLI is a command-line AI agent. Like other coding agents, it works in a loop: you describe a task, and it reads files, plans, edits code, runs shell commands and checks the results, asking for your approval before risky actions. Key features:
- Open source: the code is on GitHub under the Apache 2.0 licence, with a large community of contributors.
- Built-in tools: reading and writing files, shell commands, web search and fetching web pages.
- Project context files: a
GEMINI.mdfile gives the agent instructions about your project, similar toAGENTS.mdandCLAUDE.md. Our guide to AGENTS.md explains how these files work. - MCP support: connect external tools and data sources through MCP servers configured in
~/.gemini/settings.json. - Extensions: packages that add commands, context and MCP servers.
- Non-interactive mode for scripts and automation.
What Changed: Gemini CLI and Antigravity CLI
In May 2026, Google announced that it would consolidate its developer agents around Antigravity. The key changes:
| Gemini CLI | Antigravity CLI | |
|---|---|---|
| Command | gemini | agy |
| Who it's for | Gemini Code Assist Standard and Enterprise, Code Assist for GitHub on Google Cloud, legacy paid API and Vertex AI keys | Free users and Google AI Pro and Ultra subscribers (since June 18, 2026) |
| Built with | TypeScript and Node.js | Go |
| Shares engine with | Its own | The Antigravity desktop app |
| Newest models | Not tuned for the latest Gemini models | Built for Google's newest models |
| Customization | GEMINI.md, MCP, extensions, skills, hooks | Agent Skills, hooks, subagents, plugins (extensions carried over as plugins); still reads GEMINI.md and AGENTS.md |
| Licence | Open source (Apache 2.0) | Check Google's terms |
In short: Gemini CLI continues for enterprise customers, while individual developers are expected to use Antigravity CLI.
Gemini CLI Install
The Gemini CLI install needs Node.js. Choose one method:
npm install -g @google/gemini-cli # install globally with npm
npx @google/gemini-cli # or run without installing
brew install gemini-cli # or use Homebrew on macOS and LinuxThen start it in your project folder:
cd my-project
geminiOn first run, it asks you to sign in. For organizations, that's usually a Google account with a Gemini Code Assist licence, or an API key or Vertex AI project configured through environment variables, as described in the project's README.
How to Use Gemini CLI
Once it's running, you work in plain language:
- Explore code: "Explain how authentication works in this project."
- Make changes: "Add input validation to the signup form and update the tests."
- Run tasks: "Run the test suite and fix any failures."
- Use files in prompts: reference files with
@path/to/file. - Slash commands:
/helplists commands,/memorymanages context and/toolsshows available tools.
Good habits:
- Create a GEMINI.md describing how to build, test and follow your conventions.
- Review every proposed change before approving it, especially shell commands.
- Commit often, so you can roll back easily.
- Add MCP servers for tools you use, such as issue trackers or databases, with care about permissions.
How to Use Gemini CLI for Free
How to use Gemini CLI for free changed with the Antigravity switch. Gemini CLI's own code is free and open source, but the model access behind it now depends on your account:
- Individuals with a personal Google account, including Google AI Pro and Ultra subscribers, now get their terminal agent access through Antigravity CLI rather than Gemini CLI.
- Organizations using Gemini Code Assist Standard or Enterprise continue to use Gemini CLI as part of their licence.
- Developers with paid Gemini API or Vertex AI keys may continue to use Gemini CLI with those keys, paying for usage.
If you want a free terminal agent from Google today, check Antigravity CLI's current free tier and limits.
Extending Gemini CLI with MCP and Extensions
Gemini CLI becomes more useful when it can reach the tools you already use. MCP servers are added in settings.json, either globally in your home folder or per project, and give the agent new tools such as querying a database, reading issues or calling an internal API. Extensions bundle MCP servers, custom commands and context into one installable package, which makes it easier to share a setup across a team. Add only servers you trust, and limit their permissions, since the agent can call them on its own.
Gemini CLI Safety Settings
Because a terminal agent can edit files and run commands, it's worth knowing the safety controls:
- Approval prompts: by default, Gemini CLI asks before running shell commands and editing files. Avoid auto-approving everything except in throwaway environments.
- Sandboxing: Gemini CLI can run tools inside a sandbox, such as a container, to limit what commands can affect on your machine.
- Trusted folders: you can control which folders the agent treats as trusted before it loads project settings.
- Scripts and automation: in non-interactive mode, such as in a script or CI job, give the agent only the permissions and credentials the task needs.
Antigravity CLI: Install and Migration
Antigravity CLI is Google's newer terminal agent. To install it:
curl -fsSL https://antigravity.google/cli/install.sh | bashOn Windows, the documentation provides a PowerShell install command. The binary is installed as agy.
To migrate from Gemini CLI:
- Install Antigravity CLI and sign in with your Google account.
- Import your extensions with
agy plugin import gemini, which converts Gemini CLI extensions to Antigravity plugins. - Move workspace skills from
.gemini/skills/to.agents/skills/. - Keep your context files: Antigravity CLI still reads
GEMINI.mdandAGENTS.md. - Recheck MCP servers and hooks after migrating.
Gemini CLI vs Claude Code
Gemini CLI vs Claude Code is a common comparison, since both are terminal coding agents:
| Gemini CLI | Claude Code | |
|---|---|---|
| Maker | Anthropic | |
| Models | Gemini models | Claude models |
| Open source | Yes (Apache 2.0) | No |
| Context file | GEMINI.md (also reads AGENTS.md if configured) | CLAUDE.md |
| MCP support | Yes | Yes |
| Extensions | Extensions, skills, hooks | Skills, hooks, subagents, plugins |
| Cloud and background tasks | Through other Google products | Cloud sessions on the web and mobile |
| Access | Enterprise Code Assist licences and paid API keys; individuals moved to Antigravity CLI | Paid Claude plans or API |
Both are capable. For individuals choosing today, the realistic comparison is Antigravity CLI vs Claude Code. Our guide to how to use Claude Code covers Anthropic's agent in detail, and our Claude Code vs Cursor comparison covers editor-based options.
Should You Still Use Gemini CLI?
| Your situation | Recommendation |
|---|---|
| Your company uses Gemini Code Assist Standard or Enterprise | Use Gemini CLI |
| You're an individual with a free Google account or Google AI Pro or Ultra | Use Antigravity CLI |
| You need a fully open-source agent you can modify | Gemini CLI's code remains open source |
| You use paid Gemini API or Vertex AI keys | Gemini CLI still works; check Google's guidance on the newest models |
FAQ
What is Gemini CLI?
Gemini CLI is Google's open-source AI agent for the terminal. It uses Gemini models to read and edit code, run commands and connect to tools through MCP, guided by a GEMINI.md project file.
How do I install Gemini CLI?
Install it with npm install -g @google/gemini-cli, run it without installing using npx @google/gemini-cli, or use brew install gemini-cli on macOS and Linux. Then run gemini in your project folder.
Is Gemini CLI still free?
The code is free and open source, but free and Google AI Pro and Ultra access moved to Antigravity CLI on June 18, 2026. Gemini CLI now mainly serves Gemini Code Assist enterprise customers and paid API or Vertex AI users.
What is Antigravity CLI?
Antigravity CLI is Google's newer terminal coding agent, run with the agy command. It's built in Go, shares its engine with the Antigravity desktop app, and supports skills, hooks, subagents and plugins.
Is Gemini CLI better than Claude Code?
Neither is better for everyone. Both are capable terminal agents with MCP support. Gemini CLI is open source and tied to Google's models and licences; Claude Code uses Claude models and offers cloud sessions. Try both on your own tasks.