feat(setup): wire setup command into CLI and start command

- Register setup command in CLI index
- Offer setup wizard when running `flynn start` with no config
- Guard telegram log output since telegram is now optional

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
William Valentin
2026-02-10 09:36:58 -08:00
parent d8b7b08270
commit f50d7d69fb
2 changed files with 20 additions and 1 deletions
+18 -1
View File
@@ -11,8 +11,25 @@ export function registerStartCommand(program: Command): void {
const configPath = opts.config ?? getConfigPath();
if (!existsSync(configPath)) {
// Offer setup wizard
const { createInterface } = await import('readline/promises');
const { createPrompter } = await import('./setup/prompts.js');
const rl = createInterface({ input: process.stdin, output: process.stdout });
const p = createPrompter(rl);
const runWizard = await p.confirm(
'No configuration found. Would you like to run the setup wizard?',
true,
);
rl.close();
if (runWizard) {
const { runSetup } = await import('./setup.js');
await runSetup(configPath);
return;
}
console.error(`Config file not found: ${configPath}`);
console.error('Run "flynn doctor" to diagnose, or create a config at ~/.config/flynn/config.yaml');
console.error('Run "flynn setup" to create one, or "flynn doctor" to diagnose.');
process.exit(1);
}