Inquirer.js

Interactive command-line prompts for Node.js — lists, checkboxes, confirms, and more with a single async API.

Library
npm
v14.2.2
21,630 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
90 /100 Excellent
Development Activity 96
Maintenance 96
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
87 /100 Excellent
Architecture 85
Code Quality 88
Innovation 85
Learning Curve 90

Inquirer.js is the collection of interactive command-line user interfaces most Node.js CLI tools reach for first. A single inquirer.prompt() call takes an array (or map, or RxJS observable) of question objects and resolves an answers hash, handling validation, defaults, conditional branching (when), and terminal rendering along the way.

The project has shipped since 2013 and now sits at 50M+ weekly npm downloads, making it one of the most battle-tested pieces of CLI infrastructure in the JavaScript ecosystem. Tools like Yeoman, npm init flows, and countless scaffolding CLIs are built on top of it.

The modern codebase is a monorepo of @inquirer/* scoped packages (core, prompts, checkbox, confirm, select, input, editor, search, ansi, type) with the inquirer package itself acting as a thin, backward-compatible wrapper around them — so existing inquirer.prompt() call sites keep working while the underlying primitives can be composed directly via @inquirer/prompts for new code.

What You Get

  • A prompt() function that accepts an array, a map, or an RxJS-compatible observable of question objects and returns a promise of the collected answers
  • Built-in prompt types (list, rawlist, expand, checkbox, confirm, input, number, password, editor) covering the vast majority of CLI input needs out of the box
  • Conditional flow control via a when function/boolean per question, plus per-question validate, filter, and transformer hooks that can run sync or async
  • A createPromptModule() escape hatch for isolated prompt registries, and registerPrompt() for adding custom/community prompt types
  • A reactive interface — passing an RxJS Subject of questions lets a CLI push new questions dynamically as earlier answers resolve

Common Use Cases

  • Project scaffolding CLIs that ask a sequence of setup questions (name, template, package manager) before generating files
  • Interactive git-style or npm-style command wrappers that confirm destructive actions before running them
  • Multi-step onboarding flows where later questions are conditionally shown based on earlier answers via when
  • Build tools and generators (in the Yeoman lineage) that need password/editor/checkbox prompts alongside plain text input

Under The Hood

Architecture The inquirer package (packages/inquirer/src/index.ts → ui/prompt.ts) is a compatibility shim over the newer @inquirer/core primitives: PromptsRunner.run() iterates an async generator of questions (getQuestions), resolves each one’s message/default/choices (which may be async functions) via fetchAsyncQuestionProperty, decides whether to ask it via shouldRun (respecting when and previously-answered values), and dispatches to either a modern PromptFn or a legacy class-based LegacyPromptConstructor detected through duck-typing (isPromptConstructor). Underneath, @inquirer/core’s createPrompt() (packages/core/src/lib/create-prompt.ts) wires a React-like hooks engine (hook-engine.ts, backed by AsyncLocalStorage rather than a VDOM) to a ScreenManager that mutes stdout via mute-stream and re-renders only on state change, with useKeypress/useEffect-style primitives driving the terminal UI. This hooks-over-readline design is the core abstraction the whole prompt catalogue is built from — changing it would ripple through every @inquirer/* prompt package.

Tech Stack A Yarn (v4) + Turborepo workspace of TypeScript-first ESM packages (packages/*), targeting current Node.js LTS ranges, with @inquirer/core handling readline/terminal concerns, mute-stream for output muting during editing, run-async for callback/promise interop on legacy validate/filter functions, and optional rxjs support for the observable-based prompt session API. Builds run through tsc orchestrated by turbo, tests via vitest, and linting via oxlint/oxfmt plus eslint.

Code Quality The inquirer package carries an extensive public-API test suite (inquirer.test.ts, well over a thousand lines) covering question maps, arrays, observables, validation/filter/when timing, and TTY edge cases, run under vitest. CI (main.yml) gates on tsc, oxlint, oxfmt --check, and eslint before tests, with a separate CodeQL workflow and a zizmor job specifically linting the GitHub Actions workflows themselves for supply-chain issues — a level of CI rigor above most CLI libraries of this age.

API Design The headline API is a single inquirer.prompt(questions) call returning a plain answers object, which is about as low-boilerplate as an interactive CLI API gets. Question objects follow one consistent shape (type, name, message, default, choices, validate, filter, when) across every prompt type, and the README documents each field and prompt type with runnable examples in packages/inquirer/examples/. The main tension is that this package now explicitly documents itself as the legacy/back-compat layer, steering new adoption toward the more ergonomic per-prompt @inquirer/prompts functions.

Used by 66 apps in this directory

TypeScript
97%
Other

Sourcebot

AI Code Assistants · Developer Tools · Search

3,952

A self-hosted, AI-powered code search engine that indexes every repo across GitHub, GitLab, Bitbucket, Gitea, Gerrit, and Azure DevOps, so both engineers and coding agents can search, browse, and ask questions about your codebase from one place.

View details
85
Repo Health
83
Technical
62
Dependency
Built with
TypeScript 97%
Updated 2 weeks ago
TypeScript
89%
Other

Hexclave

Authentication · Developer Tools

6,862

The open-source user infrastructure platform — authentication, teams, payments, emails, analytics, and more on a single unified user model.

View details
87
Repo Health
80
Technical
66
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
88%
Other

strapi

CMS

73,243

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
66
Dependency
Built with
TypeScript 88%
JavaScript 12%
Updated 1 weeks ago
Rust
64%
Apache 2.0

Temps

Analytics · Devops · Monitoring

801

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
70
Dependency
Built with
Rust 64%
TypeScript 34%
Updated 1 weeks ago
Rust
64%
Apache 2.0

Temps

Analytics · Devops · Monitoring

801

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
70
Dependency
Built with
Rust 64%
TypeScript 34%
Updated 1 weeks ago
TypeScript
98%
Apache 2.0

Tianji

Analytics · Monitoring

3,100

Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.

View details
86
Repo Health
76
Technical
65
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
JavaScript
57%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,007

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
JavaScript 57%
TypeScript 36%
Updated 1 weeks ago
Rust
71%
MIT

Trieve

AI Development · Developer Tools · Search

2,719

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
42
Repo Health
74
Technical
64
Dependency
Built with
Rust 71%
Updated 8 months ago
TypeScript
82%
Other

twenty

CRM

57,585

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 82%
MDX 15%
Updated 1 weeks ago

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