-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.js
More file actions
47 lines (40 loc) · 1.08 KB
/
cli.js
File metadata and controls
47 lines (40 loc) · 1.08 KB
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
43
44
45
46
47
#!/usr/bin/env node
import { readFileSync } from 'fs';
import { join } from 'path';
import { fileURLToPath } from 'url';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf-8'));
const commands = {
help() {
console.log(`gm v${pkg.version} - AI State Machine Agent`);
console.log('Usage: gm [command]');
console.log('Commands:');
console.log(' help Show this help');
console.log(' version Show version');
console.log(' status Show status');
console.log(' config Show config');
},
version() {
console.log(pkg.version);
},
status() {
console.log('Status: Active');
console.log('Mode: Autonomous');
console.log('State: Ready');
},
config() {
console.log(JSON.stringify({
enabled: true,
autoActivate: true,
contextWindow: 200000
}, null, 2));
}
};
const cmd = process.argv[2] || 'help';
if (commands[cmd]) {
commands[cmd]();
} else {
console.error(`Unknown command: ${cmd}`);
commands.help();
process.exit(1);
}