dialoguer
A Rust library for interactive command-line prompts and menus
Repository Health
Technical Analysis
dialoguer provides a set of ready-made interactive command-line prompts for Rust CLI tools: text input, password entry, confirmation, single/multi-select menus, fuzzy select, sorting, and full-screen text editor invocation. It is part of the console-rs family of crates, built directly on top of console for terminal styling and cursor control.
Rather than requiring developers to hand-roll raw terminal input handling, dialoguer exposes a builder-style API per prompt type (Input::new(), Select::new(), Confirm::new()) with theming support (plain or colorful), input validation hooks, history support, and command-line completion, making it the standard choice for adding interactive prompts to Rust CLI applications.
What You Get
- Prompt builders for
Input,Password,Confirm,Select,MultiSelect,Sort, andFuzzySelect - Pluggable
Themetrait with built-inSimpleThemeandColorfulThemeimplementations - Input validation hooks that re-prompt on invalid input without extra boilerplate
- History support for input prompts, useful for CLIs that want shell-like recall
- Shell-word aware completion support for input prompts
- External editor integration (
Editor) for multi-line text entry via$EDITOR
Common Use Cases
- Interactive setup wizards for CLI tools (project scaffolding, config generation)
- Confirmation prompts before destructive CLI operations (delete, overwrite, force-push)
- Menu-driven CLI UIs where the user picks from a list of options or toggles multiple choices
- Collecting masked password/secret input from a terminal session
Under The Hood
Architecture — The crate is organized around a prompts/ module (src/prompts/) containing one file per prompt type (input.rs, select.rs, multi_select.rs, confirm.rs, password.rs, sort.rs, fuzzy_select.rs), each exposing a builder struct with a fluent .with_prompt()/.default()/.interact() chain. Rendering is centralized in src/theme/render.rs, which every prompt type calls into so that terminal-drawing logic (cursor movement, redraw-on-keypress) lives in one place rather than being duplicated per prompt. src/paging.rs handles scrolling for select menus that exceed the terminal height, and src/completion.rs/src/history.rs are opt-in behaviors layered onto the Input prompt.
Tech Stack — Built directly on console (also a console-rs crate) for cross-platform terminal styling, cursor control, and raw-mode input handling, keeping the dependency footprint small. Optional features gate extras: editor pulls in tempfile for external-editor round-tripping, password pulls in zeroize to scrub secret input from memory, and fuzzy-select pulls in fuzzy-matcher. This feature-gating keeps the default build lean for consumers who only need basic prompts.
Code Quality — Unit tests are colocated with the prompt implementations most prone to edge-case bugs — select.rs (10 tests), multi_select.rs, fuzzy_select.rs, confirm.rs, input.rs, password.rs, and sort.rs — covering keyboard-navigation and selection-state logic. The crate also ships a deny.toml for dependency license/advisory auditing in CI, and every prompt type has a matching runnable example under examples/, which doubles as documentation and a smoke test for the public API.
API Design — The builder pattern (Input::new().with_prompt("Name").interact()) is consistent across every prompt type, so learning one prompt largely transfers to the rest. Theming is a separate concern injected via .theme(&ColorfulTheme::default()), keeping visual customization decoupled from prompt logic. The API favors terse call sites for simple use, single method chains, over configuration structs, which keeps most real-world usage to a few lines per prompt.
Used by 7 apps in this directory
Hook0
Devops
Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.
Jan
AI Assistants
Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.
melty
AI Code Assistants · Code Editors · Developer Tools
The AI code editor where every chat message is a git commit you can revert, branch, or squash
OpenShell
AI Agents · Developer Tools
The safe, private runtime that lets autonomous AI agents operate in sandboxed environments governed by declarative YAML policies — blocking data exfiltration, credential leaks, and unauthorized network activity before they happen.
Spacedrive
Collaboration · File Storage
One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.
Svix
Automation · Developer Tools
Open source, self-hostable webhook infrastructure that handles delivery, retries, HMAC signing, and multi-tenant event management so you never have to build a webhooks system from scratch.
Vibe Kanban
AI Agents · AI Code Assistants · Project Management
A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.