@_xtribe/cli 2.1.7 → 2.1.9
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 +41 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_xtribe/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
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,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TRIBE CLI wrapper for npm users
|
|
5
|
+
* This tries to run the installed tribe binary, or gives installation instructions
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawn } = 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, show installation instructions
|
|
30
|
+
console.log('❌ TRIBE CLI not found');
|
|
31
|
+
console.log('');
|
|
32
|
+
console.log('📦 To install TRIBE CLI, run:');
|
|
33
|
+
console.log(' npx @_xtribe/cli');
|
|
34
|
+
console.log('');
|
|
35
|
+
console.log('💡 Then you can use:');
|
|
36
|
+
console.log(' tribe --version');
|
|
37
|
+
console.log(' tribe status');
|
|
38
|
+
console.log(' tribe login');
|
|
39
|
+
console.log('');
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|