fix(init): print the project snapshot after the optional prompts (#4875)

#4870 added the telemetry opt-in after capability enrollment, which left
the #4871 snapshot and paste-ready prompt above two questions. Move it
below them so it is the last thing init prints.

Co-authored-by: r <r@x>
This commit is contained in:
rUvandr authored and GitHub committed 2026-11-06 16:11:14 -06:00
1 parent 583181d441
commit 3fe9d70ba7
1 file changed
+13 -11
+13 -11
View File
@@ -1082,12 +1082,24 @@ const initClaudeAction = async (ctx: CommandContext): Promise<CommandResult> =>
}
}
if (ctx.flags.format === 'json') {
output.printJson(result);
}
await offerCapabilityEnrollment(ctx);
await offerTelemetryOptIn(ctx);
await noteInitCompleted();
if (!startDaemon && !startAll && ctx.flags.format !== 'json') {
// End on something about the user's own repo, not a list of commands
// (adoption plan item 1). Local-only, time-capped, never throws.
// (adoption plan item 1). Printed after the optional prompts so it is
// the last thing on screen. Local-only, time-capped, never throws.
const { snapshotProject, snapshotLines, firstPrompt } = await import('../init/first-win.js');
const snap = snapshotProject(ctx.cwd);
const lines = snapshotLines(snap);
output.writeln();
if (lines.length) {
output.writeln(output.bold('Your project:'));
output.printList(lines);
@@ -1100,16 +1112,6 @@ const initClaudeAction = async (ctx: CommandContext): Promise<CommandResult> =>
output.writeln(output.dim(`Background workers: ${bin} daemon start · health check: ${bin} doctor`));
}
if (ctx.flags.format === 'json') {
output.printJson(result);
}
await offerCapabilityEnrollment(ctx);
await offerTelemetryOptIn(ctx);
await noteInitCompleted();
return { success: true, data: result };
} catch (error) {
spinner.fail('Initialization failed');