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

opencode-websearch

v0.4.0

Published

Web search plugin for OpenCode

Readme

opencode-websearch

Web search plugin for OpenCode, inspired by Claude Code's built-in web search. Gives any OpenCode model access to real-time web results with source citations.

Supported providers

| Provider | SDK package | Search mechanism | | --------- | ------------------- | -------------------------------------------------------------------------------------------------- | | Anthropic | @ai-sdk/anthropic | web_search tool | | OpenAI | @ai-sdk/openai | Responses API web search |

Install

Add the plugin to your opencode.json:

{
  "plugin": ["opencode-websearch"]
}

OpenCode will install it automatically at startup.

Configuration (optional)

No configuration is needed if your active chat model belongs to a supported provider. To customize which model handles web searches, tag a model with "websearch": "auto" or "websearch": "always".

Model selection

The plugin chooses which model to use for each search:

| Priority | Condition | Behavior | | -------- | ---------------------------------------------- | ------------------------------------------------------------------------- | | 1 | A model is tagged "always" | That model is always used, regardless of what you're chatting with | | 2 | Your active chat model is a supported provider | The active model is used directly -- no extra configuration needed | | 3 | A model is tagged "auto" | That model is used as a fallback when the active model is unsupported | | 4 | None of the above | An error is returned |

"auto" mode (recommended)

Use "auto" when you want web search to work seamlessly regardless of your active model. When your active model belongs to a supported provider, it's used directly; otherwise the tagged model kicks in as a fallback.

{
  "provider": {
    "anthropic": {
      "models": {
        "claude-sonnet-4-5": {
          "options": {
            "websearch": "auto"
          }
        }
      }
    }
  }
}

"always" mode

Use "always" to lock web search to a specific model, regardless of what you're chatting with.

{
  "provider": {
    "openai": {
      "models": {
        "gpt-5.2": {
          "options": {
            "websearch": "always"
          }
        }
      }
    }
  }
}

Development

Local Development

To develop or customize the plugin locally, clone the repo and symlink the source entry point into your OpenCode plugin directory:

git clone https://github.com/emilsvennesson/opencode-websearch ~/.config/opencode/opencode-websearch
cd ~/.config/opencode/opencode-websearch
bun install
mkdir -p ~/.config/opencode/plugin
ln -sf ~/.config/opencode/opencode-websearch/src/index.ts ~/.config/opencode/plugin/websearch.ts

OpenCode will load the plugin directly from source on startup. Any edits to the files in src/ take effect next time you start OpenCode.

Note: When using the symlink approach, remove "opencode-websearch" from the plugin array in your opencode.json to avoid loading the plugin twice.

Commands

bun install            # install dependencies
bun run format         # auto-format source files
bun run format:check   # verify formatting (no changes)
bun run lint           # run oxlint
bun run lint:fix       # auto-fix lint issues
bun run typecheck      # type check with tsc
bun run check          # format:check + lint + typecheck (full quality gate)
bun run build          # ESM bundle + declaration files → dist/

License

MIT