Promptui is a Go library for building interactive command-line prompts, providing components for collecting text input with validation, presenting scrollable selection lists, and enabling dynamic addition of list items. It serves as a toolkit for creating terminal user interfaces where users can navigate menus, search options, and enter text with live validation and masking.
The library implements interactive prompts through a synchronous blocking I/O model combined with ANSI cursor control and terminal-event-driven rendering, allowing for real-time UI updates. Its template-driven output formatting enables custom prompt layouts, while a state-machine-based input flow manages user interaction sequences for input, validation, and selection. Input validation is handled through a callback-free pipeline of synchronous validator functions.
Promptui offers three primary interactive components: a text input prompt with validation, defaults, and masking; a selectable list prompt with search and pagination; and an addable selection list that lets users either choose an existing item or type in a new one. These components support custom display templates and scrollable navigation for terminal applications.