pi-opencode-go-limits

Pi extension that shows the OpenCode Go monthly usage limit for the selected model in the footer status line

Packages

Package details

extension

Install pi-opencode-go-limits from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-opencode-go-limits
Package
pi-opencode-go-limits
Version
0.1.0
Published
Aug 15, 2026
Downloads
163/mo · 18/wk
Author
ipmanlk
License
MIT
Types
extension
Size
29.6 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-opencode-go-limits

A Pi extension that shows the OpenCode Go monthly usage limit for the currently selected model in the footer status line — right next to the model name and token/cost stats:

~ (main) • my-session
↑123k ↓45k R678k CH88.5% $0.123 45%/1M   (opencode-go) deepseek-v4-flash • high
◈ $60/mo

The ◈ $60/mo bit (accent-colored diamond + monthly dollar limit) is added by this extension. It tells you how much usage is included with the selected model per month before OpenCode Go blocks requests:

  • Most models: $60/month included
  • Newer/higher-cost models (Grok 4.5, GLM-5.3, Kimi K3, DeepSeek V4 Pro, GPT 5.6 Luna, Qwen3.8 Max, MiMo V2.5 Pro): $15/month included

Install

pi install /path/to/pi-opencode-go-limits
# or, once published:
pi install npm:pi-opencode-go-limits

Restart Pi (or start a new session) and pick an OpenCode Go model with /model. The limit appears in the footer.

How it works

Limits are taken from the official docs page https://opencode.ai/docs/go/ (source: packages/web/src/content/docs/go.mdx in the anomalyco/opencode repository). The extension parses the docs' two markdown tables:

  1. Model | requests per 5 hour | requests per week | requests per month
  2. Model | Input | Output | Cached Read | Cached Write | Usage — the monthly usage included per model.

Because display names are inconsistent between the tables (e.g. MiMo-V2.5 vs MiMo V2.5) and pi's catalog (e.g. DeepSeek V4 Flash (2x usage)), model names are normalized (lowercase, non-alphanumerics stripped, parentheticals removed) and matched against the embedded doc-name index first, then pi's own model catalog so newly added models are picked up automatically.

Caching & refresh

The docs are updated from time to time, so the extension does not rely on hardcoded values:

  1. A small embedded baseline table (last captured 2026-08-15) is used instantly, so the status shows up even before any network call completes.
  2. At session start a cached copy is applied synchronously if one exists (accurate even offline).
  3. In the background, the live go.mdx is fetched when the cache is stale (TTL: 24 hours) or missing, parsed, merged into the store and written back to the cache.
  4. If the fetch fails, the last-known cached values are kept.

Cache and settings live under <pi agent dir>/opencode-go-limits/ (~/.pi/agent/opencode-go-limits/ by default):

  • cache.json — parsed limits + fetchedAt timestamp
  • settings.json — status display settings

Configure

Use /go-status to toggle the monthly limit display (interactive dialog), or set it directly:

/go-status monthly true|false
/go-status reset

Development

npm install
npm run typecheck    # type-check the extension
npm run format       # format with prettier
npm run check:parse  # fetch the live go.mdx and print the parsed limits table

License

MIT