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
Add sequential fallback wizard for non-TTY and unsupported Ink terminals #1603
The setup command must fall back to a simple sequential wizard when Ink TUI is unsupported. This matters for terminals without raw mode, SSH environments, CI-like shells, and users who pass --no-tui.
Requirements
Implement prompt callbacks using readline/promises.
Reuse the same setup engine as the Ink path.
Print step updates and choices clearly.
Avoid prompting when stdin is not interactive; fail with actionable guidance instead.
The fallback uses the same engine with a readline prompt adapter. This avoids having two setup implementations and makes behavior consistent across renderers. A non-interactive auto mode was considered, but setup includes authentication and security choices that should not be guessed silently. The fallback therefore requires a TTY unless a future explicit --yes automation mode is designed.
File: packages/cli/src/commands/setup/sequential.ts (new file)
Why this file: This file provides the non-Ink user experience. It connects the setup engine to simple line-based prompts while preserving the same step sequencing and mutation behavior.
import{createInterface}from'node:readline/promises';importtype{InterfaceasReadlineInterface}from'node:readline/promises';import{stdinasinput,stdoutasoutput}from'node:process';import{runSetupEngine,typeSetupPrompts}from'./engine.js';import{createInitialSetupState}from'./state.js';importtype{SetupDecision,SetupRunOptions,SetupWizardState}from'./types.js';functionrequireInteractive(): void{if(!process.stdin.isTTY||!process.stdout.isTTY){// Setup writes credentials and deployment choices, so failing early is safer// than silently choosing defaults in a pipe or CI job.thrownewError('propr setup requires an interactive terminal. Re-run in a TTY or use existing non-interactive commands such as propr init stack and propr start.');}}functionmakePrompts(rl: ReadlineInterface): SetupPrompts{return{asyncconfirm(message: string,defaultValue=false): Promise<boolean>{constsuffix=defaultValue ? '[Y/n]' : '[y/N]';constanswer=(awaitrl.question(`${message}${suffix} `)).trim().toLowerCase();if(!answer)returndefaultValue;returnanswer==='y'||answer==='yes';},asyncinput(message: string,defaultValue=''): Promise<string>{constsuffix=defaultValue ? ` (${defaultValue})` : '';constanswer=awaitrl.question(`${message}${suffix}: `);returnanswer.trim()==='' ? defaultValue : answer.trim();},asyncchoose<Textendsstring>(message: string,choices: Array<SetupDecision<T>>,defaultValue: T): Promise<T>{console.log('');console.log(message);choices.forEach((choice,index)=>{constdefaultMarker=choice.value===defaultValue ? ' default' : '';console.log(` ${index+1}. ${choice.label}${defaultMarker}`);console.log(` ${choice.detail}`);});constanswer=(awaitrl.question('Choose a number: ')).trim();if(!answer)returndefaultValue;constindex=Number(answer)-1;if(!Number.isInteger(index)||index<0||index>=choices.length){console.log('Invalid choice. Try again.');returnthis.choose(message,choices,defaultValue);}returnchoices[index]!.value;},asyncmultiChoose<Textendsstring>(message: string,choices: Array<SetupDecision<T>>,defaults: T[]): Promise<T[]>{console.log('');console.log(message);choices.forEach((choice,index)=>{constdefaultMarker=defaults.includes(choice.value) ? ' default' : '';console.log(` ${index+1}. ${choice.label}${defaultMarker}`);console.log(` ${choice.detail}`);});constanswer=(awaitrl.question('Choose comma-separated numbers, or leave blank for none: ')).trim();if(!answer)returndefaults;constselected=answer.split(',').map((part)=>Number(part.trim())-1);if(selected.some((index)=>!Number.isInteger(index)||index<0||index>=choices.length)){console.log('Invalid selection. Try again.');returnthis.multiChoose(message,choices,defaults);}// Use Set to remove duplicate numbers so downstream image pulls are not// repeated when a user types the same choice twice.return[...newSet(selected.map((index)=>choices[index]!.value))];},};}exportasyncfunctionrunSequentialSetup(rootDir: string,options: SetupRunOptions): Promise<SetupWizardState>{requireInteractive();constrl=createInterface({ input, output });try{conststate=createInitialSetupState(rootDir,true);returnawaitrunSetupEngine(state,options,makePrompts(rl),{onState: (next)=>{constcurrent=next.steps.find((step)=>step.id===next.currentStep);if(current)console.log(`${current.title}: ${current.status}${current.detail ? ` - ${current.detail}` : ''}`);},onMessage: (message)=>console.log(message),});}finally{rl.close();}}
Activity
propr-dev commentedon Jun 22, 2026
Suggested Implementation:
Implementation Approach
The fallback uses the same engine with a readline prompt adapter. This avoids having two setup implementations and makes behavior consistent across renderers. A non-interactive auto mode was considered, but setup includes authentication and security choices that should not be guessed silently. The fallback therefore requires a TTY unless a future explicit
--yesautomation mode is designed.File:
packages/cli/src/commands/setup/sequential.ts(new file)Why this file: This file provides the non-Ink user experience. It connects the setup engine to simple line-based prompts while preserving the same step sequencing and mutation behavior.
propr-dev commentedon Jun 22, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-4-8 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-4-81603/claude-opus-4-8-add-sequential-fallback-w-20260622-1022-nt31599-epic-build-comprehensive-b5cissue-1603-20260622-1022-claude-opus-4-8-nt3🔍 Track Task Execution
The implementation is complete and verified. Here's a summary of what…
The implementation is complete and verified. Here's a summary of what…