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

@justsilver/opencode-providers

v0.3.5

Published

Register providers missing from the models.dev catalog in OpenCode V2 from a self-hosted registry — no opencode.json needed

Readme

opencode-providers

给 OpenCode 补上模型目录里没有的供应商:一份自维护的注册表 + 一个插件。 装完插件,在 OpenCode 内置的 /connect 里贴一次 API Key 就能用,不需要手写供应商配置。

为什么需要它

OpenCode 自带的供应商清单来自 models.dev;没有额外注册时,目录里没有的供应商不会出现在 /connect。 想用自建/网关/小众供应商,原本只能在 opencode.json 里手写 providers.<id> 加一长串模型参数。 本项目把这份数据搬到一份共享注册表里,由插件在运行期注册 —— 配置零增长,改注册表也不用改插件版本。

安装

opencode plugin add @justsilver/opencode-providers

想指向别的注册表(自建/私有):配置改成对象条目传 options,不用改源码——

{
  "plugins": [
    { "package": "@justsilver/opencode-providers", "options": { "registryUrl": "https://example.com/registry/index.json" } }
  ]
}

使用

  1. 在 OpenCode V2 的终端或 Desktop 输入框里敲 /,从菜单选 /connect。
  2. 搜索供应商名称并输入 API Key。连接后即可在模型选择器中使用该供应商的模型。
  3. 再选同一家供应商,可通过 OpenCode 的原生界面添加、激活、重命名和删除账号。

两端都使用宿主的连接界面,不需要另装 Desktop 插件。原 /connect-providers 用户改用 /connect 即可,已有账号不需要重新连接。API Key 由 OpenCode 保存,本插件不接收或存储密钥。

刷新注册表

插件会在后台检查注册表更新,上游不可用时保留已有注册。需要立即刷新时,对正在使用的 OpenCode 服务调用刷新 RPC,例如:

opencode api post /api/rpc/opencode-providers/refresh -H "x-opencode-directory: /path/to/project" -d '{"input":{}}'

把目录替换成当前会话所在目录。终端和 Desktop 如果连接的是不同服务,需要刷新对应的服务。响应中 output.ok: false 表示刷新失败,旧注册仍保留。

子代理功能已独立

原 beta 中的 /subagent-model 已迁为独立插件,providers 不再包含此功能,见迁移入口。

范围之外

  • 不做参数推断:注册表写什么就是什么,插件不会去猜 limit/cost。
  • 不调供应商 API:不访问 /v1/models,也就没有运行期的额外网络与失败面。
  • 不声明 env 认证:本插件只走 /connect-式交互;opencode 的 env 是静默旁路且不在 /connect 里展示。
  • 不改注册表来源时不需要 opencode.json 里的 providers 声明(那是另一条路线)。

疑难解答

| 现象 | 原因 / 处理 | |---|---| | /plugins 面板里本插件有一条 failed | 同一插件 id 被发现两次(例:opencode.json 里配了 npm 包,某个项目的 .opencode/plugins/ 里又放了一份;或本地绝对路径与 npm 包同时留着)。supervisor 保留首个、把后来者标成 failed,错误信息是 Duplicate plugin ID: opencode-providers。删掉多余的那份即可 | | /connect 找不到注册表中的供应商 | 确认当前 OpenCode 服务加载了插件,并在相同目录下查看 /api/plugin 的 state.status 是否为 active | | 模型选择器里看不到新供应商 | 先通过 /connect 保存 API Key;未连接的供应商不会出现在模型选择器里 |

开发与贡献

想改插件代码、维护注册表数据、或了解测试与发版流程:见 CONTRIBUTING.md。

许可

MIT