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:
+18
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user