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

oc-quota

v0.1.3

Published

OpenCode plugin + CLI for querying Z.AI GLM, GitHub Copilot, Kimi, Neuralwatt, Kiro, and Ollama Cloud usage

Readme

oc-quota

Note: This plugin is designed for personal use only by the author. It may not be maintained or suitable for general use.

OpenCode plugin + CLI for querying usage quotas from multiple AI coding assistants.

Features

  • GitHub Copilot - Check chat, completions, and premium interactions quotas
  • Z.AI (GLM) - Monitor token and time-based usage limits
  • Neuralwatt - View credit balance, energy usage, and subscription status
  • Kiro - Track credits, free trial, and subscription limits (via kiro-cli DB)
  • Ollama Cloud - Monitor session and weekly usage (via Firefox cookies)

Works as both an OpenCode plugin (automatic quota checks on session events) and a standalone CLI (manual queries).

Note: Distributed as TypeScript files - requires Bun runtime (which can execute .ts files directly without transpilation).

Installation

As a standalone CLI

bun install -g oc-quota

This installs the oc-quota binary to ~/.bun/bin/oc-quota. Bun executes the TypeScript files directly without requiring a build step.

As an OpenCode plugin

Add to your OpenCode project dependencies:

bun add oc-quota

Then register the plugin in your OpenCode configuration.

Usage

CLI Mode

Query quotas directly from the command line:

# Check GitHub Copilot quota
oc-quota copilot

# Check Z.AI (GLM) quota
oc-quota zai

# Check Neuralwatt quota
oc-quota neuralwatt

# Check Kiro quota (reads from kiro-cli DB)
oc-quota kiro

# Check Ollama Cloud quota (reads Firefox cookies)
oc-quota ollama

# Interactive provider search/selection (when omitted)
oc-quota

When no provider is passed and the terminal is interactive, oc-quota opens a searchable provider picker.

Output example:

🤖 GitHub Copilot
6.7% used (280 / 300)
♻️ Apr 1, 2026, 12:00 AM (20d 9h 52m 45s)

Ollama Cloud browser flag:

By default, oc-quota reads cookies from Firefox. Use --browser to specify a different browser (only Firefox is currently supported):

oc-quota ollama --browser firefox

OpenCode Plugin Mode

The plugin automatically monitors your coding sessions and displays quota information via toast notifications when:

  • A session becomes idle
  • A session is compacted

Configuration

Auth JSON

The plugin reads credentials from OpenCode's ~/.local/share/opencode/auth.json:

{
	"zai-coding-plan": {
		"key": "your-zai-api-key"
	},
	"github-copilot": {
		"access": "your-copilot-access-token",
		"refresh": "your-copilot-refresh-token"
	},
	"neuralwatt": {
		"key": "sk-your-neuralwatt-api-key"
	},
	"kiro": {
		"key": "ksk-your-kiro-api-key"
	},
	"ollama-cloud": {
		"key": "your-ollama-cloud-api-key"
	}
}

Kiro Authentication

Kiro does not use the API key from auth.json. Instead, it reads OAuth tokens directly from the kiro-cli SQLite database at ~/.local/share/kiro-cli/data.sqlite3. Ensure you are logged in via kiro-cli before using this provider.

Ollama Cloud Authentication

Ollama Cloud does not use an API key. Instead, it reads session cookies from your Firefox profile (~/.mozilla/firefox/*.default-release/cookies.sqlite). You must be logged into ollama.com/settings in Firefox for this to work.

Provider Details

GitHub Copilot

  • Endpoint: https://api.github.com/copilot_internal/user
  • Auth: auth.json access/refresh tokens
  • Metrics: Chat, Completions, Premium Interactions
  • Reset: Monthly (resets on the 1st)
  • Note: Educational accounts may have unlimited access for some features

Z.AI (GLM)

  • Endpoint: https://api.z.ai/api/monitor/usage/quota/limit
  • Auth: auth.json API key
  • Metrics: Token limits, Time limits
  • Reset: Periodic (varies by plan level)
  • Plan Levels: lite, standard, premium

Neuralwatt

  • Endpoint: https://api.neuralwatt.com/v1/quota
  • Auth: auth.json API key (Bearer token)
  • Metrics: Credit balance, monthly usage (cost, requests, tokens), energy (kWh)
  • Reset: Billing period (monthly)
  • Rate Limit: 1 request per second

Kiro

  • Endpoint: https://q.us-east-1.amazonaws.com/getUsageLimits
  • Auth: OAuth token refreshed via kiro-cli DB
  • Metrics: Credits (used/limit), free trial bonus
  • Reset: Periodic (per credit breakdown)
  • Note: Requires kiro-cli installed and logged in

Ollama Cloud

  • Endpoint: https://ollama.com/settings (HTML scraping)
  • Auth: Firefox session cookies
  • Metrics: Session usage (5h window), Weekly usage (7d window)
  • Reset: Session (5 hours), Weekly (7 days)
  • Note: Requires Firefox with active ollama.com login

API

Plugin Function

import { QuotaPlugin } from 'oc-quota'

export default QuotaPlugin

The plugin subscribes to:

  • session.idle - Shows quota when session is idle
  • session.compacted - Shows quota after compaction
  • chat.message - Tracks provider from model changes

Development

# Install dependencies
bun install

# Type check
bun run check

# Format code
bun run fmt

# Run CLI directly
bun run quota.ts copilot
bun run quota.ts zai
bun run quota.ts neuralwatt
bun run quota.ts kiro
bun run quota.ts ollama

# Interactive mode
bun run quota.ts

License

MIT

Author

Umar Alfarouk

Repository

https://github.com/mdrv/oc-quota