forked from BeOnAuto/auto-engineer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
27 lines (21 loc) · 687 Bytes
/
index.ts
File metadata and controls
27 lines (21 loc) · 687 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
import 'dotenv/config';
import path from 'path';
import { fileURLToPath } from 'url';
import { existsSync } from 'fs';
import { runFlows } from '../agent/runFlows';
const __filename = fileURLToPath(import.meta.url);
const isMain = process.argv[1] === __filename;
if (isMain) {
const base = process.argv[2];
if (!base) {
console.error('Usage: tsx src/cli/index.ts path/to/server/root');
process.exit(1);
}
const serverRoot = path.resolve(base);
const flowsDir = path.join(serverRoot, 'src', 'domain', 'flows');
if (!existsSync(flowsDir)) {
console.error(`❌ Flows directory not found at: ${flowsDir}`);
process.exit(1);
}
void runFlows(flowsDir);
}