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

v0.1.0

Published

Pi extension that loads GitHub security advisories into the agent context

Downloads

28

Readme

pi-ghsa

npm version license

A Pi extension that loads GitHub Security Advisories into the model context for vulnerability triage and fixes. It uses the authenticated gh CLI, so it can read draft repository advisories when your GitHub account has access.

Features

  • Automatically detects GHSA URLs and IDs in user prompts.
  • Adds /ghsa for explicitly loading an advisory into the current session.
  • Adds load_ghsa_advisory so the model can load an advisory on demand.
  • Uses the repository security-advisory API first, preserving draft-only details such as the private fork.
  • Includes the full description, PoC, affected versions, CVSS, CWEs, references, and private-fork metadata in a compact, expandable context message.
  • Frames advisory text as untrusted report data and truncates large responses before adding them to context.

Requirements

  • Node.js 22.19 or newer
  • Pi
  • GitHub CLI authenticated with access to the advisory:
gh auth status

The token normally needs repo access for private or draft repository advisories.

Install

Install the npm package globally in Pi:

pi install npm:pi-ghsa

Or install it for the current project only:

pi install -l npm:pi-ghsa

You can also load the GitHub repository directly:

pi install git:github.com/mcollina/pi-ghsa

For a quick test from a source checkout:

pi -e ./extensions/ghsa.ts

Usage

Paste an advisory URL in a prompt. The extension loads it before the model starts:

Fix https://github.com/OWNER/REPO/security/advisories/GHSA-xxxx-xxxx-xxxx

Or load it explicitly, then provide the fixing instructions in your next prompt:

/ghsa https://github.com/OWNER/REPO/security/advisories/GHSA-xxxx-xxxx-xxxx

Accepted references:

https://github.com/OWNER/REPO/security/advisories/GHSA-xxxx-xxxx-xxxx
OWNER/REPO#GHSA-xxxx-xxxx-xxxx
GHSA-xxxx-xxxx-xxxx

A bare GHSA identifier uses GitHub's public global-advisory endpoint. Draft advisories require the full repository URL or repository-qualified shorthand.

Security and privacy

The extension executes gh api as the current user. Advisory content is added to the Pi session and sent to the selected model provider as context. Review your provider's data-handling policy before loading confidential draft advisories.

If an advisory exceeds Pi's tool-output limits, the complete formatted context is written to a mode-0600 file inside a mode-0700 temporary directory and the model receives its path.

Development

git clone https://github.com/mcollina/pi-ghsa.git
cd pi-ghsa
npm install
npm run check

Before publishing:

npm pack --dry-run
npm publish

Bug reports and contributions are welcome in the GitHub repository.