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

@aaronmaturen/pi-context7

v1.0.1

Published

Context7 extension for pi - fetches up-to-date library documentation via context7.com

Downloads

170

Readme

pi-context7

A pi extension that brings Context7 library documentation into your coding sessions.

Instead of relying on potentially stale training data, the LLM can pull real, up-to-date documentation snippets directly from a library's official docs at query time.

How it works

The extension registers two tools that the LLM can call:

| Tool | Purpose | | -------------------- | ---------------------------------------------------------------------------------------------------------- | | resolve_library_id | Search context7.com for a library by name; returns ranked matches with IDs, trust scores, and token counts | | get_library_docs | Fetch documentation snippets for a resolved library ID, optionally focused on a topic |

Typical flow:

  1. You ask about a library (e.g. "how do I use Drizzle ORM with Postgres?")
  2. LLM calls resolve_library_id("drizzle-orm") → picks the best match
  3. LLM calls get_library_docs("/drizzle-team/drizzle-orm", { topic: "postgres" }) → gets real docs
  4. LLM answers using current, accurate documentation

Installation

Via npm (recommended)

# Global — available in all projects
pi install npm:@aaronmaturen/pi-context7

# Project-local — saved to .pi/settings.json, shared with your team
pi install -l npm:@aaronmaturen/pi-context7

Then restart pi or run /reload.

From source

# Clone and symlink globally
git clone https://github.com/aaronmaturen/pi-context7
ln -s $(pwd)/pi-context7 ~/.pi/agent/extensions/pi-context7

# Or for a quick one-off test without installing
pi -e ./src/index.ts

Usage

Just ask pi about any library — the LLM will use the tools automatically when it needs current docs:

you: how do I do server-side rendering with Next.js 15 App Router?
you: show me the zustand persist middleware API
you: what's the correct way to use Drizzle transactions?

Or be explicit:

you: use context7 to look up the latest Hono docs on routing

Configuration

No API key required — Context7 has a generous free tier (200 requests/day for anonymous use). The extension sets a X-User-Agent: pi-context7/1.0 header so usage is identifiable.

If you have a Context7 account and want to use a higher quota, the API currently uses session cookies (browser-based auth). Anonymous access is sufficient for typical development use.

Tuning token budgets

The default tokens value is 10,000. For complex topics or large APIs you can ask for more:

you: fetch 25000 tokens of the React Server Components docs from context7

The LLM will pass the appropriate tokens value to get_library_docs.

No npm dependencies

The extension uses only Node.js built-ins (fetch) and pi's own utilities. No npm install required.

Files

pi-context7/
├── README.md
├── package.json        # pi extension entry point declaration
└── src/
    └── index.ts        # Extension — two tools + session status indicator

Context7 API

  • GET https://context7.com/api/v1/search?query=<name> — search libraries
  • GET https://context7.com/api/v1/<library-id>?tokens=<n>&topic=<t> — fetch docs

See context7.com and the Context7 MCP server for more details.