Skip to main content

Module input

Module input 

Source
Expand description

User input abstraction — decouples interactive prompts from dialoguer.

Production uses TerminalInput (dialoguer). Tests inject [ScriptedInput] (pre-programmed responses). E2E tests (separate process via assert_cmd) use environment variables checked by TerminalInput before falling back to dialoguer.

§E2E test environment variables

These env vars are only consulted when NEX_TESTING=1 is set, preventing abuse in production environments.

  • NEX_TESTING — guard: must be set for any test env vars to take effect
  • NEX_TEST_PASSPHRASE — bypass password prompts
  • NEX_TEST_CONFIRM — bypass confirm prompts (“y”/“true” = yes, anything else = no)
  • NEX_TEST_INPUT — bypass text input prompts

Structs§

TerminalInput
Production input — reads from terminal via dialoguer. Falls back to environment variables for e2e test support, but only when NEX_TESTING is explicitly set to prevent abuse in production.

Traits§

InputProvider
Abstract input provider for user interaction.

Functions§

input
Get the active input provider.