Inquirer.js provides reusable prompt widgets for Node.js CLIs, including input, select, checkbox, and confirm flows. It runs in the terminal with TypeScript support and ships via npm, yarn, pnpm, or bun.
Overview
Inquirer.js helps developers build interactive command-line interfaces in JavaScript or TypeScript. Each prompt is an async function that reads from stdin and writes formatted questions and answers to stdout.
Built-in prompt types cover text input, single and multi select lists, checkboxes, yes-or-no confirmation, fuzzy search lists, masked password entry, expandable choice menus, numeric input with validation, and an editor launcher that opens the user’s VISUAL or EDITOR program on a temp file.
The package accepts custom stdin and stdout streams, optional screen clearing after answers, and AbortSignal cancellation. A separate internationalization package localizes prompts from environment locale variables or pinned language imports.
Recipes in the documentation cover conditional questions, grouped answers, git hook usage with a TTY, integration with nodemon, and shell scripts through npx. Community-maintained prompt packages extend the core with trees, tables, file pickers, and grouped checkboxes.
Key features
- Input, select, and checkbox prompts
- Password and search list prompts
- External editor answer capture
- AbortSignal prompt cancellation
- Optional localized prompt package
- Custom stdin and stdout streams
- Community prompt extensions
- Deno runtime support
Use cases
- CLI scaffolding wizards
- Interactive npm script configuration
- Git hook and pre-commit prompts
- Node.js operator tooling