Quickstart
Plan in Antigravity, compile with agb plan, execute with agb run, watch with agb status
You shape and plan in Antigravity and execute with agb. You can shape a raw idea interactively with /agb-shape (agb shape, which runs deterministic DAG pre-analysis and the 5-lens Plan Adversarial Review Loop before syncing to your brain artifact), or use the desktop app's plan mode / a planning conversation in an agy session. Both write a brain artifact (implementation_plan.md under ~/.gemini/antigravity-cli/brain/ or ~/.gemini/antigravity/brain/). agb plan compiles that artifact (using the 0-LLM Structured Spec Fast-Path when agb shape pre-analysis passes): treat implementation_plan.md or specs/<slug>-spec.md as source and plan.json as its compiled output.
This page assumes you have finished Installation and agb doctor passes. Inside an interactive Antigravity session, you can also invoke the full 5-phase Factory in natural language with /agb <description> (or /agb --yolo <description> for autonomous end-to-end execution) or with the specific /agb-shape, /agb-plan, /agb-run, /agb-watch, and /code-review slash commands.
Optional v2.0 token-efficiency accelerators (zero config)
Tier 0 token optimizations are enabled automatically. To unlock Tier 1 and Tier 2 acceleration (up to -92.8% fewer prosecution/review tokens at 100% recall), initialize CodeGraph (codegraph init or agb init --with-codegraph) and export GEMINI_API_KEY (auto-detected for Google's zero-output-token Gemini Decisions API). Verify readiness anytime with agb doctor, or read Token efficiency.
Compile a plan
agb brains # list plan artifacts, newest first
agb plan <brain-id> /abs/repo # compile → gate → plan.jsonThe compiler converts the plan with a frontier model, then runs it through the plan gates (structural checks, coldstart, parallax, and an advisory premortem). Any failure goes back into a fresh conversion rather than leaving you with invalid JSON. When findings survive that loop, the fix belongs in the plan: refine it in Antigravity, or edit the spec, and re-run agb plan. See Plan boundary.
Useful flags: --out <file> (default plan.json), --force (overwrite an existing output file, which is refused otherwise), --no-coldstart, --no-parallax, --no-premortem.
Validate it (optional)
A compiled plan has already passed validation. If you edited plan.json by hand, check it again:
agb validate plan.jsonRun it
agb run plan.jsonEach ticket is built in its own worktree, gated, prosecuted by another model family, and merged in order. The final report is printed to stdout as JSON.
Watch it
From another terminal:
agb status /abs/repo # one-shot snapshot of the current run
agb status /abs/repo --watch # refresh in place (--interval <ms>, default 200)
agb watch /abs/repo # interactive full-screen TUI dashboard ([q] quit, [r] refresh, [c] compact, [space] pause)For a browser/sidecar view, start the sidecar dashboard with agb sidecar /abs/repo.
Exit codes
The general rule is 0 = pass, 2 = gate failure or findings, 1 = usage or internal error (bin/agb.mjs). For the commands on this page:
| Command | 0 | 1 | 2 |
|---|---|---|---|
agb plan | compiled, plan.json written | missing arguments, output exists without --force, or quota telemetry unavailable from agy (L195-L210) | blocking findings, plan not compiled (C10) |
agb validate | plan valid | unreadable or malformed file (internal error) | plan invalid (C10) |
agb run | every ticket succeeded | plan invalid (C10) | one or more tickets failed (C10) |
agb status | snapshot printed | the removed TUI flag was passed (use agb sidecar) (L269-L272) | — (with --watch, the code comes from the watch loop) |
An invalid plan exits with 1 from agb run but with 2 from agb validate. For validate, an invalid plan is the finding it exists to report. For run, it is a usage error.
The full table for every command is in Exit and error codes.
Next steps
- Writing plans: hand-writing
plan.jsonwhen you have no brain artifact. - Walkthrough: a complete worked example.
- Plan schema: every field
agb validateenforces.