Appearance
Antigravity Tips & Workflows
Practical techniques for getting the most out of Google Antigravity - Google's terminal-first AI development platform and the successor to Gemini CLI (retired June 2026).
Getting Started
Install Antigravity CLI globally:
bash
npm install -g @google/antigravity-cli
antigravity loginInitialize a project to create workspace context:
bash
cd ~/your-project
antigravity initTip 1: Use .antigravity.md for Persistent Context
Antigravity reads a .antigravity.md file at your project root. Use it to define project-wide instructions that persist across every session - tech stack, coding conventions, testing requirements, and deployment targets.
markdown
# Project Context
## Tech Stack
- Python 3.12, FastAPI, PostgreSQL 16
- Package manager: uv
- Testing: pytest with --cov
## Conventions
- Type hints required on all functions
- Docstrings follow Google style
- Commit messages: conventional commits format
## Deploy Target
- Cloud Run, us-central1, staging tag on main branchAntigravity reads this once at session start. It's prefix-cached for efficiency - you don't pay token costs to re-read it on every turn.
Tip 2: Run Autonomous Tasks
The antigravity run command executes a full agent loop - plan, search, edit, test, commit - for a single task:
bash
antigravity run "Fix the authentication bug in src/auth.ts and verify all tests pass"What happens: The agent searches the codebase for auth-related files, identifies the bug, applies edits, runs the test suite, and reports results. If tests fail, it diagnoses the failure and retries until the task completes or it determines it needs human input.
Tip 3: Multi-Agent Parallel Workflows
Use --parallel to fan out work across specialized agents:
bash
antigravity run --parallel "Build the REST API, write integration tests, and update the API documentation"What happens: Three agents run simultaneously - one implements the API, one writes tests, one updates docs. Results merge when all agents complete. This is graph engineering in practice: fan-out, parallel execution, fan-in.
Tip 4: Background Tasks for Long-Running Operations
Push long builds, test suites, and deployments to background tasks so you can keep working:
bash
antigravity run "Run the full test suite and deploy to staging if it passes" --backgroundAntigravity assigns a task ID, runs the work in the background, and notifies you when it completes. You can check status with antigravity tasks list and view logs with antigravity tasks logs <id>.
Tip 5: Deploy Directly to Google Cloud
Antigravity's deepest advantage is native Google Cloud integration. Deploy to Cloud Run with a single command:
bash
antigravity run "Build the Docker image, push to Artifact Registry, and deploy to Cloud Run with the staging tag"It handles authentication through your Google account, creates or updates the Cloud Run service, and verifies the deployment with a health check.
Tip 6: Google Workspace Integration
Antigravity can read and write Google Docs, Sheets, and Drive files directly:
text
Read the Q3 planning doc at docs.google.com/document/d/... and extract all action items into a markdown checklistTip 7: Reference Files with @ for Explicit Context
Use @ to explicitly include files in your prompt context:
bash
antigravity run "Analyze @src/auth/middleware.ts and @src/auth/types.ts - identify any security vulnerabilities"The agent reads only the files you specify instead of scanning the entire codebase.
Tip 8: The Agent Loop - Plan, Act, Observe, Repeat
Antigravity agents follow the standard agentic loop:
- Plan - Decompose the goal into steps
- Act - Execute the first step using the right tool
- Observe - Check the result (test output, build status, API response)
- Decide - Continue to the next step, retry on failure, or ask for help
You can see the agent's reasoning at each step by running with --verbose:
bash
antigravity run "Refactor the payment module to use the new Stripe API" --verboseTip 9: Multi-Directory Workspaces
Register multiple project directories for Antigravity to work across:
bash
antigravity workspace add ~/project-frontend
antigravity workspace add ~/project-backendThe agent can now operate across both codebases in a single session - useful for full-stack tasks that span frontend and backend.
Tip 10: Interactive Planning with /plan
Before executing, ask Antigravity to create an implementation plan for review:
text
/plan "Migrate the user service from Express to FastAPI"Antigravity generates a markdown plan with steps, files to modify, and risk assessment. Review it, request changes, then run /implement to execute.
Tip 11: Save and Resume Sessions
Long sessions can be saved and resumed:
bash
antigravity session save my-refactor-session
antigravity session resume my-refactor-sessionContext, conversation history, and project state are preserved across restarts.
Tip 12: Compress Long Contexts
When conversations grow long, ask Antigravity to summarize the conversation so far:
text
Summarize our work so far - what we've done, what's pending, and any decisions madeThis creates a compressed context checkpoint. Start a new session with the summary as initial context to stay within token limits.
Model Access
The Antigravity agent model benchmarks at 76.2% on Terminal-Bench 2.1 and 1656 Elo on GDPval-AA - Google's strongest coding model, purpose-built for agentic terminal workflows. Available through Antigravity CLI, IDE integration, and the Antigravity SDK.