inquire
is a library for building interactive prompts on terminals.
It provides several different prompts in order to interactively ask the user
for information via the CLI. With inquire
, you can use:
Text
to get text input from the user, with built-in auto-completion support;DateSelect
* to get a date input from the user, selected via an interactive calendar;Select
to ask the user to select one option from a given list;MultiSelect
to ask the user to select an arbitrary number of options from a given list;Confirm
for simple yes/no confirmation prompts;CustomType
for text prompts that you would like to parse to a custom type, such as numbers or UUIDs;Password
for secretive text prompts.
Check out the GitHub repository to see demos of what you can do with inquire
.
Features
- Cross-platform, supporting UNIX and Windows terminals (thanks to crossterm);
- Several kinds of prompts to suit your needs;
- Standardized error handling (thanks to thiserror);
- Support for fine-grained configuration for each prompt type, allowing you to customize:
- Default values;
- Input validators and formatters;
- Help messages;
- Auto-completion for
Text
prompts; - Custom list filters for Select and
MultiSelect
prompts; - Custom parsers for
Confirm
andCustomType
prompts; - and many others!
* Date-related features are available by enabling the date
feature.
Simple Example
use ;