larzprompt
Interactive CLI prompts.
Interactive prompts — text, confirm, select, integer, password — with injectable input/output so your prompt flows are actually unit-testable.
larzscript pkg install prompt
What you get
- text/confirm/select/password
- Re-prompt on invalid
- Injectable I/O
- Unit-testable
Try it
import "prompt" as prompt
let queue = ["Larz", "y", "2"]
fn next_answer(msg) {
let v = queue[0]
queue = queue[1:]
return v
}
let name = prompt.text("Your name: ", next_answer)
print("name:", name)
print("continue:", prompt.confirm("Continue? ", nil, next_answer))
print("picked:", prompt.select("Pick a color:", ["red", "green", "blue"], next_answer))Output
name: Larz continue: true Pick a color: 1) red 2) green 3) blue picked: green
Why it's in the Larz Stack
larzprompt is a real Larzscript package (larzscript pkg install prompt) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.