Merge pull request #1291 from gsd-build/feat/multi-runtime-select-1281

feat: multi-runtime selection in interactive installer
This commit is contained in:
Tom Boucher
2026-03-21 10:05:56 -04:00
committed by GitHub
3 changed files with 181 additions and 27 deletions

View File

@@ -4285,6 +4285,17 @@ function promptRuntime(callback) {
}
});
const runtimeMap = {
'1': 'claude',
'2': 'opencode',
'3': 'gemini',
'4': 'codex',
'5': 'copilot',
'6': 'antigravity',
'7': 'cursor'
};
const allRuntimes = ['claude', 'opencode', 'gemini', 'codex', 'copilot', 'antigravity', 'cursor'];
console.log(` ${yellow}Which runtime(s) would you like to install for?${reset}\n\n ${cyan}1${reset}) Claude Code ${dim}(~/.claude)${reset}
${cyan}2${reset}) OpenCode ${dim}(~/.config/opencode)${reset} - open source, free models
${cyan}3${reset}) Gemini ${dim}(~/.gemini)${reset}
@@ -4293,29 +4304,32 @@ function promptRuntime(callback) {
${cyan}6${reset}) Antigravity ${dim}(~/.gemini/antigravity)${reset}
${cyan}7${reset}) Cursor ${dim}(~/.cursor)${reset}
${cyan}8${reset}) All
${dim}Select multiple: 1,4,6 or 1 4 6${reset}
`);
rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
answered = true;
rl.close();
const choice = answer.trim() || '1';
if (choice === '8') {
callback(['claude', 'opencode', 'gemini', 'codex', 'copilot', 'antigravity', 'cursor']);
} else if (choice === '7') {
callback(['cursor']);
} else if (choice === '6') {
callback(['antigravity']);
} else if (choice === '5') {
callback(['copilot']);
} else if (choice === '4') {
callback(['codex']);
} else if (choice === '3') {
callback(['gemini']);
} else if (choice === '2') {
callback(['opencode']);
} else {
callback(['claude']);
const input = answer.trim() || '1';
// "All" shortcut
if (input === '8') {
callback(allRuntimes);
return;
}
// Parse comma-separated, space-separated, or single choice
const choices = input.split(/[\s,]+/).filter(Boolean);
const selected = [];
for (const c of choices) {
const runtime = runtimeMap[c];
if (runtime && !selected.includes(runtime)) {
selected.push(runtime);
}
}
callback(selected.length > 0 ? selected : ['claude']);
});
}