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

bare-tui-paparam

v0.0.1

Published

menu/form helper for any paparam CLI

Readme

bare-tui-paparam

A menu/form helper for any paparam CLI. Your tool already describes its whole surface in paparam — flags, args, subcommands, choices, defaults, descriptions. Add one line and mytool --menu drops the user into a filterable command picker, then a real terminal form for the command they chose, and finishes by handing you a result in the exact shape paparam's parse() returns.

   mytool --menu
        │
        ▼
   ┌──────────────┐   pick a command   ┌───────────────┐
   │  command     │ ─────────────────▶ │ bare-tui-form │ ──▶ fill it in
   │  picker      │                    │  (hardened)   │
   │ (filterable) │                    └───────────────┘
   └──────────────┘                            │
                                               ▼
              cmd.parse(argv, { run:false })   ← paparam validates; no runner fires
                      │
                      ▼
        onComplete(result, { argv })   ← result is paparam's parse() shape

The forms are generated from your real flag/arg metadata (a flag with .choices() becomes a picker, a boolean becomes a checkbox, defaults are prefilled, repeatables become editable lists). The argv it assembles is run through your own command with { run: false } — so paparam itself validates it (unknown flag, missing arg, bad choice, your own validate() checks) and yields the canonical result without executing your runner until you say so.

Built on bare-tui and bare-tui-form (forms from JSON Schema, rendered through its hardening).

Want AI assist?

Install the optional bare-tui-paparam-ai package. It re-exports everything here and adds:

  • --find — type your goal in plain language; one AI call routes it to the right command, then shows that command's form.
  • --hi — full agentic assist: the model curates which fields to ask and drip-feeds questions.
  • AI-backed in-form help — press F1 / ctrl+k mid-form to ask a question.

Upgrading is a one-line import change — your --menu / runMenu code keeps working unchanged:

// before — no network
const { isMenuMode, runMenu } = require('bare-tui-paparam')
// after — AI tiers light up; menu code is untouched
const { isMenuMode, runMenu, isInteractiveHelp, runWithConfirm } = require('bare-tui-paparam-ai')

Install

npm install bare-tui-paparam bare-tui paparam

Runs on Bare

Quick start

const { command, flag, arg } = require('paparam')
const { isMenuMode, runMenu } = require('bare-tui-paparam')

const cmd = command(
  'run',
  arg('<link>', 'pear:// link or path to run'),
  flag('--store|-s [path]', 'storage path').default('./store'),
  flag('--mode|-m [mode]', 'how to run').choices(['terminal', 'desktop']),
  function run(c) {
    /* your real runner */
  }
)

if (isMenuMode(Bare.argv)) {
  // menu → pick a command → fill the form → confirm → run for real
  runMenu(cmd, { onComplete: (result, { argv }) => cmd.parse(argv) })
} else {
  cmd.parse(Bare.argv.slice(2)) // the normal CLI
}

Run it: bare mytool.js --menu. See examples/orbital-menu.js for a large multi-command tool exercising every field type.

Entry points

  • isMenuMode(argv, flag = '--menu') → did the user pass --menu?
  • menuHelp(command, opts) → run the menu TUI; resolves the MenuApp (read app.confirmed).
  • runMenu(command, opts)menuHelp + confirm + run-for-real (or your onComplete).
  • buildMenuApp(command, opts, extras?) → construct a MenuApp without running the TUI (embedding / tests).

Options

  • uiSchema — display hints per field ({ flag: { 'ui:widget': 'file' | 'directory' 'textarea' | 'password' } }). Path-like fields are auto-detected; this covers the ones a name/description doesn't reveal.
  • validators{ <flag-or-arg name>: (value, { values }) => err | null }.
  • validateSubmission(result) => err | null, the final whole-submission gate.
  • fieldHelp{ <flag-or-arg name>: 'a note' }. Drives the offline per-field help (F1 / ctrl+k shows the note for the focused field). You can also author these on the command itself with paparam's .hint('…').
  • helpKeys — override the help keys (default ['f1', 'ctrl+k']).
  • onComplete(result, { argv }) => any, runs after the TUI exits instead of the default command.parse.