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-codesight

v0.1.1

Published

CodeSight repository-context tools for Pi.

Readme

pi-codesight

CodeSight repository-context tools for Pi.

pi-codesight gives Pi fast repo orientation from generated .codesight/ artifacts, routes, schema, env config, wiki pages, hot files, and blast radius.

Upstream analyzer: Houseofmvps/codesight

Install

pi install npm:pi-codesight

Or from git:

pi install git:github.com/anh-chu/pi-codesight

Or via npm directly:

npm install pi-codesight

Pi loads extension via package.json.pi.extensions. If new tools or slash commands do not appear, run pi update or reinstall package.

Why it exists

Big coding tasks start with discovery:

  • where routes live
  • which models exist
  • which subsystem owns file
  • what breaks if file changes
  • which env vars matter

pi-codesight reads prebuilt CodeSight artifacts first, then agent can move to symbol-level tools (pi_lsp_*, lsp_navigation) after file/symbol grounding.

Value props

  • Fast repo orientation, wiki index and subsystem docs.
  • Endpoint discovery, route filtering by prefix/tag/method.
  • Schema visibility, model/table/field/relation summaries.
  • Risk estimation, blast radius and hot-file ranking.
  • Config clarity, env variable inspection.
  • Explicit refresh/init, no hidden regeneration.

Agent tools

All tools return same envelope:

interface ToolResult {
  content: Array<{ type: 'text'; text: string }>;
  details: Record<string, unknown>;
}

details includes tool-specific metadata.

codesight_get_wiki_index

Read wiki catalog for repo orientation.

Input schema

{ directory?: string }

Output details (typical)

{ source: 'wiki/index.md'; path: string }

codesight_get_wiki_article

Read one subsystem wiki article.

Input schema

{ article: string; directory?: string }

Output details (typical)

{ article: string; source: string; path: string }

codesight_get_summary

Get compact project overview.

Input schema

{ directory?: string }

Output details (typical)

{ source: string; path: string }

codesight_get_routes

Get routes, optional filters.

Input schema

{
  directory?: string;
  prefix?: string;
  tag?: string;
  method?: string; // GET|POST|PUT|DELETE etc
}

Output details (typical)

{
  source: string;
  path: string;
  filters: { prefix?: string; tag?: string; method?: string };
  count?: number;
}

codesight_get_schema

Get full schema summary or one model view.

Input schema

{ directory?: string; model?: string }

Output details (typical)

{ source: string; path: string; model?: string }

codesight_get_blast_radius

Run blast-radius query before edits.

Input schema

{ directory?: string; file: string; depth?: number } // depth 1..20

Output details (typical)

{
  file: string;
  root: string;
  command: string;
  ok: boolean;
  exitCode?: number;
  stderr?: string;
}

codesight_get_env

Read detected environment variables.

Input schema

{ directory?: string; requiredOnly?: boolean }

Output details (typical)

{ source: string; path: string; requiredOnly: boolean; count?: number }

codesight_get_hot_files

Read highest-impact imported files.

Input schema

{ directory?: string; limit?: number } // limit 1..50

Output details (typical)

{ source: string; path: string; limit: number; count?: number }

codesight_refresh

Re-scan/regenerate CodeSight artifacts.

Input schema

{ directory?: string; wiki?: boolean; init?: boolean }

Output details

{ command: string; ok: boolean; exitCode?: number; stderr?: string }

Slash commands

Yes, extension exposes slash commands:

  • /codesight-refresh - re-scan CodeSight artifacts
  • /codesight-init - generate wiki and AI context artifacts
  • /wiki [article] - show wiki index or one article
  • /blast <file> - run blast-radius for file

After manifest/command changes, run pi update or reinstall package.

Recommended workflow

  • broad discovery -> codesight_get_summary or codesight_get_wiki_index
  • subsystem deep-dive -> codesight_get_wiki_article
  • endpoint question -> codesight_get_routes
  • model/table question -> codesight_get_schema
  • risky edit planning -> codesight_get_blast_radius + codesight_get_hot_files
  • env setup/debug -> codesight_get_env
  • stale/missing artifacts -> codesight_refresh

Then move to symbol-level tools once scope grounded.

Usage examples

What endpoints exist under /api/admin?
If I change src/auth/session.ts, what might break?
Show required env vars for this project.
Give architecture overview, then drill into database subsystem.

Artifacts

pi-codesight reads generated files under .codesight/, including:

  • .codesight/wiki/index.md
  • .codesight/wiki/*.md
  • .codesight/routes.md
  • .codesight/config.md
  • .codesight/CODESIGHT.md

If artifacts missing or stale, run refresh. For artifact generation behavior/details, see upstream CodeSight project.

Development

npm test
npm run check

License

MIT. See LICENSE.