-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
33 lines (29 loc) · 831 Bytes
/
Copy pathindex.ts
File metadata and controls
33 lines (29 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { formatCliHelp, parseCliArgs } from "./cli";
import { AIModels } from "./consts";
import { questionnaires } from "./questionnaires/index";
import { runCliSelection } from "./runner";
if (import.meta.main) {
try {
const options = parseCliArgs(Bun.argv.slice(2));
if (options.help) {
console.log(formatCliHelp());
} else {
if (options.listQuestionnaires) {
for (const definition of questionnaires) {
console.log(`${definition.id} | ${definition.data.title}`);
}
}
if (options.listModels) {
for (const model of AIModels) {
console.log(model);
}
}
if (!options.listQuestionnaires && !options.listModels) {
await runCliSelection(options);
}
}
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
}