Home

inquirer

Inquirer is a JavaScript library for building interactive command-line prompts in Node.js. It provides a collection of prompt interfaces that enable CLI programs to solicit input from users in a consistent, testable way. The library is published as the npm package inquirer and is used by many CLI tools and scaffolding frameworks to guide user input during setup and configuration.

The core API is inquirer.prompt(questions), where questions is an array of question objects. Each question defines

Inquirer builds prompts using the terminal, handles user input, and validates answers according to the defined

It is widely used in Node.js tooling, including project generators and package managers, to gather configuration

a
type,
a
name,
a
message,
and
optional
parameters
such
as
choices,
default,
validate,
filter,
and
when.
Supported
prompt
types
include
input,
confirm,
list,
rawlist,
expand,
checkbox,
password,
and
editor.
Prompts
can
be
asynchronous,
returning
a
promise
that
resolves
to
an
answers
object
with
keys
corresponding
to
question
names.
validators.
It
can
conditionally
skip
questions,
transform
results,
and
coordinate
multiple
prompts
to
collect
structured
data.
details
from
users.
The
project
emphasizes
accessibility,
consistency,
and
extensibility,
with
support
for
custom
prompt
types
via
plugins.
Inquirer
is
open
source
and
designed
to
be
easily
extended
to
fit
different
CLI
workflows.