34 lines
770 B
JavaScript
34 lines
770 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Fido — Minimal Coding Assistant
|
|
*
|
|
* Application entry point. The interactive loop lives in ./repl.js, with the
|
|
* system prompt, transcript rendering, and slash commands in sibling modules.
|
|
*
|
|
* Usage:
|
|
* node src/fido.js
|
|
* node src/fido.js /path/to/project
|
|
*/
|
|
|
|
import chalk from 'chalk';
|
|
|
|
import { API_KEY } from './config.js';
|
|
import { unmount } from './ui/index.js';
|
|
import { runRepl } from './repl.js';
|
|
|
|
if (!API_KEY) {
|
|
console.error(chalk.red.bold('\n✖ Missing OPENROUTER_API_KEY — add it to .env\n'));
|
|
process.exit(1);
|
|
}
|
|
|
|
runRepl().catch(async (err) => {
|
|
try {
|
|
await unmount();
|
|
} catch {
|
|
/* ignore */
|
|
}
|
|
console.error(chalk.red.bold('\nFATAL: ' + err.message));
|
|
process.exit(1);
|
|
});
|