Home

dialoguer

Dialoguer is a Rust crate that provides a collection of interactive prompts for building terminal-based user interfaces. It aims to simplify collecting input in command-line applications by offering a range of prebuilt prompts and theming options, reducing the need to manage raw terminal input.

The library supports several prompt types, including Input for free-text entry, Confirm for boolean decisions, Select

The API uses a builder-style pattern. Developers configure a prompt with methods to set the prompt text,

Theming is supported via theme types, with ColorfulTheme commonly provided as the default. Custom themes allow

for
choosing
a
single
item
from
a
list,
MultiSelect
for
choosing
multiple
items,
and
Password
for
hidden
input.
Some
prompts
also
support
features
such
as
default
values,
validation,
and
fuzzy
search
to
ease
navigation
through
long
lists.
default,
and
other
options,
then
invoke
an
interact
or
interact_opt
method
to
retrieve
the
result.
The
prompts
return
standard
Rust
types
(such
as
String,
bool,
or
usize)
or
None
if
the
user
cancels
or
the
prompt
fails.
adjustment
of
colors,
markers,
and
layout
to
match
an
application's
style.
Dialoguer
is
designed
to
be
cross-platform
and
integrates
with
common
Rust
CLI
workflows,
making
it
a
practical
choice
for
adding
user
prompts
to
a
CLI
without
implementing
terminal
handling
from
scratch.