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

@steimerbyte/pi-bsearch

v0.2.1

Published

Brave Search API (LLM Context + Web) as pi tool extension. Wraps @steimerbyte/bsearch-cli with smart settings.json API key handling.

Readme

pi-bsearch

Brave Search API as a pi tool extension. Wraps @steimerbyte/bsearch-cli and exposes two modes to the LLM:

  • mode="llm" (default) — pre-extracted LLM Context from Brave, optimized for AI/RAG pipelines.
  • mode="web" — classic web search with links + descriptions.

Install

pi install npm:@steimerbyte/pi-bsearch
omp plugin install npm:@steimerbyte/pi-bsearch

@steimerbyte/bsearch-cli is declared as a dependency, so the bsearch CLI is fetched and installed alongside the extension automatically.

Configuration

Add a bsearch block to ~/.pi/agent/settings.json:

{
  "bsearch": {
    "apiKey": "BSA...",
    "defaultMode": "llm",
    "defaultMaxUrls": 20
  }
}

The API key is resolved in this order at every tool call:

  1. settings.json → bsearch.apiKey (user-curated, wins)
  2. process.env.BRAVE_API_KEY
  3. ~/.bsearch-env (bsearch-cli's own env file — read for consistency)
  4. Interactive prompt (persisted back to settings.json)

Get a key at https://api.search.brave.com/app/keys.

Compatibility

Built for @earendil-works/pi-coding-agent (upstream pi). omp (@oh-my-pi/pi-coding-agent v18.1.2) is supported via its legacy @earendil-works/* shim, so the same package is loaded through both hosts without declaring omp as a peer dependency.

Tool

The extension registers a single bsearch tool. Schema:

| Parameter | Type | Description | |---|---|---| | query | string (required) | Search query | | mode | "llm" | "web" | Search mode (default: llm) | | count | int 1–50 | Number of web results | | freshness | "pd" | "pw" | "pm" | "py" | Freshness filter | | max_tokens | int 1024–32768 | Max tokens in LLM context | | max_urls | int 1–50 | Max URLs in response | | threshold | "strict" | "balanced" | "lenient" | "disabled" | Relevance threshold | | safesearch | "off" | "moderate" | "strict" | SafeSearch (web mode) | | country | 2-letter code | Country code | | city | string | City name | | local | boolean | Force local/POI recall | | compact | boolean | Compact output | | timeout | int 1000–120000 | Request timeout in ms |

Output is truncated to 50 KB / 2000 lines (whichever comes first). When truncated, the full output is saved to a temp file and the path is appended to the result.

Slash command

/bsearch              Show current settings
/bsearch reload       Re-read settings.json from disk
/bsearch clear-key    Remove bsearch.apiKey from settings.json

Release

Bump version and publish:

npm version <patch|minor|major>
git push --follow-tags origin main

npm version updates package.json, creates a vX.Y.Z tag, and runs prepublishOnly (typecheck) before publishing. The publish workflow at .github/workflows/publish.yml triggers on v* tag push.

For a dry run before tagging: npm run release runs the typecheck.

Development

# Run with a local check-out
pi -e ./extensions/bsearch.ts

# Or install from a local path
pi install ./pi-bsearch

License

MIT