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
AI Coding Tools — Prompt Engineering & Configuration
Complete guides for Claude Code, OpenCode, Gemini CLI, Cursor, GitHub Copilot, and more. Tool-specific prompt patterns, configuration files, and setup guides for every major AI coding assistant.
Prompt Engineering in GitHub Copilot
Prompt patterns for GitHub Copilot chat, inline edits, and agent mode. Master workspace context, slash commands, step-by-step feature patterns, PR-focused prompting, and common pitfalls.
Sandboxed Code Execution for AI Agents with MicroPython + WASM
Step-by-step tutorial on building a safe code-execution tool for AI agents using MicroPython compiled to WebAssembly. Covers installation, one-shot and persistent sessions, resource limits, host functions, and integration into agent tool loops — with working code you can copy and run.