Note the asymmetry at steps 2 and 3: asking for interactivity without a terminal
resolves to NON-interactive with reason no-tty rather than throwing. The caller
is then free to fail at the exact point a value is missing, which is far more
actionable than a blanket "no TTY" error at startup.
Decides whether this run may prompt, most explicit signal first:
--no-interactive→ never--interactive→ yes, if there is a terminal to prompt onTERM=dumb→ neverNote the asymmetry at steps 2 and 3: asking for interactivity without a terminal resolves to NON-interactive with reason
no-ttyrather than throwing. The caller is then free to fail at the exact point a value is missing, which is far more actionable than a blanket "no TTY" error at startup.