AG
Gemini & Antigravity v2.0 Agentic Engineering Guide
Antigravity Architecture CLI Reference Verified: 2026-10

Antigravity CLI (agy) In-Depth Guide & CI/CD Automation

Master the official Antigravity CLI command suite: agy run, agy test, agy session, and system preflight checks for seamless continuous integration.

Author: AGY Core Architecture Group • Google GenAI & Antigravity 2.0 Engineering Spec

Antigravity CI Automated Regression Script

scripts/run-agy-ci.sh

#!/usr/bin/env bash
set -euo pipefail

echo "==> [AGY-CI] Initializing Antigravity Automation Runner..."
agy --version || { echo "Error: agy CLI not found in PATH"; exit 1; }

echo "==> [AGY-CI] Running environment preflight checks..."
agy doctor --json > /tmp/agy-doctor.json

echo "==> [AGY-CI] Executing non-interactive agentic validation..."
agy run "Run unit test suite. If failures occur, pinpoint root cause and self-heal with minimal diffs." \
  --non-interactive \
  --timeout 300 \
  --max-turns 15

echo "==> [AGY-CI] Workflow completed with exit code 0."

Understanding the agy CLI

agy is the primary command-line interface for orchestrating the Antigravity agentic engine. It serves both as an interactive developer companion in local terminal workflows and as a headless execution runner inside continuous integration environments (GitHub Actions, GitLab CI).


Command Matrix & Option Reference

CategoryCommandKey FlagsTypical Use Case
Diagnosticsagy doctor--verbose, --jsonVerify MCP server connections, Python/Node runtimes, and permissions
Executionagy run [prompt]--non-interactive, --timeout, -mLaunch single-objective autonomous agent execution
Sessionsagy session--resume [id], --listManage long-lived multi-turn conversations and checkpoints
Scaffoldingagy init--template [web|api]Generate .agents/ workspace customization scaffold
Configagy config get/set--global, --workspaceManage model routing policies, tool limits, and endpoints

Command Walkthroughs

1. agy doctor: Preflight Health Diagnostics

Before delegating multi-file refactoring or running automated tests, execute agy doctor to verify system prerequisites:

# Run formatted diagnostic check
agy doctor

# Output raw JSON for programmatic CI assertion
agy doctor --json | jq '.mcp_servers'

2. agy run: Headless Autonomous Execution

agy run delegates a structured coding objective to the agent. With --non-interactive, the agent explores context, applies diffs, executes test suites, and verifies syntax without requiring human keystrokes:

# Automatically resolve TypeScript compile errors and verify build
agy run "Fix all TypeScript lint warnings and verify npm run build passes" \
  --max-turns 10 \
  --timeout 180

[!TIP] In automated pipelines, always supply --max-turns to prevent runaway token expenditure and --timeout to bound execution duration.

3. Session Resume (agy session)

Antigravity automatically journals execution steps into structured JSONL transcripts. If a build task is paused, developers can resume state seamlessly:

# List recent sessions
agy session --list --limit 5

# Resume a specific session ID
agy session --resume <session-id>

GitHub Actions CI Integration

Save the downloadable artifact above to scripts/run-agy-ci.sh and wire it into your workflow:

name: Antigravity Automated Regression
on: [pull_request]

jobs:
  agentic-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 22
      - name: Run Antigravity Autonomous Test
        env:
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
        run: |
          chmod +x ./scripts/run-agy-ci.sh
          ./scripts/run-agy-ci.sh