@bacnh85/pi-agy

extensionmaintained

Google Antigravity CLI (agy) bridge for Pi — delegate bulk scaffolding, refactors, and test generation to a leaner model.

by · v0.3.1 · published 4d ago

$ pi install npm:@bacnh85/pi-agy
downloads/mo
978
stars
8
last push
12h ago
open issues
1

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

1.0K downloads · last 12 weeks (weekly)

README

@bacnh85/pi-agy

Google Antigravity CLI (agy) bridge for the Pi coding agent.

Offload bulk implementation, scaffolding, repetitive refactors, and exhaustive test generation to Gemini, Claude, or GPT-OSS through agy, while Pi retains the conductor role for judgement and verification.

Install

pi install npm:@bacnh85/pi-agy

Prerequisites

Install the Antigravity CLI (a Go binary, not pipx):

curl -fsSL https://antigravity.google/cli/install.sh | bash

Windows PowerShell:

irm https://antigravity.google/cli/install.ps1 | iex

Authenticate (one-time in your terminal):

agy

Verify the CLI works:

agy --version
agy models

Tool

agy_execute

ParamTypeDefaultDescription
promptstringrequiredTask instruction for agy
modelmodel alias belowflash-mediumAntigravity model; takes precedence over tier
tierflash / flash-lo / proLegacy Gemini tier compatibility
modeaccept-edits / plan / sandboxaccept-editsagy execution mode
dirstringcwdWorking directory
digestbooleanmode-basedCompact output; defaults on for plan/sandbox and off for accept-edits
timeout_msnumber300000Timeout in milliseconds

Models

Aliases map to agy's canonical machine names (run agy models to list them):

Aliasagy machine nameTypical use
flash-lowgemini-3.6-flash-lowTrivial, few-step, high-volume work
flash-mediumgemini-3.6-flash-mediumDefault coding, exploration, and tests
flash-highgemini-3.6-flash-highDifficult agentic work
pro-lowgemini-3.1-pro-lowAdvanced reasoning
pro-highgemini-3.1-pro-highHardest Gemini reasoning
sonnetclaude-sonnet-4-6Normal Claude coding and review
opusclaude-opus-4-6-thinkingHardest architecture and root-cause review
gpt-ossgpt-oss-120b-mediumAlternative open model

Resolution order is explicit model, then explicit legacy tier, then flash-medium. Legacy mappings remain flashflash-high, flash-loflash-low, and propro-high. Run agy models if Antigravity changes its display names or plan availability.

Quota-aware routing

WorkProduceCross-review when consequential
Routine bulk workflash-medium (Gemini quota group)sonnet with mode=plan
Claude-group implementationsonnet (Claude quota group)flash-medium with mode=plan
Hard reasoningEscalate to pro-high or opus only after the cheaper model is insufficientOpposite family

Batch related work, prefer digest=true for non-write calls, and avoid parallel calls inside one shared-quota group. Do not spend both groups on trivial tasks. Pi should review the diff and run verification after every accept-edits call.

# Gemini produces, Claude reviews
agy_execute prompt="Implement the approved refactor" model=flash-medium mode=accept-edits
agy_execute prompt="Review the resulting diff" model=sonnet mode=plan digest=true

# Claude produces, Gemini reviews
agy_execute prompt="Fix the parser root cause" model=sonnet mode=accept-edits
agy_execute prompt="Review the resulting diff" model=pro-low mode=plan digest=true

How pi-agy shapes the handoff

Pi delegates to agy as a producer, not an autonomous agent. Each call is framed so the result is verifiable and parseable — this is where pi-agy adds value over running agy bare:

  • Mode-aware flags. plan is read-only. accept-edits and sandbox both write, so pi-agy passes --dangerously-skip-permissions for them (headless -p mode auto-denies writes without it). plan/sandbox additionally get --output-format json.
  • Phase-aware prompt framing. plan prompts are prefixed to explore only; sandbox notes isolation; accept-edits gets a verify-loop line.
  • Verify-loop injection. In accept-edits, if the project's package.json has a test script, pi-agy appends After editing, run \npm test` and fix failures until it passes.` — implementing Google's own Best Practices ("provide a local verification mechanism… run the local test command").
  • Structured output. plan/sandbox return JSON; pi-agy extracts the .response field so Pi receives the answer, not the raw envelope (with a safe fallback to raw text on schema drift).

Safety

  • Pre-flight checks verify agy is installed and the CLI can reach its backend (agy --version + agy models).
  • agy always runs with detached stdin (stdio: ['ignore', 'pipe', 'pipe']) to prevent hanging.
  • --dangerously-skip-permissions is used only for accept-edits/sandbox (the modes that write), scoped to the --add-dir workspace; plan never receives it.
  • Output is truncated to 8000 characters to protect Pi's context window.
  • Always review the git diff after accept-edits mode.

Development

npm test

Changelog

See CHANGELOG.md for release history.

License

MIT