-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·42 lines (32 loc) · 1007 Bytes
/
index.js
File metadata and controls
executable file
·42 lines (32 loc) · 1007 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
34
35
36
37
38
39
40
41
42
#!/usr/bin/env node
import { Summarizer } from './src/summarizer.js';
import minimist from 'minimist';
import fs from 'fs/promises';
import path from 'path';
import packageData from './package.json' assert { type: 'json' };
const { version } = packageData;
async function run() {
console.log(`🚀 Codebase Summary Bot v${version}\n==============================`);
const args = minimist(process.argv.slice(2));
const projectRoot = process.cwd();
const outputFile = args.output || 'codebase-summary.json';
const limit = parseInt(args.limit || '100');
try {
const summarizer = new Summarizer({
projectRoot,
outputFile,
limit
});
const summary = await summarizer.analyze();
await fs.writeFile(
path.join(projectRoot, outputFile),
JSON.stringify(summary, null, 2),
'utf8'
);
console.log(`✅ Summary written to ${outputFile}`);
} catch (err) {
console.error('💥 Summary failed:', err);
process.exit(1);
}
}
run();