FN-5813: update fn onboard help and CLI docs
Align onboarding HELP text and CLI reference with current fn onboarding behavior. - Document onboarding auto-launch conditions around missing central DB and interactive command flow. - Add and clarify onboarding escape hatches: --skip-onboarding and FUSION_SKIP_ONBOARDING. - Add an onboard docs parity test to keep HELP and docs aligned for key onboarding terms. - Add a patch changeset for @runfusion/fusion describing the documentation/help update. Files changed: .changeset/fn-5813-onboard-docs.md | 5 ++++ docs/cli-reference.md | 21 +++++++++----- packages/cli/src/bin.ts | 4 ++- packages/cli/src/commands/__tests__/onboard-docs.test.ts | 33 ++++++++++++++++++++++ 4 files changed, 55 insertions(+), 8 deletions(-) Fusion-Task-Id: FN-5813 Fusion-Task-Lineage: 14a74ad9-5f09-471a-878d-aa120a28ef41
This commit is contained in:
@@ -256,7 +256,9 @@ fn — AI-orchestrated task board
|
||||
Usage:
|
||||
fn Launch the dashboard (same as fn dashboard)
|
||||
fn init [opts] Initialize a new fn project (--name, --path, --git)
|
||||
fn onboard [--force] Run the interactive onboarding wizard
|
||||
fn onboard [--force] [--skip-onboarding]
|
||||
Run onboarding on demand; auto-launch runs before interactive commands when central DB is missing,
|
||||
and auto-skips for serve/daemon, non-TTY, --skip-onboarding, and FUSION_SKIP_ONBOARDING
|
||||
fn dashboard Start the board web UI
|
||||
fn dashboard --paused Start with automation paused
|
||||
fn dashboard --dev Start web UI only (no AI engine)
|
||||
|
||||
33
packages/cli/src/commands/__tests__/onboard-docs.test.ts
Normal file
33
packages/cli/src/commands/__tests__/onboard-docs.test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const binSource = readFileSync(resolve(__dirname, "../../bin.ts"), "utf8");
|
||||
const cliReference = readFileSync(resolve(__dirname, "../../../../../docs/cli-reference.md"), "utf8");
|
||||
|
||||
function extractOnboardSection(markdown: string): string {
|
||||
const start = markdown.indexOf("## `fn onboard`");
|
||||
const end = markdown.indexOf("---", start);
|
||||
return start >= 0 ? markdown.slice(start, end >= 0 ? end : undefined) : "";
|
||||
}
|
||||
|
||||
describe("onboard help/docs parity", () => {
|
||||
it("always documents fn onboard and --force in both HELP and CLI reference", () => {
|
||||
const onboardDocs = extractOnboardSection(cliReference);
|
||||
|
||||
expect(binSource).toContain("fn onboard");
|
||||
expect(onboardDocs).toContain("fn onboard");
|
||||
|
||||
expect(binSource).toContain("--force");
|
||||
expect(onboardDocs).toContain("--force");
|
||||
});
|
||||
|
||||
it("keeps conditional onboarding escape hatches in parity between HELP and docs", () => {
|
||||
const onboardDocs = extractOnboardSection(cliReference);
|
||||
const parityTerms = ["--skip-onboarding", "FUSION_SKIP_ONBOARDING"];
|
||||
|
||||
for (const term of parityTerms) {
|
||||
expect(binSource.includes(term)).toBe(onboardDocs.includes(term));
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user