diff --git a/v3/@claude-flow/cli/src/commands/init.ts b/v3/@claude-flow/cli/src/commands/init.ts index 4d01a14f3c..1b63b59907 100644 --- a/v3/@claude-flow/cli/src/commands/init.ts +++ b/v3/@claude-flow/cli/src/commands/init.ts @@ -1082,12 +1082,24 @@ const initClaudeAction = async (ctx: CommandContext): Promise => } } + 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 => 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');