inquire is a Rust crate for building interactive prompts in terminal applications. It offers several prompt types for collecting user input on the command line.
Overview
inquire helps Rust developers add interactive question-and-answer flows to command-line programs. Prompts run in the terminal and cover common patterns such as short text, multi-line editor input, dates, single and multi-select lists, yes/no confirmation, typed parsing, and password entry.
Each prompt type supports customization of themes, defaults, placeholders, validators, formatters, help text, and related behavior. Text prompts can offer autocompletion; select lists support filtering and fuzzy scoring. Optional feature flags enable editor and calendar prompts.
The library defaults to the crossterm terminal backend for broad platform support, including Windows, and can switch to termion or console via Cargo features so projects can align with an existing dependency. It manages terminal state during prompts and documents signal-handling concerns for applications that may exit abruptly.
Developers integrate inquire by adding it as a Cargo dependency and calling prompt APIs when building CLI tools. One-line helper functions exist for common cases such as text, numbers, dates, secrets, and confirmation.
Key features
- Multiple interactive prompt types
- Custom render themes and styles
- Input validators and formatters
- Text autocompletion support
- Fuzzy filter for select lists
- Swappable terminal backends
- Optional editor and date prompts
- Built-in validator shorthand macros
Use cases
- CLI configuration wizards
- Interactive setup scripts
- Terminal survey and form tools
- Password and secret prompts
- Menu-driven command-line apps