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-question-tool

v0.1.1

Published

Interactive question and questionnaire tools for the pi coding agent — ask the user single or multiple questions with option lists and free-text input via custom TUI.

Readme

pi-question-tool

npm · source

Interactive question and questionnaire tools for the pi coding agent.

Adds two tools the model can call when it needs structured input from you:

  • question — ask a single question with a list of options (plus a free-text "Type something." fallback).
  • questionnaire — ask one or more questions. A single question shows a plain option list; multiple questions show a tab bar for navigating between them, then a summary submit screen.

Each tool renders a full-screen custom TUI. Answers are returned to the model as tool results, so the agent can act on your choices.

The implementation is adapted from the official pi extension examples (question.ts and questionnaire.ts) and bundled as an installable pi package.

Install

pi install npm:pi-question-tool

Or add it manually to ~/.pi/agent/settings.json:

{
  "packages": ["npm:pi-question-tool"]
}

To try it without installing:

git clone https://github.com/SakikoTogawa233/pi-question-tool.git
pi -e ./pi-question-tool/extensions/index.ts

Tools

question

Ask one question and let the user pick an option (or type a free-text answer).

Parameters:

| Field | Type | Description | |---|---|---| | question | string | The question to ask | | options | Array<{ label, description? }> | Options to choose from |

The option list always ends with a Type something. entry so the user can answer outside the offered options. Keys: ↑↓ navigate · Enter select · Esc cancel (back from the editor, or cancel the whole question).

questionnaire

Ask one or more questions.

Parameters:

| Field | Type | Description | |---|---|---| | questions | Array<Question> | Questions to ask |

Each Question:

| Field | Type | Description | |---|---|---| | id | string | Unique identifier for this question | | label | string? | Short tab label (defaults to Q1, Q2, …) | | prompt | string | The full question text | | options | Array<{ value, label, description? }> | Available options | | allowOther | boolean? | Allow the Type something. option (default true) |

For a single question it behaves like question. For multiple questions a tab bar appears at the top with a Submit tab. Keys: Tab/←→ navigate questions · ↑↓ select an option · Enter confirm · Esc cancel. Selecting an option auto-advances to the next question; the Submit tab lists every answer and requires all questions answered before submitting.

Result details

Both tools attach a structured details object to the tool result in addition to the human-readable content, so other extensions or renderers can inspect the answers:

  • question → { question, options: string[], answer: string | null, wasCustom? }
  • questionnaire → { questions, answers: Array<{ id, value, label, wasCustom, index? }>, cancelled }

Develop

No build step — pi loads TypeScript extensions directly.

npm install         # dev deps (typescript, pi types, pi-tui types)
npm run typecheck   # tsc --noEmit
pi -e ./extensions/index.ts   # run pi with your working copy

CI/CD

.github/workflows/release.yml publishes to npm on a v* tag push using the NPM_TOKEN repository secret, and publishes a canary prerelease on every push to main. .github/workflows/ci.yml runs the typecheck on every push and pull request.

Requirements

  • pi coding agent (tested with >= 0.83)
  • Node 20+ (pi's own requirement)
  • An interactive TTY (the tools require TUI mode; in print/RPC/JSON mode they return an error result instead of prompting)

License

MIT