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

@haphazarddev/pi-interactive-code-review

v0.2.0

Published

A pi extension for interactive code review against your default branch, including uncommitted changes, with line or hunk comments, batching, and inline agent responses.

Readme

@haphazarddev/pi-interactive-code-review

Review your current branch and working tree like a pull request, directly inside pi.

It opens an interactive diff browser against your default branch, lets you move file by file and hunk by hunk, toggle word wrap for long diff lines, open a searchable changed-file list with per-file +/- summaries, attach review comments to lines, hunks, or whole files, and then either batch those comments or send them to the agent immediately.

When the agent replies, the extension stores the response on the matching review thread so you can reopen the review UI and follow the conversation inline with the diff.

Install

pi install npm:@haphazarddev/pi-interactive-code-review

Or from a local checkout:

pi install ./extensions/pi-interactive-code-review

Usage

Open the review UI:

/review

Optionally review against a specific ref instead of the detected default branch:

/review origin/main
/review main
/review --base origin/main

Review a child repository or another repository path from your current working directory:

/review --repo repos/test-repo
/review --repo repos/test-repo --base origin/main

A single bare argument that points to a git repository directory is treated as the review target; otherwise it is treated as the base ref.

When /review discovers exactly one dirty candidate repo under the current working directory, it opens that repo automatically. When multiple dirty repos are discovered, it asks you to select the review target. File paths in the diff and in review prompts are relative to the selected repo root. Clean child repos are hidden by default; use /review --include-clean to force the picker and include them. Use /review --scan-depth <n> to override the default child repo scan depth of 3. Use /review --current to force the innermost/current repo when pi is running inside a nested repo.

If a child repo cannot be opened, check that the path exists, contains a .git directory or file, and has a resolvable base ref such as origin/main.

Controls

Inside the review UI, press ? to show the full control reference in the lower section.

Movement

  • Tab / Shift+Tab - next/previous changed file
  • [ - previous hunk, automatically moving to the previous file when you're already at the first hunk
  • ] - next hunk, automatically moving to the next file when you're already at the last hunk
  • / - move through lines, automatically crossing into the previous/next hunk or file at the boundaries

Extra shortcuts shown in ? help

  • n / p - next/previous changed file when diff search is not active
  • j / k - move through lines, automatically crossing hunk and file boundaries
  • d / u or Ctrl+D / Ctrl+U - move down/up half a page, including across adjacent hunks and files

Actions

  • / - search within the current file diff
  • g - open the changed-file picker with fuzzy filename matching and per-file summaries
  • c - start an inline line comment or question
  • H - start an inline hunk comment or question
  • F - start an inline file-level comment or question
  • 1-4 or e - edit a visible comment thread inline
  • x or Backspace - delete a visible comment thread
  • s - send all queued review comments as one batch
  • r - refresh the diff against the current base ref
  • w - toggle word wrap in the diff viewer
  • ? - toggle help
  • F1 / Alt+H - toggle help, including while a text input is focused
  • Esc / q - close

While the file picker is open:

  • type to fuzzy-match changed files by filename only
  • matched characters are highlighted in the picker
  • typing resets selection to the top-ranked result
  • / - move the selected match while keeping focus in the filter input
  • Ctrl+N / Ctrl+P - alternate next/previous match keys
  • Enter - jump to the selected file
  • F1 / Alt+H - toggle help without leaving the filter input
  • Esc - close the picker

While diff search is open:

  • type to search within the current file diff
  • visible matches are highlighted in the diff view
  • / - move between matches while keeping focus in the search input
  • Ctrl+N / Ctrl+P - alternate next/previous match keys
  • Enter - jump to the selected match and close the search input
  • Esc - close the search input and keep the current search active
  • n / N - move to the next/previous match after closing the search input
  • F1 / Alt+H - toggle help without leaving the search input

While the inline comment editor is open:

  • Enter - save the comment
  • Shift+Enter - insert a newline
  • Tab - toggle between batch and immediate send mode
  • F1 / Alt+H - toggle help without leaving the editor
  • Esc - cancel editing

Review flow

  1. Open /review
  2. Navigate through the diff file by file, use the hunk banners and Hunk x/y • ↑/↓ ... indicators to see when a file has more hunks above or below, and use the top/bottom navigation banners to see when [ / ] will continue into the previous/next file, press g to jump through a fuzzy searchable file list with +added / -removed summaries, or press / to search inside the current file diff
  3. Add comments/questions inline while still seeing the diff above the editor
  4. Use Tab in the inline editor to choose either:
    • batch to queue the thread
    • immediate to have the agent address it right away
  5. Press s when you want to send the whole queued batch
  6. Use 1-4 or e to reopen and edit visible comments
  7. Sending comments closes the review UI so pi can run the review turn cleanly
  8. Reopen /review to see agent responses attached to the relevant threads

Notes

  • The extension compares the merge-base of your review base and HEAD against your current working tree, so committed, staged, unstaged, and untracked file changes are all reviewable.
  • Default branch detection prefers origin/HEAD, then falls back to origin/main, origin/master, main, and master.
  • Review thread state is stored in the session, so queued comments and agent responses survive reloads and session switches on the same branch.
  • Agent replies are requested in a thread-tagged format so the extension can attach them back to the correct line/hunk/file thread.

Repository

  • Source: https://github.com/HaphazardDev/pi-extensions
  • Issues: https://github.com/HaphazardDev/pi-extensions/issues