Prompts

Lightweight, beautiful and user-friendly interactive CLI prompts for Node.js.

Library
npm
v2.4.2
9,308stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
45/100Fair
Development Activity0
Maintenance20
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture85
Code Quality78
Innovation86
Learning Curve88

Prompts is a small, dependency-light Node.js library for building interactive command-line interfaces that ask users for input. It ships twelve unified prompt types — text, password, number, confirm, select, multiselect, autocomplete, date, and more — behind a single promise-based API that plays naturally with async/await.

Designed for CLIs, scaffolding tools, and setup wizards, it favors a clean layout with colored output, per-question validation, dynamic prompt chaining, and a testable inject mechanism for scripting answers. With no heavy dependencies and a consistent experience across every prompt, it has become one of the most widely used prompt libraries in the npm ecosystem.

What You Get

  • Twelve unified prompt types (text, password, invisible, number, confirm, list, toggle, select, multiselect, autocomplete, autocompleteMultiselect, date) with a consistent look and feel.
  • A promise-based API built around async/await, so prompt chains read as ordinary asynchronous code with no callback nesting.
  • Per-question validation, formatting, and dynamic prompts whose type, message, or initial value can be computed from previous answers.
  • An inject() testing hook and an override() helper for supplying answers programmatically from CLI arguments or test fixtures.
  • A tiny dependency footprint (only kleur and sisteransi) and bundled TypeScript definitions.

Common Use Cases

  • Building setup wizards and project scaffolding CLIs that gather configuration interactively.
  • Prompting for confirmations, credentials, or selections inside developer tooling and build scripts.
  • Collecting structured multi-step input where later questions depend on earlier answers.

Under The Hood

Architecture

The entry point index.js re-exports lib/index.js, whose prompt() function is the whole orchestration layer: it normalizes a single question or array into a list, resolves any function-valued properties against the answers collected so far, evaluates the type (skipping falsy types), and dispatches to the matching prompter in lib/prompts.js. Each prompter in lib/prompts.js constructs a corresponding element class from lib/elements/ (TextPrompt, NumberPrompt, SelectPrompt, etc.) and wraps its submit/abort/exit events in a promise. Every element extends a base Prompt (lib/elements/prompt.js) that owns the readline interface, raw-mode keypress handling, and cursor control via sisteransi, while shared rendering helpers live in lib/util/.

Tech Stack

Pure JavaScript (CommonJS) targeting Node 14+, with only two runtime dependencies: kleur for terminal colors and sisteransi for ANSI cursor/erase sequences. Terminal input is handled with Node’s built-in readline and EventEmitter. Hand-written TypeScript definitions ship in index.d.ts. Tooling is minimal — tape with tap-spec for tests and tsc for type-declaration checks.

Code Quality

The codebase is compact and well-factored, splitting responsibilities cleanly across an orchestrator, per-type element classes, and utility modules, with JSDoc annotations on the public surface. A test suite exists (test/prompts.js, test/text.js, test/util.js, plus test/type-declarations.ts) covering the core prompter and text element, though coverage is focused rather than exhaustive. Error handling is explicit for missing messages and undefined prompt types, and cancellation is modeled through the abort/exit event paths.

API Design

The public API is deliberately tiny — a single callable that takes declarative question objects and returns a keyed answers object — which keeps the mental model small and the getting-started boilerplate near zero. Consistent property names (type, name, message, initial, format, validate) across every prompt type, first-class async support, and the function-valued property convention make dynamic flows expressive. The README is thorough with per-type documentation and runnable examples, and inject()/override() give a clean testing story.

Used by 26 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
94%
MIT

Actual

Invoicing Finance

28,224

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated yesterday
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,872

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
95
Repo Health
82
Technical
66
Dependency
Built with
TypeScript100%
Updated yesterday
TypeScript
99%
Apache 2.0

Bubble Lab

Automation · AI Development

1,095

Open-core workflow engine for building AI-powered automations in TypeScript that run natively inside Slack — no context switching required.

View details
35
Repo Health
78
Technical
72
Dependency
Built with
TypeScript99%
Updated 3 months ago
Rust
67%
MIT

Bun

Developer Tools

95,452

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
66
Dependency
Built with
Rust67%
C++19%
Updated today
TypeScript
100%
Other

Dub

Marketing · Analytics

24,521

The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.

View details
81
Repo Health
78
Technical
65
Dependency
Built with
TypeScript100%
Updated today
TypeScript
56%
MIT

Jitsu

Data Engineering

5,035

Open-source, fully-scriptable data ingestion engine that streams events from web, apps, and APIs to any data warehouse in real time.

View details
89
Repo Health
79
Technical
68
Dependency
Built with
TypeScript56%
Go41%
Updated today
TypeScript
76%
Other

Joplin

Note Taking

56,003

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
62
Dependency
Built with
TypeScript76%
JavaScript15%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search