gm-gc 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-gc.js +96 -0
- package/package.json +20 -0
package/bin/gm-gc.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
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 geminiConfigPath = path.join(homeDir, '.gemini-cli', 'config.json');
|
|
10
|
+
|
|
11
|
+
async function setup() {
|
|
12
|
+
console.log('🚀 Setting up gm-gc (Gemini 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 Gemini CLI config if needed
|
|
28
|
+
console.log('2️⃣ Configuring Gemini CLI...');
|
|
29
|
+
try {
|
|
30
|
+
const configDir = path.dirname(geminiConfigPath);
|
|
31
|
+
if (!fs.existsSync(configDir)) {
|
|
32
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let config = {};
|
|
36
|
+
if (fs.existsSync(geminiConfigPath)) {
|
|
37
|
+
config = JSON.parse(fs.readFileSync(geminiConfigPath, 'utf8'));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
config.agents = config.agents || {};
|
|
41
|
+
config.agents['gm'] = {
|
|
42
|
+
enabled: true,
|
|
43
|
+
entry: 'gm-skill',
|
|
44
|
+
orchestrator: 'plugkit',
|
|
45
|
+
permissionsRequired: ['Read(.gm)', 'Write(.gm)', 'Bash(*plugkit*)']
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
fs.writeFileSync(geminiConfigPath, JSON.stringify(config, null, 2));
|
|
49
|
+
console.log('✅ Gemini CLI configured\n');
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.error('❌ Failed to configure Gemini CLI:', e.message);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log('🎉 gm-gc setup complete!');
|
|
56
|
+
console.log('\nNext steps:');
|
|
57
|
+
console.log(' 1. Run: gemini-cli');
|
|
58
|
+
console.log(' 2. GM agent will initialize automatically\n');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function verify() {
|
|
62
|
+
console.log('🔍 Verifying gm-gc installation...\n');
|
|
63
|
+
|
|
64
|
+
if (fs.existsSync(geminiConfigPath)) {
|
|
65
|
+
const config = JSON.parse(fs.readFileSync(geminiConfigPath, 'utf8'));
|
|
66
|
+
if (config.agents?.gm?.enabled) {
|
|
67
|
+
console.log('✅ GM agent configured for Gemini CLI\n');
|
|
68
|
+
} else {
|
|
69
|
+
console.log('⚠️ GM agent not enabled\n');
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
console.log('⚠️ Gemini CLI config not found\n');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function main() {
|
|
77
|
+
const cmd = process.argv[2] || 'setup';
|
|
78
|
+
|
|
79
|
+
switch (cmd) {
|
|
80
|
+
case 'setup':
|
|
81
|
+
case 'install':
|
|
82
|
+
await setup();
|
|
83
|
+
break;
|
|
84
|
+
case 'verify':
|
|
85
|
+
await verify();
|
|
86
|
+
break;
|
|
87
|
+
default:
|
|
88
|
+
console.log('Usage: gm-gc <setup|verify>');
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
main().catch(e => {
|
|
94
|
+
console.error('Error:', e);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gm-gc",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Gemini CLI integration for GM orchestration engine",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"gm-gc": "./bin/gm-gc.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"setup": "node bin/gm-gc.js setup",
|
|
11
|
+
"install": "node bin/gm-gc.js install",
|
|
12
|
+
"verify": "node bin/gm-gc.js verify"
|
|
13
|
+
},
|
|
14
|
+
"keywords": ["gm", "gemini-cli", "agent", "orchestration"],
|
|
15
|
+
"author": "admin@coas.co.za",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|