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

@coool/opencode-custom-provider

v0.1.8

Published

OpenCode plugin: register custom OpenAI-compatible providers at runtime, keep their API keys in the safe store, and auto-load their model inventory from /v1/models.

Downloads

1,004

Readme

@coool/opencode-custom-provider

Connect any OpenAI-compatible API to OpenCode — no config files, no env vars. API keys go into OpenCode's built-in secret store; the models show up in the TUI's /models picker like any built-in provider.

Install

opencode plugin add @coool/opencode-custom-provider

Usage

In the TUI, run /custom-provider, pick "Add new provider", and answer three prompts: name, base URL, API key (empty = endpoint needs no key). The plugin calls <base URL>/models and registers what it finds, with model ids kept verbatim (vendor prefixes like openai/gpt-4o included) — from then on, pick your models in the built-in /models dialog like any other provider. The base URL is used as-is, so include the version segment: https://api.example.com/v1 fetches https://api.example.com/v1/models.

In the web UI and other clients, the same flows exist as commands:

/web-custom-provider                                                   → list
/web-custom-provider add id=<id> name=<Name> base=<url> [key=<key>]
/web-custom-provider edit id=<id> [name=<Name>] [base=<url>]
/web-custom-provider remove id=<id>

Values with spaces need double quotes. The id can't be changed later. A bad URL or wrong key aborts add with the endpoint's error — nothing gets saved.

Rotate keys with the built-in /connect — your custom provider appears there like a native one.

Good to know

  • The model inventory is fetched only when you add, edit the base URL, or refresh — the plugin never polls your endpoint. If a refresh fails, the last-known inventory stays and the provider is flagged in the list until it recovers.
  • Removing a provider keeps its key in the secret store (the plugin API can't delete credentials). The /connect entry stays so you can delete the account there; the plugin reminds you when it happens.
  • Models are registered with OpenCode's default assumptions: tools, text and image input, 200k context, 32k output. No per-model configuration in v1.

Development

npm install
npm run typecheck    # tsc --noEmit
npm test             # vitest with a 100% coverage gate
npm run e2e          # server API, driven against a real opencode serve
npm run e2e:tui      # the TUI dialogs, driven via termwright

Both e2e layers spawn real OpenCode processes against an in-process mock endpoint, inside a throwaway sandbox — your installation is never touched.

License

MIT