Search for a command to run...
Install Google's Gemini CLI with npm, npx or Homebrew, authenticate with OAuth, an API key or Vertex AI, script it in headless mode and migrate to Antigravity CLI.
Gemini CLI is Google's open-source terminal agent (Apache 2.0). It ships weekly releases
with a preview, stable and nightly channel.
On 18 June 2026 Gemini CLI and the Gemini Code Assist IDE extensions stopped serving requests for Google AI Pro and Ultra users and for people using it for free. Google has moved its effort into Antigravity CLI and Antigravity 2.0, a multi-agent platform. Gemini CLI still works with a paid Gemini API key or Gemini Enterprise Agent Platform API key.
# Run it without installing anything
npx @google/gemini-cli
# Install globally with npm
npm install -g @google/gemini-cli
# Install with Homebrew (macOS and Linux)
brew install gemini-cli# macOS with MacPorts
sudo port install gemini-cli# In a Conda environment (restricted networks)
conda create -y -n gemini_env -c conda-forge nodejs
conda activate gemini_env
npm install -g @google/gemini-cli# Stable — the full promotion of last week's preview release
npm install -g @google/gemini-cli@latest
# Preview — published every Tuesday at 23:59 UTC
npm install -g @google/gemini-cli@preview
# Nightly — every change from main, published daily
npm install -g @google/gemini-cli@nightly# Download Antigravity CLI
# https://antigravity.google/download
# The migration guide
# https://antigravity.google/docs/gcli-migrationAntigravity CLI is written in Go, so it is faster, and it keeps the parts people relied on most: Agent Skills, hooks, subagents and extensions (now Antigravity plugins). The migration guide covers moving your settings, MCP servers and provider configuration.
# Interactive OAuth login
gemini
# Or set the project for a paid Code Assist licence
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
gemini# Get a key at https://aistudio.google.com/apikey
export GEMINI_API_KEY="YOUR_API_KEY"
gemini# For enterprise use and higher rate limits
export GOOGLE_API_KEY="YOUR_API_KEY"
export GOOGLE_GENAI_USE_VERTEXAI=true
gemini# Start an interactive session in the current directory
gemini
# Include more directories in the context
gemini --include-directories ../lib,../docs
# Pick a model
gemini -m gemini-2.5-flash# A simple text response
gemini -p "Explain the architecture of this codebase"
# Structured output
gemini -p "Explain the architecture of this codebase" --output-format json
# Stream events for long-running operations
gemini -p "Run the tests and deploy" --output-format stream-jsonCreate a GEMINI.md in the project root to give the agent persistent context. Commit it
so the whole team shares the same instructions:
# GEMINI.md
- Run `npm run lint && npm test` before reporting a change as done.
- Never edit files under `migrations/` without asking first.
- Use the repository pattern in `src/repositories/` for all database access.# Configure an MCP server in ~/.gemini/settings.json{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }
}
}
}> @github List my open pull requests
> @slack Send a summary of today's commits to #devGEMINI.md so the agent knows your conventions on every machine.--output-format json and parse the result.@latest for stability, @nightly only to test new features..env.Install Anthropic's Claude Code with the native installer or the signed apt, dnf and apk repositories, authenticate, and verify the release signature.
Install Aider with the one-line installer, uv or pipx, connect it to a model provider and let it commit your changes to git as it works.