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

@arvoretech/pi-codebase-index

v0.1.6

Published

PI extension for semantic codebase search (vendor-neutral backend contract)

Readme

@arvoretech/pi-codebase-index

A Pi extension that gives the agent semantic code search across your repositories. Ask for code by concept ("where is subscription renewal handled") and get ranked results across every repo, even when you don't know the exact symbol name.

The extension is vendor-neutral: it talks to a backend over a small HTTP contract (see PROTOCOL.md / openapi.yaml). You bring the backend — use the runnable reference-backend/ or implement the contract on your own infrastructure. The choice of vector store (Qdrant, pgvector, Pinecone, ...) and embedding model lives entirely in the backend.

How it works

  1. On session start the extension scans the git repos in your workspace and computes a content hash per file (a Merkle root per repo).
  2. It sends those hashes to the backend's /sync, which returns only the files that changed since the last index. A newly added repo returns all its files, so new repos index automatically.
  3. Changed files are chunked and sent to /index in the background — the backend embeds and stores them. A status widget shows progress. Chunking is AST-aware (via tree-sitter) for the languages it recognizes, so each chunk maps to a real function/class/method and carries its actual symbol name; files in unsupported languages fall back to fixed-size line windows.
  4. The agent calls the search_codebase tool, which hits /search and returns ranked snippets with file paths and line numbers.

Install

pnpm add @arvoretech/pi-codebase-index

Set your backend URL and authenticate inside Pi:

export PI_CODEBASE_API_URL="https://your-backend.example.com/api"
/codebase-login

That's it — sync runs automatically from then on.

Commands

| Command | What it does | |---|---| | /codebase-login | Authenticate with the backend | | /codebase-logout | Clear credentials | | /codebase-search <query> | Manual search (debugging) | | /codebase-reindex | Force a fresh sync of the workspace | | /codebase-hide | Hide the status widget (sync keeps running) | | /codebase-show | Show the status widget again |

Configuration

| Env var | Required | Default | Purpose | |---|---|---|---| | PI_CODEBASE_API_URL | no | — | Base URL of a backend implementing the protocol | | PI_CODEBASE_AUTH_PROVIDER | no | github | Auth provider segment in the /auth/<provider>/... routes |

When unset, PI_CODEBASE_API_URL falls back to a built-in default so the extension works out of the box for its primary deployment. Override it to run against your own infrastructure — the package itself is free of any single company's backend.

Running your own backend

See SETUP.md. The short version: start a Qdrant instance and run the service in reference-backend/ (npm install && npm run build && npm start). Swap the vector store or embedder by implementing the VectorStore / Embedder interfaces in reference-backend/src/ports.ts.

License

MIT