Skip to main content

Module prompt

Module prompt 

Source
Expand description

Interactive entry for missing secrets (--prompt-missing).

The shape mirrors agentd login: a deployment that is missing credentials stops and asks the person in front of it, one value at a time, instead of failing once per missing value across repeated restarts.

Two hard rules keep this from becoming a footgun:

  • Opt-in, and only with a controlling terminal. The gate is opening /dev/tty, not guessing from stdin: a daemon under systemd or in a pod has no controlling terminal, so the open fails and startup fails loudly with the missing-reference list — never a silent hang on a prompt nobody can see.
  • Entered values live in process memory only (sec::secret’s prompted store). They are never written to the config file (how secrets end up in git), never exported to the environment (children would inherit them), and a restart re-prompts — the honest cost of persisting nothing.

Functions§

prompt_missing_requested
Whether the operator asked to be prompted for missing values.
read_secret_from_tty
Read one secret from the controlling terminal, echo off.
request_prompt_missing
Record that --prompt-missing was on the command line (consumed by the CLI shell before the settings model sees argv, like --fresh).