{"id":41230280,"url":"https://github.com/gooseware/opencode-antigravity-autopilot","last_synced_at":"2026-01-30T10:00:37.196Z","repository":{"id":332584564,"uuid":"1134288384","full_name":"Gooseware/opencode-antigravity-autopilot","owner":"Gooseware","description":"Quota management and model rotation for opencode-antigravity-auth","archived":false,"fork":false,"pushed_at":"2026-01-23T14:46:05.000Z","size":13380,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-23T16:20:26.346Z","etag":null,"topics":["antigravity","claude","gemini","model-rotation","oh-my-opencode","opencode","quota-management","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gooseware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-14T14:13:36.000Z","updated_at":"2026-01-23T14:46:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Gooseware/opencode-antigravity-autopilot","commit_stats":null,"previous_names":["gooseware/opencode-antigravity-quota"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Gooseware/opencode-antigravity-autopilot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gooseware%2Fopencode-antigravity-autopilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gooseware%2Fopencode-antigravity-autopilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gooseware%2Fopencode-antigravity-autopilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gooseware%2Fopencode-antigravity-autopilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gooseware","download_url":"https://codeload.github.com/Gooseware/opencode-antigravity-autopilot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gooseware%2Fopencode-antigravity-autopilot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28910947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antigravity","claude","gemini","model-rotation","oh-my-opencode","opencode","quota-management","typescript"],"created_at":"2026-01-23T00:50:49.884Z","updated_at":"2026-01-30T10:00:37.191Z","avatar_url":"https://github.com/Gooseware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCode Antigravity Autopilot\n\n[![npm version](https://img.shields.io/npm/v/opencode-antigravity-autopilot.svg)](https://www.npmjs.com/package/opencode-antigravity-autopilot)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n**Intelligent quota monitoring and automatic model switching for OpenCode with Antigravity.**\n\nZero OpenCode source modifications required - works as a pure plugin!\n\n## ✨ Features\n\n- 🔍 **Real-time Quota Monitoring** - Check quota via LLM tools\n- 🔄 **Automatic Model Switching** - Switch models when quota exhausted\n- 🎯 **Proactive Optimization** - Switch before hitting hard limits\n- 🔁 **Account Rotation** - Automatically rotate between accounts\n- 🛠️ **Plugin-Based** - No OpenCode source modifications needed\n- 🤖 **LLM-Aware** - Assistant can check quota and make decisions\n\n## 🚀 Quick Start\n\n### 🤖 Install with LLM\n\nSimply copy and paste this prompt to your OpenCode assistant:\n\n\u003e Please read the documentation at https://github.com/Gooseware/opencode-antigravity-autopilot#readme to understand the installation steps.\n\u003e Install the `opencode-antigravity-autopilot` plugin from npm.\n\u003e Then, configure `~/.config/opencode/opencode.json` to add `\"opencode-antigravity-autopilot\"` to the `plugin` list.\n\u003e Finally, create a default quota config in `~/.config/opencode/quota.json` with auto-rotation enabled for models like `antigravity-gemini-3-pro-high` and `antigravity-claude-sonnet-4-5`.\n\n### From NPM\n\n```bash\nnpm install opencode-antigravity-autopilot\n```\n\n### From GitHub (Source)\n\n```bash\ngit clone https://github.com/Gooseware/opencode-antigravity-autopilot.git\ncd opencode-antigravity-autopilot\nnpm install\nnpm run build\nnpm link\n```\n\n### Prerequisites\n\n- Node.js \u003e= 20.0.0\n- [opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) installed and configured\n- OpenCode with plugin support\n\n### Configuration\n\n#### Plugin Registration\n\nAdd to `~/.config/opencode/opencode.json`:\n\n```json\n{\n  \"plugin\": [\n    \"opencode-antigravity-auth\",\n    \"opencode-antigravity-autopilot\"\n  ]\n}\n```\n\n#### Quota Configuration\n\nCreate `~/.config/opencode/quota.json` to configure thresholds and models:\n\n```json\n{\n  \"quotaThreshold\": 0.05,\n  \"preferredModels\": [\n    \"antigravity-gemini-3-pro-high\",      // Try this first\n    \"antigravity-claude-sonnet-4-5\",      // Then this\n    \"antigravity-gemini-3-flash\"          // Fallback\n  ],\n  \"autoRotate\": true\n}\n```\n\nThat's it! The plugin is now active.\n\n## 📖 Usage\n\n### Check Quota via LLM\n\nSimply ask your assistant:\n\n```\n\"Check my quota status\"\n\"Show detailed quota for all models\"\n\"Can I use antigravity-gemini-3-pro-high right now?\"\n```\n\nThe LLM will call the appropriate tools and show results like:\n\n```\n# Quota Status\n\n✓ **Current Model:** antigravity-gemini-3-pro-high\n**Status:** Quota healthy at 67%\n\n**Accounts:** 1 of 3 active\n```\n\n### Available Tools\n\nThe plugin exposes three tools to the LLM:\n\n#### `quota_status`\nCheck current quota with optional detailed view\n\n```typescript\nquota_status()\nquota_status({ detailed: true })\n```\n\n#### `quota_check_model`\nCheck if a specific model has enough quota\n\n```typescript\nquota_check_model({ model: \"antigravity-gemini-3-pro-high\" })\n```\n\n#### `quota_rotate_account`\nManually rotate to next available account\n\n```typescript\nquota_rotate_account()\n```\n\n### Programmatic Usage\n\n```typescript\nimport { HardLimitDetector } from 'opencode-antigravity-autopilot';\n\nconst detector = new HardLimitDetector({\n  quotaThreshold: 0.2,  // Switch when below 20%\n  preferredModels: [\n    'google/antigravity-gemini-3-pro-high',\n    'google/antigravity-claude-sonnet-4-5'\n  ]\n});\n\n// Before using a model\nconst result = await detector.checkHardLimit('antigravity-gemini-3-pro-high');\n\nif (result.shouldRotate) {\n  console.log(`Switching to: ${result.nextModel}`);\n}\n```\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────┐\n│  OpenCode (No modifications)    │\n│                                 │\n│  LLM Tools:                     │\n│  - quota_status                 │\n│  - quota_check_model            │\n│  - quota_rotate_account         │\n└────────────┬────────────────────┘\n             │\n             ▼\n┌─────────────────────────────────┐\n│   Autopilot Plugin              │\n│                                 │\n│  ┌──────────────────────┐       │\n│  │  ApiQuotaPoller      │       │\n│  │  Real-time API data  │       │\n│  └──────────────────────┘       │\n│                                 │\n│  ┌──────────────────────┐       │\n│  │  HardLimitDetector   │       │\n│  │  Auto model switch   │       │\n│  └──────────────────────┘       │\n└─────────────────────────────────┘\n```\n\n## 🔧 Configuration\n\n### Quota Threshold\n\nConfigure when to proactively switch models:\n\n```typescript\nimport { QuotaManager } from 'opencode-antigravity-autopilot';\n\nconst manager = new QuotaManager({\n  quotaThreshold: 0.2  // Switch when below 20%\n});\n```\n\n### Preferred Models\n\nSet model preference order:\n\n```typescript\nimport { HardLimitDetector } from 'opencode-antigravity-autopilot';\n\nconst detector = new HardLimitDetector({\n  preferredModels: [\n    'google/antigravity-gemini-3-pro-high', // Try first\n    'google/antigravity-claude-sonnet-4-5', // Try second  \n    'google/antigravity-gemini-3-flash'     // Fallback\n  ]\n});\n```\n\n## 🧪 Testing\n\n```bash\n# Test hard limit detection\nnpm run test:quota\n\n# Run full test suite\nnpm test\n```\n\n## 📊 API Reference\n\n### HardLimitDetector\n\n```typescript\nclass HardLimitDetector {\n  constructor(config?: PluginConfig);\n  \n  checkHardLimit(currentModel: string): Promise\u003cHardLimitCheckResult\u003e;\n  updateAllQuotas(): Promise\u003cvoid\u003e;\n  rotateAccount(): Promise\u003cvoid\u003e;\n}\n\ninterface HardLimitCheckResult {\n  isExhausted: boolean;\n  shouldRotate: boolean;\n  nextModel?: string;\n  message?: string;\n}\n```\n\n### QuotaManager\n\n```typescript\nclass QuotaManager {\n  constructor(config?: PluginConfig);\n  \n  initialize(): Promise\u003cvoid\u003e;\n  getQuotaViaApi(modelName?: string): Promise\u003cQuotaInfo | null\u003e;\n  getAllQuotasViaApi(): Promise\u003cMap\u003cstring, QuotaInfo\u003e\u003e;\n  rotateAccount(): Promise\u003cvoid\u003e;\n}\n```\n\n### QuotaCacheUpdater\n\n```typescript\nclass QuotaCacheUpdater {\n  constructor(manager: QuotaManager, updateIntervalMs?: number);\n  \n  updateCache(): Promise\u003cvoid\u003e;\n  start(): void;\n  stop(): void;\n}\n\nfunction startQuotaCacheService(updateIntervalMs?: number): Promise\u003cQuotaCacheUpdater\u003e;\n```\n\n## 🛠️ Advanced Usage\n\n### Background Quota Service\n\nRun a background service to keep quota cache updated:\n\n```bash\nnpm run service:start\n```\n\nOr programmatically:\n\n```typescript\nimport { startQuotaCacheService } from 'opencode-antigravity-autopilot';\n\nconst updater = await startQuotaCacheService(60000); // Update every 60s\nupdater.start();\n\n// Later...\nupdater.stop();\n```\n\n### oh-my-opencode Integration\n\n```typescript\nimport { \n  createOhMyOpenCodeIntegration,\n  QuotaManager \n} from 'opencode-antigravity-autopilot';\n\nconst manager = new QuotaManager();\nawait manager.initialize();\n\nconst integration = createOhMyOpenCodeIntegration(manager, {\n  defaultModel: 'google/antigravity-gemini-3-flash'\n});\n\nconst model = await integration.getModelForAgent('oracle');\nconsole.log(`Oracle will use: ${model}`);\n```\n\n## 🐛 Troubleshooting\n\n### Tools Not Showing Up\n\n```bash\n# Verify plugin is installed\nnpm list opencode-antigravity-autopilot\n\n# Check OpenCode config\ncat ~/.config/opencode/opencode.json\n```\n\n### Quota Check Fails\n\n```bash\n# Verify authentication\ncat ~/.config/opencode/antigravity-accounts.json\n\n# Test manually\nnode -e \"const {QuotaManager} = require('opencode-antigravity-autopilot'); const m = new QuotaManager(); m.initialize().then(() =\u003e m.getQuotaViaApi().then());\"\n```\n\n### Model Switch Not Working\n\n```bash\n# Test hard limit detector\nnpm run test:quota\n```\n\n## 📝 Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for release history.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nMIT © [gooseware](https://github.com/gooseware)\n\n## 🙏 Credits\n\nBuilt on top of:\n- [opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) by [@NoeFabris](https://github.com/NoeFabris)\n- [OpenCode](https://github.com/opencode-ai/opencode)\n\n## 📚 Related Projects\n\n- [opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) - Authentication for Antigravity\n- [opencode-antigravity-quota](https://github.com/gooseware/opencode-antigravity-quota) - Standalone quota checker\n- [oh-my-opencode](https://github.com/opencode-ai/oh-my-opencode) - Enhanced OpenCode experience\n\n## 💬 Support\n\n- [GitHub Issues](https://github.com/gooseware/opencode-antigravity-autopilot/issues)\n- [Discussions](https://github.com/gooseware/opencode-antigravity-autopilot/discussions)\n\n---\n\n**Made with ❤️ for the OpenCode community**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooseware%2Fopencode-antigravity-autopilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooseware%2Fopencode-antigravity-autopilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooseware%2Fopencode-antigravity-autopilot/lists"}