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
The setup screen must be interactive using Ink when the terminal supports it. The TUI should show setup progress, current step details, choices, and blocking warnings without forcing the user to inspect raw command output.
Requirements
Add an Ink component for setup progress.
Show every setup step with status, title, and current detail.
Provide a simple prompt bridge for confirm, input, single choice, and multi choice.
Use keyboard navigation for choices and text entry for inputs.
Exit cleanly when setup completes or is cancelled.
Implementation Specification
Create packages/cli/src/tui/SetupApp.tsx and add renderSetupWizard() to packages/cli/src/tui/app.tsx.
Acceptance Criteria
renderSetupWizard() resolves with final setup state.
The TUI updates as the engine emits state.
Ctrl-C cancels without leaving an Ink session running.
The TUI wraps the setup engine rather than implementing setup behavior itself. This keeps the interactive path and fallback path consistent. A fully custom form framework was considered, but a compact prompt bridge is enough for this wizard and avoids adding another dependency. The trade-off is that text input is basic, but the first version remains maintainable.
File: packages/cli/src/tui/SetupApp.tsx (new file)
Why this file: This component is the setup-specific Ink presentation layer. It renders progress and bridges engine prompt requests to keyboard input.
importReact,{useEffect,useMemo,useState}from'react';import{Box,Text,useApp,useInput}from'ink';import{runSetupEngine,typeSetupPrompts}from'../commands/setup/engine.js';import{createInitialSetupState}from'../commands/setup/state.js';importtype{SetupDecision,SetupRunOptions,SetupWizardState}from'../commands/setup/types.js';interfaceProps{rootDir: string;options: SetupRunOptions;onDone: (state: SetupWizardState)=>void;}typePromptRequest=|{kind: 'confirm';message: string;defaultValue: boolean;resolve: (value: boolean)=>void}|{kind: 'input';message: string;value: string;resolve: (value: string)=>void}|{kind: 'choose';message: string;choices: Array<SetupDecision<string>>;selected: number;resolve: (value: string)=>void}|{kind: 'multi';message: string;choices: Array<SetupDecision<string>>;selected: number;values: Set<string>;resolve: (value: string[])=>void};constSTATUS_TEXT={pending: '[ ]',running: '[~]',complete: '[OK]',warning: '[!]',blocked: '[X]',skipped: '[-]',};functionstatusColor(status: string): string|undefined{if(status==='complete')return'green';if(status==='warning')return'yellow';if(status==='blocked')return'red';if(status==='running')return'cyan';returnundefined;}exportfunctionSetupApp({ rootDir, options, onDone }: Props): React.ReactElement{const{ exit }=useApp();const[state,setState]=useState(()=>createInitialSetupState(rootDir,true));const[message,setMessage]=useState('');const[prompt,setPrompt]=useState<PromptRequest|null>(null);constprompts=useMemo<SetupPrompts>(()=>({confirm: (messageText,defaultValue=false)=>newPromise((resolve)=>{// Store the resolver in React state so the key handler can complete the// engine's promise without coupling engine code to Ink APIs.setPrompt({kind: 'confirm',message: messageText, defaultValue, resolve });}),input: (messageText,defaultValue='')=>newPromise((resolve)=>{setPrompt({kind: 'input',message: messageText,value: defaultValue, resolve });}),choose: (messageText,choices,defaultValue)=>newPromise((resolve)=>{constselected=Math.max(0,choices.findIndex((choice)=>choice.value===defaultValue));setPrompt({kind: 'choose',message: messageText, choices, selected, resolve });}),multiChoose: (messageText,choices,defaults)=>newPromise((resolve)=>{setPrompt({kind: 'multi',message: messageText, choices,selected: 0,values: newSet(defaults), resolve });}),}),[]);useEffect(()=>{letcancelled=false;voidrunSetupEngine(state,options,prompts,{onState: (next)=>{if(!cancelled)setState(next);},onMessage: (nextMessage)=>{if(!cancelled)setMessage(nextMessage);},}).then((finalState)=>{if(cancelled)return;onDone(finalState);exit();}).catch((error: Error)=>{if(cancelled)return;setMessage(`Setup failed: ${error.message}`);});return()=>{cancelled=true;};// Run once. The engine owns progression and reports state through hooks.// eslint-disable-next-line react-hooks/exhaustive-deps},[]);useInput((input,key)=>{if(key.ctrl&&input==='c'){exit();return;}if(!prompt)return;if(prompt.kind==='confirm'){if(input.toLowerCase()==='y'){prompt.resolve(true);setPrompt(null);}if(input.toLowerCase()==='n'){prompt.resolve(false);setPrompt(null);}if(key.return){prompt.resolve(prompt.defaultValue);setPrompt(null);}return;}if(prompt.kind==='input'){if(key.return){prompt.resolve(prompt.value);setPrompt(null);return;}if(key.backspace||key.delete){setPrompt({ ...prompt,value: prompt.value.slice(0,-1)});return;}if(input&&!key.ctrl&&!key.meta)setPrompt({ ...prompt,value: `${prompt.value}${input}`});return;}if(prompt.kind==='choose'||prompt.kind==='multi'){if(key.upArrow)setPrompt({ ...prompt,selected: (prompt.selected-1+prompt.choices.length)%prompt.choices.length});if(key.downArrow)setPrompt({ ...prompt,selected: (prompt.selected+1)%prompt.choices.length});if(prompt.kind==='multi'&&input===' '){constvalue=prompt.choices[prompt.selected]?.value;constvalues=newSet(prompt.values);// Toggle instead of appending duplicates so the selected agent list stays// deterministic for image pulling and agent configuration later.if(values.has(value))values.delete(value);elsevalues.add(value);setPrompt({ ...prompt, values });}if(key.return){if(prompt.kind==='choose')prompt.resolve(prompt.choices[prompt.selected]!.value);elseprompt.resolve([...prompt.values]);setPrompt(null);}}});return(<BoxflexDirection="column"><Textbold>ProPRsetup</Text><TextdimColor>Stackroot: {state.rootDir}</Text><BoxmarginTop={1} flexDirection="column">{state.steps.map((step)=>(<Textkey={step.id}color={statusColor(step.status)}>{STATUS_TEXT[step.status]}{step.title}{step.detail ? ` - ${step.detail}` : ''}</Text>))}</Box>{message ? <BoxmarginTop={1}><Textcolor="magenta">{message}</Text></Box> : null}{prompt ? (<BoxmarginTop={1}flexDirection="column"><Textcolor="cyan"bold>{prompt.message}</Text>{prompt.kind==='confirm' ? <Text>Pressy/n,orEnterfor{prompt.defaultValue ? 'yes' : 'no'}.</Text>:null}{prompt.kind==='input' ? <Text>>{prompt.value}</Text>:null}{(prompt.kind==='choose'||prompt.kind==='multi') ? prompt.choices.map((choice,index)=>{constactive=index===prompt.selected;constchecked=prompt.kind==='multi'&&prompt.values.has(choice.value);return<Textkey={choice.value}color={active ? 'cyan' : undefined}>{active ? '>' : ' '}{prompt.kind==='multi' ? (checked ? '[x]' : '[ ]') : ' '}{choice.label}-{choice.detail}</Text>;}) : null}{prompt.kind==='multi' ? <TextdimColor>Spacetoggles,Entercontinues.</Text>:null}</Box>) : null}</Box>);}
File: packages/cli/src/tui/app.tsx
Why this file: This is the existing Ink entry layer. Adding renderSetupWizard here keeps all terminal UI render functions discoverable from one module.
--- a/packages/cli/src/tui/app.tsx+++ b/packages/cli/src/tui/app.tsx
@@
import { AgentTableApp, AgentTableHub } from './AgentTableApp.js';
+import { SetupApp } from './SetupApp.js';+import type { SetupRunOptions, SetupWizardState } from '../commands/setup/types.js';
@@
export async function renderAgentValidation(
@@
}
++export async function renderSetupWizard(rootDir: string, options: SetupRunOptions): Promise<SetupWizardState> {+ let finalState: SetupWizardState | undefined;+ const instance = render(+ <SetupApp rootDir={rootDir} options={options} onDone={(state) => { finalState = state; }} />,+ { exitOnCtrlC: false }+ );+ await instance.waitUntilExit();+ if (!finalState) {+ // Surface cancellation as an ordinary Error so the command action can print+ // a concise message and avoid pretending setup completed.+ throw new Error('setup cancelled');+ }+ return finalState;+}
Activity
propr-dev commentedon Jun 22, 2026
Suggested Implementation:
Implementation Approach
The TUI wraps the setup engine rather than implementing setup behavior itself. This keeps the interactive path and fallback path consistent. A fully custom form framework was considered, but a compact prompt bridge is enough for this wizard and avoids adding another dependency. The trade-off is that text input is basic, but the first version remains maintainable.
File:
packages/cli/src/tui/SetupApp.tsx(new file)Why this file: This component is the setup-specific Ink presentation layer. It renders progress and bridges engine prompt requests to keyboard input.
File:
packages/cli/src/tui/app.tsxWhy this file: This is the existing Ink entry layer. Adding
renderSetupWizardhere keeps all terminal UI render functions discoverable from one module.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-81602/claude-opus-4-8-add-the-interactive-ink-s-20260622-1013-eiq1599-epic-build-comprehensive-b5cissue-1602-20260622-1013-claude-opus-4-8-eiq🔍 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…