FN-5805: add fn onboard command with sequential runOnboard flow

Add a new interactive onboarding CLI flow that guides first-time setup end to end.

- add new `fn onboard` command wiring in CLI entrypoint and usage help
- implement `runOnboard()` with sequential prompts for central DB, provider auth, init, test mode, and project maxConcurrent
- persist `cliOnboardingCompletedAt` marker in global settings with `--force` rerun support
- add onboarding command tests and global settings regression coverage
- document `fn onboard` usage and options in CLI reference
- add a minor changeset for published `@runfusion/fusion`

Files changed:
 .changeset/fn-5805-onboard-command.md              |   5 +
 docs/cli-reference.md                              |  20 ++
 packages/cli/src/bin.ts                            |  10 +
 packages/cli/src/commands/__tests__/onboard.test.ts| 193 ++++++++++++++++
 packages/cli/src/commands/onboard.ts               | 249 +++++++++++++++++++++
 packages/core/src/__tests__/global-settings.test.ts|  11 +
 packages/core/src/index.ts                         |   2 +-
 packages/core/src/settings-schema.ts               |   1 +
 packages/core/src/types.ts                         |   4 +
 9 files changed, 494 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5805

Fusion-Task-Lineage: b1bcaf27-9bd7-4569-b685-225a97fa1200
This commit is contained in:
gsxdsm
2026-06-01 01:42:19 -07:00
parent 9ba3a8e453
commit e854d33375
9 changed files with 494 additions and 1 deletions

View File

@@ -219,6 +219,17 @@ describe("GlobalSettingsStore", () => {
expect(settings.themeMode).toBe("dark"); // preserved default
});
it("round-trips cliOnboardingCompletedAt without changing setupComplete", async () => {
await store.init();
const marker = "2026-05-31T00:00:00.000Z";
await store.updateSettings({ cliOnboardingCompletedAt: marker });
const settings = await store.getSettings();
expect(settings.cliOnboardingCompletedAt).toBe(marker);
expect(settings.setupComplete).toBeUndefined();
});
it("round-trips testMode in global settings", async () => {
await store.init();