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

@335g/pi-answer

v0.0.2

Published

Extract questions from the last assistant message and answer them in an interactive Q&A TUI.

Readme

pi-answer

日本語

Extract questions from the last assistant message and answer them in an interactive Q&A TUI.

Port of mitsuhiko/agent-stuff answer.ts.

Install

pi install npm:@335g/pi-answer

pi install writes to the user settings (~/.pi/agent/settings.json). Add -l to write to the project settings (.pi/settings.json) instead.

Usage

  • /answer — extract questions from the last assistant message
  • /answer 2 — extract from the assistant message before that (3, 4, ... go further back)
  • ctrl+. — same as /answer

Flow: questions are extracted with the configured extraction model (the session model by default), shown one at a time in a box, followed by a free-space step for notes, then reviewed as a whole, then submitted as one message that triggers a turn.

Keys:

  • Answering: Tab/Enter next, Shift+Tab prev, Shift+Enter newline, 1-9 insert an option, Ctrl+X exclude the question, Esc cancel
  • Review: Enter/y submit, Esc/n back to the first question, l to the last question
  • Cancel dialog: Enter/y discard, Esc/n keep editing. The dialog only appears when something has been entered; with empty answers Esc discards immediately.

The extraction model may attach options (2-4 short answers) to a question. They are listed under it and inserted at the cursor with 1-9, but only while the answer is empty, so digits stay typeable and you can append an annotation after picking one (はい -> はい、ただし本番のみ). Ctrl+X drops the question; it is not added to the message and the remaining questions are renumbered.

Configuration

pi-answer.json, read on every /answer, so no restart is needed. A project file overrides the global one key by key, and is only read for trusted projects (ctx.isProjectTrusted()):

| Location | Scope | |----------|-------| | ~/.pi/agent/pi-answer.json | global | | .pi/pi-answer.json | project |

{ "lang": "ja_JP.UTF-8", "model": "anthropic/claude-haiku-4-5" }
  • lang — locale in the same format as LANG (e.g. ja_JP.UTF-8); only the language prefix matters. Unset: LC_ALL, then LANG.
  • model — extraction model as provider/modelId or bare modelId. Unset: the session model. If it matches no available model, a warning is shown and the session model is used.

Submitted text is a numbered markdown block (### Q1: ... / Context: ... / Answer: ...), followed by a ### Notes section when the free-space step has text. Unanswered questions are omitted from the message, so a gap in the numbering means "skipped". If nothing was answered and no notes were written, nothing is sent (No answers to submit). The review screen is that message verbatim — the same string is rendered and sent, with no truncation and no placeholder lines.

The wrapper forwards TUI focus to the inner editor so the editor emits CURSOR_MARKER. That keeps the IME preedit (unconverted Japanese input) on the answer line instead of at the bottom of the box.