[nexus] fix(04-03): add root directory prompt to CLI onboarding (ONBD-06)

This commit is contained in:
Mikkel Georgsen 2026-03-31 10:58:05 +02:00
parent 988cd117e9
commit e6ba3cc9ff

View file

@ -630,7 +630,18 @@ export async function onboard(opts: OnboardOptions): Promise<void> {
const { runCommand } = await import("./run.js");
// [nexus] Start bootstrap concurrently — health-check poll waits for server readiness
const serverUrl = `http://${server.host}:${server.port}`;
const rootDir = process.cwd();
// [nexus] Prompt for project root directory (mirrors UI wizard flow)
let rootDir = process.cwd();
if (process.stdin.isTTY && process.stdout.isTTY) {
const answer = await p.text({
message: "Project root directory:",
initialValue: process.cwd(),
placeholder: process.cwd(),
});
if (!p.isCancel(answer) && answer) {
rootDir = answer;
}
}
bootstrapNexusAgents(serverUrl, rootDir).catch((err: unknown) => {
// [nexus] Bootstrap failures are non-fatal
console.warn("[nexus] Agent bootstrap error:", err instanceof Error ? err.message : String(err));