npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@benvargas/pi-antigravity-image-gen

v1.1.1

Published

Google Antigravity image generation tool for pi - Generate images via Gemini and Imagen models with inline terminal rendering

Readme

@benvargas/pi-antigravity-image-gen

Image generation tool for pi using Google Antigravity's Gemini 3 Pro Image model.

Generated images are returned as tool result attachments for inline terminal rendering.

Based on opencode-antigravity-img by ominiverdi and opencode-antigravity-auth by NoeFabris.

Features

  • Gemini 3 Pro Image -- the only image model available via the Antigravity API
  • Aspect ratios -- 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
  • Inline rendering -- images display directly in the terminal
  • Endpoint fallback -- tries daily, autopush, and prod endpoints with automatic failover on rate limits or timeouts
  • Quota checking -- check remaining image generation quota and reset time
  • Flexible save options -- save to project, global, or custom directory
  • Config file support -- persistent settings via JSON config

Installation

pi install npm:@benvargas/pi-antigravity-image-gen

Or try without installing:

pi -e npm:@benvargas/pi-antigravity-image-gen

Setup

Authenticate with Google Antigravity via OAuth:

/login

Select google-antigravity from the provider list. This stores OAuth credentials that the extension uses automatically.

Usage

Once authenticated, ask pi to generate images naturally:

"Generate an image of a sunset over mountains"
"Create a 16:9 wallpaper of a cyberpunk city"
"Check my image generation quota"

The extension registers two tools that the model calls automatically:

generate_image

Generate an image from a text prompt.

| Parameter | Description | Default | |-----------|-------------|---------| | prompt | Image description (required) | -- | | aspectRatio | Image dimensions | 1:1 | | save | Save mode (none, project, global, custom) | none | | saveDir | Directory for save=custom | PI_IMAGE_SAVE_DIR |

image_quota

Check remaining image generation quota. No parameters required.

Shows a progress bar with percentage remaining and time until quota resets. Image generation uses a separate quota from text models, resetting approximately every 5 hours.

Saving Images

By default, images are only displayed inline and not saved to disk. Configure saving via tool parameter, environment variable, or config file (in order of priority):

Tool parameter

The model can pass save directly when calling the tool.

Environment variables

export PI_IMAGE_SAVE_MODE=global        # none|project|global|custom
export PI_IMAGE_SAVE_DIR=/path/to/dir   # required when mode=custom

Config file

Create a JSON config file (project overrides global):

Global: ~/.pi/agent/extensions/antigravity-image-gen.json Project: <repo>/.pi/extensions/antigravity-image-gen.json

If neither exists, the extension writes a default config to the global path with save set to global.

{
  "save": "global"
}

Save locations

| Mode | Directory | |------|-----------| | none | Not saved | | project | <repo>/.pi/generated-images/ | | global | ~/.pi/agent/generated-images/ | | custom | saveDir param or PI_IMAGE_SAVE_DIR |

API Endpoints

The extension uses Google's CloudCode API with automatic fallback:

  1. https://daily-cloudcode-pa.sandbox.googleapis.com (primary)
  2. https://autopush-cloudcode-pa.sandbox.googleapis.com (fallback)
  3. https://cloudcode-pa.googleapis.com (production)

If an endpoint returns a 429 (rate limited) or times out, the next endpoint is tried automatically.

Supported Models

Only gemini-3-pro-image is available via the Antigravity API. Other image models (Imagen, gemini-2.5-flash-image) are not supported by this endpoint.

Image output is always JPEG format. Generation typically takes 10-30 seconds.

Requirements

  • pi v0.51.0 or later
  • Google Antigravity OAuth credentials (via /login)

Uninstall

pi remove npm:@benvargas/pi-antigravity-image-gen

License

MIT