diff --git a/cli/src/commands/onboard.ts b/cli/src/commands/onboard.ts index f283c636..d9547ded 100644 --- a/cli/src/commands/onboard.ts +++ b/cli/src/commands/onboard.ts @@ -24,6 +24,7 @@ type SetupMode = "quickstart" | "advanced"; type OnboardOptions = { config?: string; run?: boolean; + yes?: boolean; invokedByRun?: boolean; }; @@ -80,27 +81,32 @@ export async function onboard(opts: OnboardOptions): Promise { } } - const setupModeChoice = await p.select({ - message: "Choose setup path", - options: [ - { - value: "quickstart" as const, - label: "Quickstart", - hint: "Recommended: local defaults + ready to run", - }, - { - value: "advanced" as const, - label: "Advanced setup", - hint: "Customize database, server, storage, and more", - }, - ], - initialValue: "quickstart", - }); - if (p.isCancel(setupModeChoice)) { - p.cancel("Setup cancelled."); - return; + let setupMode: SetupMode = "quickstart"; + if (opts.yes) { + p.log.message(pc.dim("`--yes` enabled: using Quickstart defaults.")); + } else { + const setupModeChoice = await p.select({ + message: "Choose setup path", + options: [ + { + value: "quickstart" as const, + label: "Quickstart", + hint: "Recommended: local defaults + ready to run", + }, + { + value: "advanced" as const, + label: "Advanced setup", + hint: "Customize database, server, storage, and more", + }, + ], + initialValue: "quickstart", + }); + if (p.isCancel(setupModeChoice)) { + p.cancel("Setup cancelled."); + return; + } + setupMode = setupModeChoice as SetupMode; } - const setupMode = setupModeChoice as SetupMode; let llm: PaperclipConfig["llm"] | undefined; let { @@ -260,7 +266,7 @@ export async function onboard(opts: OnboardOptions): Promise { await bootstrapCeoInvite({ config: configPath }); } - let shouldRunNow = opts.run === true; + let shouldRunNow = opts.run === true || opts.yes === true; if (!shouldRunNow && !opts.invokedByRun && process.stdin.isTTY && process.stdout.isTTY) { const answer = await p.confirm({ message: "Start Paperclip now?", diff --git a/cli/src/index.ts b/cli/src/index.ts index 50ad8d88..e069f734 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -40,6 +40,7 @@ program .description("Interactive first-run setup wizard") .option("-c, --config ", "Path to config file") .option("-d, --data-dir ", DATA_DIR_OPTION_HELP) + .option("-y, --yes", "Accept defaults (quickstart + start immediately)", false) .option("--run", "Start Paperclip immediately after saving config", false) .action(onboard); diff --git a/docs/cli/setup-commands.md b/docs/cli/setup-commands.md index 95eb1b79..7dc5cd6a 100644 --- a/docs/cli/setup-commands.md +++ b/docs/cli/setup-commands.md @@ -44,6 +44,12 @@ Start immediately after onboarding: pnpm paperclipai onboard --run ``` +Non-interactive defaults + immediate start (opens browser on server listen): + +```sh +pnpm paperclipai onboard --yes +``` + ## `paperclipai doctor` Health checks with optional auto-repair: