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

pi-gitnexus

v0.4.0

Published

GitNexus knowledge graph integration for pi — enriches searches with call chains, execution flows, and blast radius

Downloads

394

Readme

pi-gitnexus

GitNexus knowledge graph integration for pi. Enriches every search, file read, and symbol lookup with call chains, callers/callees, and execution flows — automatically.

https://github.com/user-attachments/assets/49e61667-f508-4d22-abad-05241e414664

The graph view in the demo is from gitnexus-web and is not part of this extension.

What it does

When the agent reads a file or runs a search (grep, find, bash, read_many), the extension appends graph context from the knowledge graph inline with the results. The agent sees both together and can follow call chains without additional queries.

Agent reads auth/session.ts
  → file content returned normally
  → [GitNexus] appended: callers of the module, what it imports, related tests

Agent runs grep("validateUser")
  → grep results returned normally
  → [GitNexus] appended: Called by: login, signup / Calls: checkPermissions, getUser
  → filenames in the grep output are also looked up in parallel

Agent calls read_many([api.ts, db.ts, router.ts])
  → file contents returned normally
  → [GitNexus] appended with per-file labeled sections:
      ### api.ts
      <call graph context for api>
      ### db.ts
      <call graph context for db>

Five tools are also registered directly in pi — the agent can use them explicitly for deeper analysis without any setup.

Requirements

  • gitnexus available as gitnexus on PATH (e.g. npm i -g gitnexus)
  • A GitNexus index in your project: run /gitnexus analyze

The extension never installs anything automatically. It assumes gitnexus is on PATH. If your setup differs, use /gitnexus config to set a custom command (e.g. npx gitnexus@latest).

Getting started

  1. Install the extension: pi install npm:pi-gitnexus
  2. Install gitnexus: npm i -g gitnexus
  3. Open your project in pi
  4. Run /gitnexus analyze to build the knowledge graph
  5. Done — file reads and searches are now enriched automatically

What triggers augmentation

| Tool | Pattern used | |---|---| | grep | Search pattern (regex metacharacters stripped) | | bash with grep/rg | First non-flag argument after grep/rg | | bash with cat/head/tail | Filename of the target file | | bash with find | Value of -name/-iname | | find | Glob pattern basename | | read | Filename of the file being read (code files only) | | read_many | Each code file in the batch (up to 5), labeled per-file in output | | Any grep/bash result | Filenames extracted from result lines (path/file.ts:line:) |

Each tool result augments up to 3 patterns in parallel (up to 5 for read_many). Patterns already augmented this session are skipped.

Commands

| Command | Description | |---|---| | /gitnexus | Show index status and session enrichment count | | /gitnexus analyze | Build or rebuild the knowledge graph | | /gitnexus on / /gitnexus off | Enable/disable auto-augment (tools unaffected) | | /gitnexus config | Set the gitnexus command (saved to ~/.pi/pi-gitnexus.json) | | /gitnexus <pattern> | Manual graph lookup for a symbol or pattern | | /gitnexus query <text> | Search execution flows | | /gitnexus context <name> | 360° view of a symbol: callers, callees, processes | | /gitnexus impact <name> | Upstream blast radius of a change | | /gitnexus help | Show command reference |

Agent tools

The following tools are registered in pi and always available to the agent:

| Tool | Description | |---|---| | gitnexus_list_repos | List all indexed repositories | | gitnexus_query | Search the knowledge graph for execution flows | | gitnexus_context | 360° view of a symbol: callers, callees, processes | | gitnexus_impact | Blast radius analysis for a symbol | | gitnexus_detect_changes | Map a git diff to affected execution flows |

How it works

Auto-augment hook — fires after every grep/find/bash/read/read_many tool result. For standard tools, extracts up to 3 patterns (primary from input, secondary filenames from result content) and calls gitnexus augment for each in parallel. Results are merged into a single [GitNexus: <pattern>] block appended to the tool result. For read_many, each file in the batch gets its own labeled section so the agent knows exactly which context belongs to which file.

Session dedup cache — each symbol or filename is augmented at most once per session. Prevents redundant lookups when the agent repeatedly searches for the same thing.

MCP client — tools (query, context, impact, detect_changes, list_repos) communicate with gitnexus mcp over a stdio pipe. The process is spawned lazily on the first tool call and kept alive for the session. No network socket, no port.

Session lifecycle — on session start/switch, the extension resolves the full shell PATH (picking up nvm/fnm/volta), probes the binary, checks for an index, and notifies accordingly. The MCP process is restarted with the new working directory.

Auto-augment toggle/gitnexus off disables the hook without affecting tools. Useful when the graph output is noisy for a particular task. Resets to enabled on session switch.

Analyze guard — auto-augment is paused during /gitnexus analyze to avoid injecting stale or partially-built index results.

License note

This extension (pi-gitnexus) is MIT licensed. GitNexus itself is published under the PolyForm Noncommercial License — commercial use requires a separate agreement with its author. Install and use gitnexus in accordance with its license terms.

Notes

  • The extension never runs gitnexus analyze automatically — indexing is always user-initiated via /gitnexus analyze.
  • The index is a static snapshot. Re-run /gitnexus analyze after significant code changes. The agent will suggest this when the index appears stale.
  • gitnexus_detect_changes is a lightweight alternative: pass git diff HEAD output to see affected flows without a full reindex.
  • gitnexus_cypher and gitnexus_rename are intentionally not exposed (raw graph access and automated multi-file rename).
  • The enrichment is appended to the tool result the agent receives — files on disk and raw tool outputs are never modified.