Doc system test

prompting map

Prompting: map

How the CLI asks a template's questions and gets its answers, interactive or headless.

domain/

feature

  • Answer - A value for one question: a string, a list of strings, or a boolean, stored as { type, value }.
  • Deterministic state - Values a template makes once with d.get, such as a UUID or date, kept the same across the replays of one run.
  • Prompt outcome - The end state of one prompt run: complete with answers and Cyan, need input, or error.
  • Question - One prompt a template asks: text, password, select, checkbox, confirm or date, with an id, message and optional validator.

architecture/

surface

  • Headless envelope - The one JSON object a headless run prints on stdout: done, need_input with the question, or error.
  • Headless mode - Running create, update or try without a terminal: answers come from a file or stdin, and one JSON envelope goes to stdout.

implementation/

algorithm

  • Answer validation - How a typed or supplied answer is checked by the template's own validator before it is accepted.
  • Secret redaction - How headless errors are kept from echoing a supplied answer, so a password never reaches the JSON envelope.
  • Stateless replay - How the CLI asks a template's questions one at a time by re-running the template script from the top with every answer so far.