You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#153 added requireInteractive (src/core/tty.ts) and wired it through every
prompt in the init flow, so a run with no TTY on stdin fails naming the flag that answers the
question. It was deliberately scoped to init. Every other command that prompts still does the old
thing: renders a prompt nobody can answer and waits forever, so a CI step or a scripted run hangs
until its job times out instead of failing.
(src/prompts/oauthSetup.ts also prompts, but its only caller is init, which already guards it.)
Change
Two halves, and the second is the design question.
1. Guard every call site. Front each prompt with requireInteractive(question, remedy), the way
the init flow does. This alone converts a hang into an immediate non-zero exit with a message,
which is the bulk of the value and carries no behavioral risk for interactive use.
2. Give the confirms a way to be answered. A guard with no remedy to point at is only half an
answer: it still means the command cannot run unattended. The inputs mostly have flags already
(login --identifier, profile add --instance-url), so their remedy is just naming those. The
destructive confirms mostly do not.
The decision worth making deliberately: which of those confirms should take a skip flag at all. init settled on the rule that --yes answers ordinary questions and --force is required for
anything destructive, and these are all in the second category. Options:
Standardize on --force for the destructive confirms, keeping --yes for ordinary questions, so
the rule matches init. config oauth-providers remove --yes already ships, so it would need an
alias or a deprecation.
Standardize on --yes everywhere, matching the flag that already exists, and accept that it
diverges from what init means by --yes.
Guard only, and add no skip flags: deleting a user or revoking every session stays something you
cannot do unattended, by design.
Worth deciding before the implementation, since it sets the convention for every command added
later. My inclination is the first, with --yes kept as an accepted alias on config oauth-providers remove so nothing breaks.
3. Emit the width warning (warnOnUnusableWidth) wherever prompts are about to run, not just in init.
Acceptance
Every prompt in the table refuses to render without a TTY and exits non-zero with a message.
Problem
#153 added
requireInteractive(src/core/tty.ts) and wired it through everyprompt in the
initflow, so a run with no TTY on stdin fails naming the flag that answers thequestion. It was deliberately scoped to
init. Every other command that prompts still does the oldthing: renders a prompt nobody can answer and waits forever, so a CI step or a scripted run hangs
until its job times out instead of failing.
The prompts
config oauth-providers removealready takes--yes; nothing else does.(
src/prompts/oauthSetup.tsalso prompts, but its only caller isinit, which already guards it.)Change
Two halves, and the second is the design question.
1. Guard every call site. Front each prompt with
requireInteractive(question, remedy), the waythe init flow does. This alone converts a hang into an immediate non-zero exit with a message,
which is the bulk of the value and carries no behavioral risk for interactive use.
2. Give the confirms a way to be answered. A guard with no remedy to point at is only half an
answer: it still means the command cannot run unattended. The inputs mostly have flags already
(
login --identifier,profile add --instance-url), so their remedy is just naming those. Thedestructive confirms mostly do not.
The decision worth making deliberately: which of those confirms should take a skip flag at all.
initsettled on the rule that--yesanswers ordinary questions and--forceis required foranything destructive, and these are all in the second category. Options:
--forcefor the destructive confirms, keeping--yesfor ordinary questions, sothe rule matches
init.config oauth-providers remove --yesalready ships, so it would need analias or a deprecation.
--yeseverywhere, matching the flag that already exists, and accept that itdiverges from what
initmeans by--yes.cannot do unattended, by design.
Worth deciding before the implementation, since it sets the convention for every command added
later. My inclination is the first, with
--yeskept as an accepted alias onconfig oauth-providers removeso nothing breaks.3. Emit the width warning (
warnOnUnusableWidth) wherever prompts are about to run, not just ininit.Acceptance
Follow-up to #153, which shipped the helper and the
initcoverage in #158.