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
{{ message }}
Repository navigation
Non-interactive error tells users to pass --confirm/--no-confirm, which do not exist #1354
constConfirmFlag='confirm';constNoConfirmFlag=`no-${ConfirmFlag}`;
...
errorMessageForStdin=`Please use the --${ConfirmFlag}/--${NoConfirmFlag} flags to confirm the action.`,
Neither flag exists. grep for a confirm flag definition across src/commands/ and src/lib/command-framework/ returns nothing — the two names appear only in that message string. So a user who hits this is told to pass a flag that no command accepts, with no way to proceed.
Where it is reachable
useUserInput and useSelectFromList override the message with something accurate. useYesNoConfirm, useMaskedInput and useInputConfirmation do not, so any call site that also omits providedConfirmFromStdin hits the phantom flags. Two do:
1. useActorConfig — two call sites, neither guarded
useActorConfig.ts:111 — both apify.json and .actor/actor.json present, confirm renaming the old one
useActorConfig is called by init, run, actors/push, actors/pull and actor/calculate-memory. actors/push sets enableJsonFlag, so this is also the one place where --json and a prompt meet today.
Verified repro:
mkdir -p demo/.actor &&cd demo
echo'{"name":"old","version":"0.0"}'> apify.json
echo'{"actorSpecification":1,"name":"new","version":"0.0"}'> .actor/actor.json
echo'{"name":"x"}'> package.json
apify run < /dev/null
# Error: Please use the --confirm/--no-confirm flags to confirm the action.
actor calculate-memory < /dev/null
# Error: Please use the --confirm/--no-confirm flags to confirm the action.
No login required — the config check runs before anything else. CI hits the same path via the isCI branch, so this fails a pipeline with an instruction that cannot be followed.
2. auth/login — login.ts:200, the masked token: prompt. Lower impact, since apify login --token <token> is the documented non-interactive path, but the error still names flags that do not exist instead of pointing at --token.
Suggested fix
Pick whichever fits the intended design:
Give the three unguarded hooks an accurate default message, the way useUserInput and useSelectFromList already do.
Or make the default message generic — "this command needs a terminal; pass the required flags explicitly" — and drop the --confirm naming entirely.
Plus thread providedConfirmFromStdin through the useActorConfig call sites so push/run/pull have some way to answer the migration prompt non-interactively.
The login case may just want its own message naming --token.
Notes
Pre-existing on master, not introduced by any open PR. Found while checking how --json and interactive prompts interact across commands.
Important
TL;DR — Found this while wondering through codebase, it is corner case but worth of investigation.
Three prompt hooks fall back to a default non-interactive error that tells the user to pass
--confirm/--no-confirm:https://github.com/apify/apify-cli/blob/master/src/lib/hooks/user-confirmations/_stdinCheckWrapper.ts#L27-L46
Neither flag exists.
grepfor aconfirmflag definition acrosssrc/commands/andsrc/lib/command-framework/returns nothing — the two names appear only in that message string. So a user who hits this is told to pass a flag that no command accepts, with no way to proceed.Where it is reachable
useUserInputanduseSelectFromListoverride the message with something accurate.useYesNoConfirm,useMaskedInputanduseInputConfirmationdo not, so any call site that also omitsprovidedConfirmFromStdinhits the phantom flags. Two do:1.
useActorConfig— two call sites, neither guardeduseActorConfig.ts:111— bothapify.jsonand.actor/actor.jsonpresent, confirm renaming the old oneuseActorConfig.ts:170— confirm migratingapify.jsonto the new formatuseActorConfigis called byinit,run,actors/push,actors/pullandactor/calculate-memory.actors/pushsetsenableJsonFlag, so this is also the one place where--jsonand a prompt meet today.Verified repro:
No login required — the config check runs before anything else. CI hits the same path via the
isCIbranch, so this fails a pipeline with an instruction that cannot be followed.2.
auth/login—login.ts:200, the maskedtoken:prompt. Lower impact, sinceapify login --token <token>is the documented non-interactive path, but the error still names flags that do not exist instead of pointing at--token.Suggested fix
Pick whichever fits the intended design:
useUserInputanduseSelectFromListalready do.--confirmnaming entirely.providedConfirmFromStdinthrough theuseActorConfigcall sites sopush/run/pullhave some way to answer the migration prompt non-interactively.The
logincase may just want its own message naming--token.Notes
Pre-existing on
master, not introduced by any open PR. Found while checking how--jsonand interactive prompts interact across commands.🤖 Generated with Claude Code