Glue tool to read a password on tty (not stdin) and print to stdout.
passwordprompt [PROMPT STRING]
In shell scripts, add password=$(prompt-password)
to prompt a password with messing with stty(1)
.
Some apps read passwords from env variables, files or customizable commands (e.g. to run pass
), but are incapable of reading passwords interactively themselves.
prompt-password
is useful here as an external command that will effectively read the password interactively.
Examples:
- borgmatic (with
encryption_passcommand: password-prompt
) - vdirsyncer (with
password.fetch = ["command", "password-prompt"]
) mbsync (mbsync is able to prompt a password)