gm-kilo 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/gm-kilo.js +103 -0
- package/package.json +20 -0
package/bin/gm-kilo.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { execSync } from 'child_process';
|
|
7
|
+
|
|
8
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE;
|
|
9
|
+
const kiloConfigPath = path.join(homeDir, '.kilo', 'config.yml');
|
|
10
|
+
|
|
11
|
+
async function setup() {
|
|
12
|
+
console.log('🚀 Setting up gm-kilo (Kilo CLI)...\n');
|
|
13
|
+
|
|
14
|
+
// Step 1: Ensure plugkit is running
|
|
15
|
+
console.log('1️⃣ Bootstrapping plugkit...');
|
|
16
|
+
try {
|
|
17
|
+
const plugkitCmd = process.platform === 'win32'
|
|
18
|
+
? `bun x gm-plugkit@latest spool > /dev/null 2>&1 &`
|
|
19
|
+
: `bun x gm-plugkit@latest spool > /dev/null 2>&1 &`;
|
|
20
|
+
execSync(plugkitCmd, { stdio: 'inherit' });
|
|
21
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
22
|
+
console.log('✅ plugkit started\n');
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.log('⚠️ plugkit may already be running\n');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Step 2: Create Kilo config if needed
|
|
28
|
+
console.log('2️⃣ Configuring Kilo CLI...');
|
|
29
|
+
try {
|
|
30
|
+
const configDir = path.dirname(kiloConfigPath);
|
|
31
|
+
if (!fs.existsSync(configDir)) {
|
|
32
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let configContent = '';
|
|
36
|
+
if (fs.existsSync(kiloConfigPath)) {
|
|
37
|
+
configContent = fs.readFileSync(kiloConfigPath, 'utf8');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Add gm agent to YAML config
|
|
41
|
+
if (!configContent.includes('gm:')) {
|
|
42
|
+
const gmConfig = `
|
|
43
|
+
agents:
|
|
44
|
+
gm:
|
|
45
|
+
enabled: true
|
|
46
|
+
entry: gm-skill
|
|
47
|
+
orchestrator: plugkit
|
|
48
|
+
permissions:
|
|
49
|
+
- Read(.gm)
|
|
50
|
+
- Write(.gm)
|
|
51
|
+
- Bash(*plugkit*)
|
|
52
|
+
`;
|
|
53
|
+
configContent += gmConfig;
|
|
54
|
+
fs.writeFileSync(kiloConfigPath, configContent);
|
|
55
|
+
}
|
|
56
|
+
console.log('✅ Kilo CLI configured\n');
|
|
57
|
+
} catch (e) {
|
|
58
|
+
console.error('❌ Failed to configure Kilo CLI:', e.message);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.log('🎉 gm-kilo setup complete!');
|
|
63
|
+
console.log('\nNext steps:');
|
|
64
|
+
console.log(' 1. Run: kilo dev');
|
|
65
|
+
console.log(' 2. GM agent will initialize automatically\n');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function verify() {
|
|
69
|
+
console.log('🔍 Verifying gm-kilo installation...\n');
|
|
70
|
+
|
|
71
|
+
if (fs.existsSync(kiloConfigPath)) {
|
|
72
|
+
const config = fs.readFileSync(kiloConfigPath, 'utf8');
|
|
73
|
+
if (config.includes('gm:')) {
|
|
74
|
+
console.log('✅ GM agent configured for Kilo CLI\n');
|
|
75
|
+
} else {
|
|
76
|
+
console.log('⚠️ GM agent not configured\n');
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
console.log('⚠️ Kilo CLI config not found\n');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function main() {
|
|
84
|
+
const cmd = process.argv[2] || 'setup';
|
|
85
|
+
|
|
86
|
+
switch (cmd) {
|
|
87
|
+
case 'setup':
|
|
88
|
+
case 'install':
|
|
89
|
+
await setup();
|
|
90
|
+
break;
|
|
91
|
+
case 'verify':
|
|
92
|
+
await verify();
|
|
93
|
+
break;
|
|
94
|
+
default:
|
|
95
|
+
console.log('Usage: gm-kilo <setup|verify>');
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
main().catch(e => {
|
|
101
|
+
console.error('Error:', e);
|
|
102
|
+
process.exit(1);
|
|
103
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gm-kilo",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Kilo CLI integration for GM orchestration engine",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"gm-kilo": "./bin/gm-kilo.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"setup": "node bin/gm-kilo.js setup",
|
|
11
|
+
"install": "node bin/gm-kilo.js install",
|
|
12
|
+
"verify": "node bin/gm-kilo.js verify"
|
|
13
|
+
},
|
|
14
|
+
"keywords": ["gm", "kilo-cli", "agent", "orchestration"],
|
|
15
|
+
"author": "admin@coas.co.za",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|