@_xtribe/cli 2.1.7 ā 2.1.8
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/package.json +3 -2
- package/tribe.js +44 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_xtribe/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "TRIBE - Track, measure and optimize your AI coding agents to become 10x faster",
|
|
5
5
|
"main": "install-tribe.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"tribe": "./
|
|
7
|
+
"tribe": "./tribe.js",
|
|
8
8
|
"cli": "./index.js",
|
|
9
9
|
"install-tribe": "./install-tribe.js",
|
|
10
10
|
"setup-path": "./setup-path.js"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"index.js",
|
|
41
|
+
"tribe.js",
|
|
41
42
|
"install-tribe.js",
|
|
42
43
|
"install-tribe-minimal.js",
|
|
43
44
|
"install-tribe-autolaunch.js",
|
package/tribe.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TRIBE CLI wrapper for npm users
|
|
5
|
+
* This tries to run the installed tribe binary, or installs it if not found
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawn, execSync } = require('child_process');
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
|
|
13
|
+
const homeDir = os.homedir();
|
|
14
|
+
const tribeDir = path.join(homeDir, '.tribe');
|
|
15
|
+
const tribeBinPath = path.join(tribeDir, 'bin', 'tribe');
|
|
16
|
+
|
|
17
|
+
// Check if tribe is already installed
|
|
18
|
+
if (fs.existsSync(tribeBinPath)) {
|
|
19
|
+
// Run the installed tribe binary
|
|
20
|
+
const child = spawn(tribeBinPath, process.argv.slice(2), {
|
|
21
|
+
stdio: 'inherit',
|
|
22
|
+
env: process.env
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
child.on('exit', (code) => {
|
|
26
|
+
process.exit(code || 0);
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
// Tribe not installed, run installer first
|
|
30
|
+
console.log('š TRIBE CLI not found. Installing...\n');
|
|
31
|
+
|
|
32
|
+
const installerPath = path.join(__dirname, 'install-tribe.js');
|
|
33
|
+
const child = spawn(process.execPath, [installerPath, ...process.argv.slice(2)], {
|
|
34
|
+
stdio: 'inherit',
|
|
35
|
+
env: process.env
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
child.on('exit', (code) => {
|
|
39
|
+
if (code === 0) {
|
|
40
|
+
console.log('\nā
Installation complete! You can now run: tribe');
|
|
41
|
+
}
|
|
42
|
+
process.exit(code || 0);
|
|
43
|
+
});
|
|
44
|
+
}
|