@bacnh85/pi-agy
Google Antigravity CLI (agy) bridge for Pi — delegate bulk scaffolding, refactors, and test generation to a leaner model.
Package details
Install @bacnh85/pi-agy from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@bacnh85/pi-agy- Package
@bacnh85/pi-agy- Version
0.3.0- Published
- Aug 2, 2026
- Downloads
- 632/mo · 351/wk
- Author
- bacnh85
- License
- MIT
- Types
- extension, skill
- Size
- 29 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./extensions/index.ts"
],
"skills": [
"./skills"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
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
| Param | Type | Default | Description |
|---|---|---|---|
prompt |
string | required | Task instruction for agy |
model |
model alias below | flash-medium |
Antigravity model; takes precedence over tier |
tier |
flash / flash-lo / pro |
— | Legacy Gemini tier compatibility |
mode |
accept-edits / plan / sandbox |
accept-edits |
agy execution mode |
dir |
string | cwd | Working directory |
digest |
boolean | mode-based | Compact output; defaults on for plan/sandbox and off for accept-edits |
timeout_ms |
number | 300000 |
Timeout in milliseconds |
Models
Aliases map to agy's canonical machine names (run agy models to list them):
| Alias | agy machine name | Typical use |
|---|---|---|
flash-low |
gemini-3.6-flash-low |
Trivial, few-step, high-volume work |
flash-medium |
gemini-3.6-flash-medium |
Default coding, exploration, and tests |
flash-high |
gemini-3.6-flash-high |
Difficult agentic work |
pro-low |
gemini-3.1-pro-low |
Advanced reasoning |
pro-high |
gemini-3.1-pro-high |
Hardest Gemini reasoning |
sonnet |
claude-sonnet-4-6 |
Normal Claude coding and review |
opus |
claude-opus-4-6-thinking |
Hardest architecture and root-cause review |
gpt-oss |
gpt-oss-120b-medium |
Alternative open model |
Resolution order is explicit model, then explicit legacy tier, then flash-medium. Legacy mappings remain flash → flash-high, flash-lo → flash-low, and pro → pro-high. Run agy models if Antigravity changes its display names or plan availability.
Quota-aware routing
| Work | Produce | Cross-review when consequential |
|---|---|---|
| Routine bulk work | flash-medium (Gemini quota group) |
sonnet with mode=plan |
| Claude-group implementation | sonnet (Claude quota group) |
flash-medium with mode=plan |
| Hard reasoning | Escalate to pro-high or opus only after the cheaper model is insufficient |
Opposite 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.
planis read-only.accept-editsandsandboxboth write, so pi-agy passes--dangerously-skip-permissionsfor them (headless-pmode auto-denies writes without it).plan/sandboxadditionally get--output-format json. - Phase-aware prompt framing.
planprompts are prefixed to explore only;sandboxnotes isolation;accept-editsgets a verify-loop line. - Verify-loop injection. In
accept-edits, if the project'spackage.jsonhas atestscript, pi-agy appendsAfter 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/sandboxreturn JSON; pi-agy extracts the.responsefield so Pi receives the answer, not the raw envelope (with a safe fallback to raw text on schema drift).
Safety
- Pre-flight checks verify
agyis installed and the CLI can reach its backend (agy --version+agy models). agyalways runs with detached stdin (stdio: ['ignore', 'pipe', 'pipe']) to prevent hanging.--dangerously-skip-permissionsis used only foraccept-edits/sandbox(the modes that write), scoped to the--add-dirworkspace;plannever receives it.- Output is truncated to 8000 characters to protect Pi's context window.
- Always review the
git diffafteraccept-editsmode.
Development
npm test
Changelog
See CHANGELOG.md for release history.
License
MIT