Antigravity CLI — Getting Started
Install, authenticate, and run your first Antigravity CLI session. Covers curl install, npm, Homebrew, OAuth, API key auth, and essential commands.
Antigravity CLI — Getting Started
Antigravity CLI (agy) replaces Gemini CLI for individual consumers. This guide covers installation, authentication, and your first session.
Installation
Quick install (recommended)
curl -fsSL https://antigravity.google/cli/install.sh | bash
The script detects your OS and architecture, downloads the Go binary, verifies the checksum, and installs to ~/.local/bin/agy.
npm
npm install -g @google/antigravity-cli
Homebrew (macOS/Linux)
brew install antigravity-cli
Verify
agy --version
If the command isn't found, add ~/.local/bin to your PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Authentication
Antigravity CLI supports three authentication methods:
Option 1: OAuth (recommended)
agy
Choose "Sign in with Google" and follow the browser flow. Your token is cached in the system keyring.
Option 2: API Key
export ANTIGRAVITY_API_KEY="your-api-key"
agy
Get a free API key at aistudio.google.com/apikey. The free tier supports 1,000 requests/day.
Option 3: Enterprise (Vertex AI / Code Assist)
export GOOGLE_CLOUD_PROJECT="your-project-id"
agy
First Session
cd your-project
agy
You'll see the Antigravity CLI prompt:
⚡ Antigravity CLI
Model: Gemini 3.5 Flash (High)
Context: 1,048,576 tokens
Sandbox: workspace
Type /help for commands.
>
Essential Commands
| Command | What it does |
|---|---|---|
| /help | Show all commands |
| /model | Switch AI model |
| /config | Open configuration settings |
| /clear | Clear conversation |
| /mcp | Manage MCP servers |
| /skills | Manage installed skills and plugins |
| /agents | List and monitor active agents |
Quick Examples
# Analyze your codebase
> Explain the architecture of this project
# Generate code
> Create a REST API endpoint for user authentication
# Debug
> Why is this test failing?
# Refactor
> Rename `User` to `Account` across all files
Model Selection
Switch models during a session:
/model
Available models:
| Alias | Model |
|---|---|
Gemini 3.5 Flash (High) | Fast, general-purpose coding |
Gemini 3.5 Flash (Low) | Cheapest, fastest |
Gemini 3.1 Pro (High) | Deep reasoning, architecture |
Claude Sonnet 4.6 (Thinking) | Balanced reasoning |
Claude Opus 4.6 (Thinking) | Maximum reasoning depth |
GPT-OSS 120B (Medium) | Open-source alternative |
Or set via flag:
agy --model "Claude Sonnet 4.6 (Thinking)"
Next Steps
- Prompt Engineering — Write effective prompts
- Configuration Reference — Settings, MCP, plugins
- Migration Guide — If migrating from Gemini CLI
- Patterns — Subagents, hooks, async tasks
Related Articles
Antigravity CLI — Configuration Reference
Complete configuration reference for Antigravity CLI. Settings.json, environment variables, MCP servers, plugins, trusted folders, and project context files.
OpenCode — Configuration Reference
Complete OpenCode configuration reference. Covers opencode.json settings, MCP server integration, skills system, .opencode/ directory conventions, and environment variables.
Gemini CLI — Configuration Reference (Enterprise)
Enterprise Gemini CLI configuration reference. Covers gemini.yaml settings, MCP integration, .gemini/ directory conventions, sandbox configuration, extension management, and environment variables for Vertex AI deployments.