7777
7878# ── Prompting ────────────────────────────────────────────────────────────────
7979
80- # prompt_secret KEY "description" "url" [required] [prefix]
80+ # prompt_secret KEY "description" "url" [required] [prefix] [sensitive]
8181# If an existing value is set, shows [****] and allows Enter to keep it.
82+ # sensitive defaults to "true" — input is hidden. Pass "false" for visible input.
8283prompt_secret () {
83- local key=" $1 " desc=" $2 " url=" ${3:- } " required=" ${4:- } " prefix=" ${5:- } "
84+ local key=" $1 " desc=" $2 " url=" ${3:- } " required=" ${4:- } " prefix=" ${5:- } " sensitive= " ${6 :- true} "
8485 local label=" " existing=" ${EXISTING[$key]:- } "
8586
8687 if [ " $required " = " required" ]; then
@@ -98,7 +99,14 @@ prompt_secret() {
9899 else
99100 ask " ${label}${desc} : "
100101 fi
101- read -r value
102+
103+ if [ " $sensitive " = " true" ] && [ -t 0 ]; then
104+ read -rs value
105+ # Print newline since -s suppresses it
106+ echo " "
107+ else
108+ read -r value
109+ fi
102110
103111 # Empty input with existing value = keep existing
104112 if [ -z " $value " ] && [ -n " $existing " ]; then
@@ -203,7 +211,8 @@ prompt_secret "SLACK_ALLOWED_USERS" \
203211 " Slack user IDs (comma-separated)" \
204212 " Click your Slack profile → ··· → Copy member ID" \
205213 " required" \
206- " U"
214+ " U" \
215+ " false"
207216
208217echo " "
209218
@@ -216,7 +225,8 @@ prompt_secret "AGENTMAIL_API_KEY" \
216225 " https://app.agentmail.to"
217226
218227prompt_secret " BAUDBOT_EMAIL" \
219- " Agent email address (e.g. agent@agentmail.to)"
228+ " Agent email address (e.g. agent@agentmail.to)" \
229+ " " " " " " " false"
220230
221231if [ -n " ${ENV_VARS[AGENTMAIL_API_KEY]:- } " ]; then
222232 prompt_secret " BAUDBOT_SECRET" \
@@ -227,16 +237,17 @@ if [ -n "${ENV_VARS[AGENTMAIL_API_KEY]:-}" ]; then
227237 fi
228238
229239 prompt_secret " BAUDBOT_ALLOWED_EMAILS" \
230- " Allowed sender emails (comma-separated)"
240+ " Allowed sender emails (comma-separated)" \
241+ " " " " " " " false"
231242fi
232243
233244prompt_secret " SENTRY_AUTH_TOKEN" \
234245 " Sentry API token" \
235246 " https://sentry.io/settings/account/api/auth-tokens/"
236247
237248if [ -n " ${ENV_VARS[SENTRY_AUTH_TOKEN]:- } " ]; then
238- prompt_secret " SENTRY_ORG" " Sentry org slug"
239- prompt_secret " SENTRY_CHANNEL_ID" " Slack channel ID for Sentry alerts" " " " " " C"
249+ prompt_secret " SENTRY_ORG" " Sentry org slug" " " " " " " " false "
250+ prompt_secret " SENTRY_CHANNEL_ID" " Slack channel ID for Sentry alerts" " " " " " C" " false "
240251fi
241252
242253prompt_secret " KERNEL_API_KEY" \
0 commit comments