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

@zhzy0077/opencode-copilot-cli-auth

v0.0.23

Published

Package on npm: https://www.npmjs.com/package/@zhzy0077/opencode-copilot-cli-auth

Readme

opencode-copilot-auth

Package on npm: https://www.npmjs.com/package/@zhzy0077/opencode-copilot-cli-auth

A fork of anomalyco/opencode-copilot-auth that adds native 1M token context for Claude models by routing requests through the Anthropic Messages API (/v1/messages) instead of the OpenAI-compatible /chat/completions endpoint.

How to use

Add the plugin to your opencode config:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "@zhzy0077/[email protected]"
  ]
}

Then start opencode and log in to the github-copilot provider using the device flow.

For local development before publishing, you can load the file directly:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "file:///absolute/path/to/index.mjs"
  ]
}

Note: if the file path contains opencode-copilot-auth, current opencode builds may skip loading it due to a hardcoded plugin-name filter. Use a path that does not contain that substring.

What this fork adds over upstream

1M context for Claude models

The Copilot API exposes a native Anthropic Messages endpoint at /v1/messages that accepts up to 1,000,000 tokens — far beyond the 168K hard cap on /chat/completions. This fork automatically routes all Claude model requests to that endpoint and translates the request/response format transparently.

The Copilot API metadata reports max_context_window_tokens: 200000 for most Claude models. This fork overrides those values to 1,000,000 for any model that supports /v1/messages, so opencode sends the correct window size.

Empirically verified (needle-in-haystack tests):

  • claude-opus-4.7: 350K tokens ✓, 1M tokens ✓, 1.44M tokens ✗ (confirmed 1M ceiling)
  • claude-sonnet-4.6: 302K tokens ✓ (secret retrieved correctly)

More models (20 vs upstream's baseline)

Uses the VSCode OAuth client (Iv1.b507a08c87ecfe98) and api.githubcopilot.com, which exposes 20 picker models including gemini-3.1-pro-preview, gemini-3-flash-preview, and gpt-4o that the enterprise endpoint omits.

Persistent token caching

The short-lived Copilot token (exchanged via /copilot_internal/v2/token) is written back to the opencode auth store with a 5-minute expiry buffer. When you run multiple opencode instances simultaneously, only the first one fetches a new token — the rest reuse the persisted one.

Model limits exposed to opencode

| Model | Context | Input (prompt) | Output | |----------------------|-----------:|---------------:|-------:| | claude-opus-4.7 | 1,000,000 | 1,000,000 | 32,000 | | claude-opus-4.6 | 1,000,000 | 1,000,000 | 32,000 | | claude-opus-4.6-1m | 1,000,000 | 936,000 | 64,000 | | claude-sonnet-4.6 | 1,000,000 | 1,000,000 | 32,000 | | claude-sonnet-4.5 | 1,000,000 | 1,000,000 | 32,000 | | claude-haiku-4.5 | 1,000,000 | 1,000,000 | 64,000 |

Claude thinking budget

When the thinking variant is selected, the plugin sends thinking_budget: 16000. When no variant is selected, it omits the field entirely.

Publishing

./script/publish.ts