Skip to main content

Module prompt

Module prompt 

Source
Expand description

Interactive prompts with [default: ...] rendering and ?-help.

PromptSource is a trait so terminal, AI/LLM, and scripted-test answer sources are interchangeable. TerminalPrompt is the line-based impl used for tests and non-TTY (piped/CI) callers; DialoguerPrompt is the rich impl that drives dialoguer widgets on a real terminal. The auto() factory picks between them based on whether stdin is a TTY.

Modules§

dialoguer
Rich-TUI PromptSource impl backed by dialoguer.

Structs§

Field
Static metadata for one interactive question.
TerminalPrompt
PromptSource impl that renders to stderr and reads from stdin.

Enums§

AutoPrompt
PromptSource returned by auto: dialoguer-backed when stdin is a TTY, line-based otherwise.

Traits§

PromptSource
Source of answers to interactive prompts.

Functions§

auto
TTY stdin gets the rich dialoguer-backed picker; piped / CI stdin falls back to the line-based TerminalPrompt so scripted input keeps working.