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

opencode-antigravity-autopilot

v2.3.1

Published

Intelligent quota monitoring and model auto-switching for OpenCode with Antigravity. Plugin-based, zero source modifications required.

Readme

OpenCode Antigravity Autopilot

npm version License: MIT

Intelligent quota management and model rotation for opencode-antigravity-auth. Automatically switches models when quota runs low, tracks usage across accounts, and works with both OpenCode and oh-my-opencode.

Quick Install

New to the Antigravity ecosystem? Start here:

👉 Complete Installation Guide - Step-by-step setup for auth + quota + oh-my-opencode

Let an LLM set it up:

Set up opencode-antigravity-autopilot for me. Follow:
https://raw.githubusercontent.com/gooseware/opencode-antigravity-autopilot/main/INSTALL.md

Ask me:
1. Am I using oh-my-opencode or vanilla OpenCode?
2. What models do I prefer? (e.g., gemini-3-pro, claude-sonnet-4-5-thinking)
3. Should quota rotation be automatic?

Then configure everything for me.

Manual Install

Prerequisites

Installation

npm install opencode-antigravity-autopilot

Configuration

For OpenCode

Add to ~/.config/opencode/opencode.json:

{
  "plugin": [
    "opencode-antigravity-auth@beta",
    "opencode-antigravity-autopilot"
  ]
}

For oh-my-opencode

Add to ~/.config/opencode/oh-my-opencode.json:

{
  "google_auth": false,
  "quota_rotation": true,
  "agents": {
    "Sisyphus": { "model": "google/antigravity-claude-sonnet-4-5" },
    "librarian": { "model": "google/antigravity-gemini-3-flash" },
    "explore": { "model": "google/antigravity-gemini-3-flash" },
    "oracle": { "model": "google/antigravity-claude-opus-4-5-thinking" }
  }
}

Usage

Basic Usage

import { QuotaManager } from 'opencode-antigravity-autopilot';

const manager = new QuotaManager({
  quotaThreshold: 0.2,
  preferredModels: [
    'google/antigravity-gemini-3-pro',
    'google/antigravity-claude-sonnet-4-5'
  ]
});

await manager.initialize();

const bestModel = manager.selectBestModel();
console.log(`Using model: ${bestModel}`);

const quota = await manager.getQuota();
console.log(`Remaining quota: ${quota?.remainingFraction * 100}%`);

oh-my-opencode Integration

import { createOhMyOpenCodeIntegration, QuotaManager } from 'opencode-antigravity-autopilot';

const manager = new QuotaManager();
await manager.initialize();

const integration = createOhMyOpenCodeIntegration(manager, {
  defaultModel: 'google/antigravity-gemini-3-flash'
});

const modelForAgent = await integration.getModelForAgent('oracle');
console.log(`Oracle will use: ${modelForAgent}`);

Model Rotation Strategy

manager.setModelRotationStrategy({
  preferredModels: [
    'google/antigravity-gemini-3-pro-high',
    'google/antigravity-claude-sonnet-4-5-thinking'
  ],
  fallbackModels: [
    'google/antigravity-gemini-3-flash',
    'google/gemini-2.5-flash'
  ],
  quotaThreshold: 0.15
});

Features

  • Automatic Model Rotation: Switches to fallback models when quota drops below threshold
  • Multi-Account Support: Leverages opencode-antigravity-auth's account pool
  • Quota Tracking: Real-time monitoring via LSP process
  • oh-my-opencode Compatible: Dynamic agent model assignment
  • Zero Config: Works out-of-box with sensible defaults

How It Works

  1. Reads authenticated accounts from opencode-antigravity-auth storage
  2. Monitors quota via Antigravity LSP process (passive monitoring)
  3. Tracks quota per model and selects best available option
  4. Auto-rotates accounts when current account is exhausted
  5. Integrates with oh-my-opencode for agent-level model management

API

QuotaManager

const manager = new QuotaManager(config?: PluginConfig);
await manager.initialize();

manager.getQuota(): Promise<QuotaInfo | null>
manager.selectBestModel(): string | null
manager.rotateAccount(): Promise<void>
manager.updateQuotaForModel(model: string, quota: QuotaInfo): void
manager.setModelRotationStrategy(strategy: ModelRotationStrategy): void

createOhMyOpenCodeIntegration

const integration = createOhMyOpenCodeIntegration(manager, config);

integration.getModelForAgent(agentName: string, preferredModel?: string): Promise<string>
integration.updateAgentConfig(config: OhMyOpenCodeConfig, strategy: ModelRotationStrategy): OhMyOpenCodeConfig
integration.pollQuotaAndRotate(models: string[]): Promise<void>

Configuration Options

interface PluginConfig {
  quotaThreshold?: number;        // Default: 0.2 (20%)
  pollIntervalMs?: number;         // Default: 60000 (1 min)
  enableRotation?: boolean;        // Default: true
  preferredModels?: string[];      // Models to prefer
}

Troubleshooting

LSP Process Not Found

  • Ensure Antigravity IDE is running
  • Check ps aux | grep language_server_antigravity

Quota Always Shows Null

  • Verify opencode-antigravity-auth is authenticated
  • Restart Antigravity IDE

Models Not Rotating

  • Check quotaThreshold setting
  • Verify preferred models are configured correctly

Credits

Built on opencode-antigravity-auth by @NoeFabris. This plugin extends its authentication system with intelligent quota management.

License

MIT

Contributing

Issues and PRs welcome at github.com/gooseware/opencode-antigravity-autopilot