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

@juanbenjumea/pi-multi-opencode-go

v0.1.3

Published

Multi-account failover and rotation for the OpenCode Go provider in Pi.

Readme

@juanbenjumea/pi-multi-opencode-go

Multi-account failover for Pi’s opencode-go provider. Rotates API keys using live dashboard usage (rolling / weekly / monthly), overrides Authorization per request, and persists cooldowns when limits hit.

Inspired by pi-multicodex and pi-multi-account, but built for OpenCode Go workspace auth.

Dashboard HTML parsing lives in @juanbenjumea/opencode-go-usage (shared with @juanbenjumea/pi-dynamic-footer).

Install

pi install npm:@juanbenjumea/pi-multi-opencode-go
/reload

From this monorepo (before publishing):

# settings.json packages entry (relative to pi/agent/settings.json):
# "../packages/pi-multi-opencode-go"
pi -e /path/to/dotfiles/pi/packages/pi-multi-opencode-go

Requirements

  • Node 20+
  • @earendil-works/pi-coding-agent ≥ 0.80
  • A primary opencode-go API key in auth.json (or env) so Pi passes its auth check; this extension overrides the header on each request.

Recommended in settings.json:

{
  "retry": {
    "provider": { "maxRetries": 0 }
  }
}

Configure accounts

Environment (up to 8 slots):

export OPENCODE_API_KEY_1="oc_..."
export OPENCODE_GO_WORKSPACE_ID_1="wrk_..."
export OPENCODE_GO_AUTH_COOKIE_1="Fe26.2**..."
export OPENCODE_GO_LABEL_1="sub-1"

~/.pi/agent/auth.json:

{
  "opencode-go-failover": {
    "accounts": [
      {
        "label": "sub-1",
        "key": "$OPENCODE_API_KEY_1",
        "workspaceId": "$OPENCODE_GO_WORKSPACE_ID_1",
        "authCookie": "$OPENCODE_GO_AUTH_COOKIE_1"
      }
    ]
  }
}

If workspaceId / authCookie are omitted on an account, the extension falls back to quota-status.opencode-go (same shape as @juanbenjumea/pi-dynamic-footer).

Values support $ENV, $$literal, and !command (shell — use only if you trust your config).

Commands

| Command | Description | |---------|-------------| | /opencode-accounts | Usage for all accounts | | /opencode-rotate | Manual rotation | | /opencode-failover | Status summary | | /opencode-failover reset | Clear cooldowns |

Companion extensions

Sets globals for footers and slot ladders:

  • __opencode_go_active_label — active account label
  • __opencode_go_has_fallback — another non-cooled account exists
  • __opencode_go_all_exhausted — every account on cooldown

State: ~/.pi/agent/opencode-go-failover-state.json (mode 0600).
Debug log: ~/.pi/agent/opencode-go-failover.log (labels only, no secrets).

Security

This extension reads OAuth-style cookies and API keys from your agent directory. Review the source before installing. Do not commit auth.json or state files.

Publish

cd pi/packages/pi-multi-opencode-go
npm publish --access public

Then switch settings.json to npm:@juanbenjumea/[email protected].

License

MIT