@_xtribe/cli 2.0.3 → 2.0.5
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/README.md +51 -174
- package/index.js +20 -0
- package/install-tribe-autolaunch.js +272 -0
- package/install-tribe-minimal.js +171 -0
- package/install-tribe.js +162 -41
- package/install.sh +52 -0
- package/package.json +22 -22
- package/setup-path.js +105 -0
- package/tribe-deployment.yaml +761 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
const { execSync } = require('child_process');
|
|
7
|
+
const https = require('https');
|
|
8
|
+
const http = require('http');
|
|
9
|
+
|
|
10
|
+
const platform = os.platform();
|
|
11
|
+
const arch = process.arch === 'x64' ? 'amd64' : process.arch;
|
|
12
|
+
const homeDir = os.homedir();
|
|
13
|
+
const tribeDir = path.join(homeDir, '.tribe');
|
|
14
|
+
const binDir = path.join(tribeDir, 'bin');
|
|
15
|
+
|
|
16
|
+
console.log(`TRIBE Minimal Installer - Linux MVP`);
|
|
17
|
+
console.log(`Platform: ${platform} (${arch})`);
|
|
18
|
+
console.log(`Installing to: ${binDir}`);
|
|
19
|
+
|
|
20
|
+
// Create bin directory
|
|
21
|
+
if (!fs.existsSync(binDir)) {
|
|
22
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Download function
|
|
26
|
+
async function downloadFile(url, dest) {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
const file = fs.createWriteStream(dest);
|
|
29
|
+
const protocol = url.startsWith('https') ? https : http;
|
|
30
|
+
|
|
31
|
+
console.log(`Downloading from: ${url}`);
|
|
32
|
+
|
|
33
|
+
const request = protocol.get(url, (response) => {
|
|
34
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
35
|
+
file.close();
|
|
36
|
+
fs.unlinkSync(dest);
|
|
37
|
+
return downloadFile(response.headers.location, dest).then(resolve).catch(reject);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (response.statusCode !== 200) {
|
|
41
|
+
file.close();
|
|
42
|
+
fs.unlinkSync(dest);
|
|
43
|
+
reject(new Error(`HTTP ${response.statusCode}: ${response.statusMessage}`));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
response.pipe(file);
|
|
48
|
+
|
|
49
|
+
file.on('finish', () => {
|
|
50
|
+
file.close();
|
|
51
|
+
resolve();
|
|
52
|
+
});
|
|
53
|
+
}).on('error', (err) => {
|
|
54
|
+
fs.unlinkSync(dest);
|
|
55
|
+
reject(err);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function installTribe() {
|
|
61
|
+
const tribeDest = path.join(binDir, 'tribe');
|
|
62
|
+
|
|
63
|
+
// If TRIBE_TEST_BINARY is set, copy it instead of downloading
|
|
64
|
+
if (process.env.TRIBE_TEST_BINARY && fs.existsSync(process.env.TRIBE_TEST_BINARY)) {
|
|
65
|
+
console.log('Using test binary from:', process.env.TRIBE_TEST_BINARY);
|
|
66
|
+
fs.copyFileSync(process.env.TRIBE_TEST_BINARY, tribeDest);
|
|
67
|
+
fs.chmodSync(tribeDest, '755');
|
|
68
|
+
console.log('✓ TRIBE CLI installed from test binary');
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Download from GitHub releases
|
|
73
|
+
const url = `https://github.com/TRIBE-INC/releases/releases/latest/download/tribe-${platform}-${arch}`;
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
await downloadFile(url, tribeDest);
|
|
77
|
+
|
|
78
|
+
const stats = fs.statSync(tribeDest);
|
|
79
|
+
console.log(`Downloaded file size: ${stats.size} bytes`);
|
|
80
|
+
|
|
81
|
+
if (stats.size < 1000000) { // Less than 1MB is suspiciously small
|
|
82
|
+
throw new Error('Downloaded file is too small, likely not a valid binary');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
fs.chmodSync(tribeDest, '755');
|
|
86
|
+
|
|
87
|
+
// Try to run version
|
|
88
|
+
try {
|
|
89
|
+
const version = execSync(`${tribeDest} version`, { encoding: 'utf8' });
|
|
90
|
+
console.log(`✓ TRIBE CLI installed successfully: ${version.trim()}`);
|
|
91
|
+
} catch (e) {
|
|
92
|
+
console.log('✓ TRIBE CLI installed (version check failed - may need different architecture)');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return true;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.error(`✗ Failed to install TRIBE CLI: ${error.message}`);
|
|
98
|
+
if (fs.existsSync(tribeDest)) {
|
|
99
|
+
fs.unlinkSync(tribeDest);
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Update PATH
|
|
106
|
+
function updatePath() {
|
|
107
|
+
// Create tribe-env.sh script
|
|
108
|
+
const tribeEnvPath = path.join(tribeDir, 'tribe-env.sh');
|
|
109
|
+
const envScriptContent = `#!/bin/bash
|
|
110
|
+
# TRIBE CLI Environment Setup
|
|
111
|
+
# Auto-generated by TRIBE installer
|
|
112
|
+
|
|
113
|
+
# Add TRIBE bin directory to PATH if not already present
|
|
114
|
+
TRIBE_BIN_DIR="$HOME/.tribe/bin"
|
|
115
|
+
|
|
116
|
+
if [[ -d "$TRIBE_BIN_DIR" ]] && [[ ":$PATH:" != *":$TRIBE_BIN_DIR:"* ]]; then
|
|
117
|
+
export PATH="$TRIBE_BIN_DIR:$PATH"
|
|
118
|
+
fi
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
fs.writeFileSync(tribeEnvPath, envScriptContent);
|
|
123
|
+
fs.chmodSync(tribeEnvPath, '755');
|
|
124
|
+
console.log('✓ Created tribe-env.sh environment script');
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.log(`⚠ Failed to create tribe-env.sh: ${error.message}`);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Update shell config
|
|
131
|
+
const shell = process.env.SHELL || '/bin/bash';
|
|
132
|
+
const rcFile = shell.includes('zsh') ? '.zshrc' : '.bashrc';
|
|
133
|
+
const rcPath = path.join(homeDir, rcFile);
|
|
134
|
+
const sourceCommand = 'source ~/.tribe/tribe-env.sh';
|
|
135
|
+
|
|
136
|
+
try {
|
|
137
|
+
const rcContent = fs.existsSync(rcPath) ? fs.readFileSync(rcPath, 'utf8') : '';
|
|
138
|
+
if (!rcContent.includes(sourceCommand)) {
|
|
139
|
+
fs.appendFileSync(rcPath, `\n# TRIBE CLI\n${sourceCommand}\n`);
|
|
140
|
+
console.log(`✓ Updated ${rcFile} to source tribe-env.sh`);
|
|
141
|
+
} else {
|
|
142
|
+
console.log(`✓ ${rcFile} already configured`);
|
|
143
|
+
}
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.log(`⚠ Failed to update ${rcFile}: ${error.message}`);
|
|
146
|
+
console.log('Please manually add this line to your shell config:');
|
|
147
|
+
console.log(` ${sourceCommand}`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Main
|
|
152
|
+
async function main() {
|
|
153
|
+
updatePath();
|
|
154
|
+
const success = await installTribe();
|
|
155
|
+
|
|
156
|
+
if (success) {
|
|
157
|
+
console.log('\n✓ Installation complete!');
|
|
158
|
+
console.log(`\nNext steps:`);
|
|
159
|
+
console.log(`1. Run: source ~/.${process.env.SHELL?.includes('zsh') ? 'zshrc' : 'bashrc'}`);
|
|
160
|
+
console.log(`2. Run: tribe version`);
|
|
161
|
+
process.exit(0);
|
|
162
|
+
} else {
|
|
163
|
+
console.error('\n✗ Installation failed');
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
main().catch(err => {
|
|
169
|
+
console.error('Installation error:', err);
|
|
170
|
+
process.exit(1);
|
|
171
|
+
});
|
package/install-tribe.js
CHANGED
|
@@ -639,13 +639,30 @@ async function installTribeCLI() {
|
|
|
639
639
|
// Multiple sources for reliability
|
|
640
640
|
// For testing, use a direct URL to our releases folder
|
|
641
641
|
const isTestEnv = process.env.TRIBE_TEST_BINARY_URL;
|
|
642
|
+
const testBinary = process.env.TRIBE_TEST_BINARY;
|
|
642
643
|
const githubRepo = process.env.TRIBE_INSTALLER_REPO || 'TRIBE-INC/releases';
|
|
643
644
|
|
|
645
|
+
// If we have a test binary file, use it directly
|
|
646
|
+
if (testBinary && fs.existsSync(testBinary)) {
|
|
647
|
+
spinner.text = 'Using test binary...';
|
|
648
|
+
fs.copyFileSync(testBinary, tribeDest);
|
|
649
|
+
fs.chmodSync(tribeDest, '755');
|
|
650
|
+
spinner.succeed('✓ TRIBE CLI installed from test binary');
|
|
651
|
+
return true;
|
|
652
|
+
}
|
|
653
|
+
|
|
644
654
|
let downloadUrl = '';
|
|
645
655
|
|
|
646
656
|
try {
|
|
647
|
-
|
|
648
|
-
|
|
657
|
+
const versionChannel = global.versionChannel || 'latest';
|
|
658
|
+
spinner.text = `Fetching ${versionChannel} release information from GitHub...`;
|
|
659
|
+
const response = await fetch(`https://api.github.com/repos/${githubRepo}/releases`, {
|
|
660
|
+
headers: {
|
|
661
|
+
'User-Agent': 'TRIBE-Installer',
|
|
662
|
+
// Add token if available in environment
|
|
663
|
+
...(process.env.GITHUB_TOKEN ? { 'Authorization': `token ${process.env.GITHUB_TOKEN}` } : {})
|
|
664
|
+
}
|
|
665
|
+
});
|
|
649
666
|
if (!response.ok) {
|
|
650
667
|
throw new Error(`GitHub API returned ${response.status}`);
|
|
651
668
|
}
|
|
@@ -653,23 +670,75 @@ async function installTribeCLI() {
|
|
|
653
670
|
if (!releases || releases.length === 0) {
|
|
654
671
|
throw new Error('No releases found');
|
|
655
672
|
}
|
|
656
|
-
|
|
673
|
+
|
|
674
|
+
// Filter releases based on version channel
|
|
675
|
+
let filteredReleases = releases.filter(r => !r.draft);
|
|
676
|
+
|
|
677
|
+
if (versionChannel === 'beta') {
|
|
678
|
+
// For beta, look for releases with 'beta' in tag name
|
|
679
|
+
filteredReleases = filteredReleases.filter(r => r.tag_name.includes('beta'));
|
|
680
|
+
spinner.text = 'Looking for beta releases...';
|
|
681
|
+
} else if (versionChannel === 'latest') {
|
|
682
|
+
// For latest, exclude beta releases
|
|
683
|
+
filteredReleases = filteredReleases.filter(r => !r.tag_name.includes('beta'));
|
|
684
|
+
spinner.text = 'Looking for stable releases...';
|
|
685
|
+
} else {
|
|
686
|
+
// For specific version, look for exact match
|
|
687
|
+
filteredReleases = filteredReleases.filter(r => r.tag_name === versionChannel);
|
|
688
|
+
spinner.text = `Looking for version ${versionChannel}...`;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (filteredReleases.length === 0) {
|
|
692
|
+
throw new Error(`No releases found for channel: ${versionChannel}`);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// Find a release with the binary we need
|
|
696
|
+
let foundRelease = null;
|
|
657
697
|
const assetName = `tribe-${platform}-${arch}`;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
698
|
+
|
|
699
|
+
for (const release of filteredReleases) {
|
|
700
|
+
const asset = release.assets?.find(a => a.name === assetName || a.name === `${assetName}.exe`);
|
|
701
|
+
if (asset) {
|
|
702
|
+
foundRelease = release;
|
|
703
|
+
downloadUrl = asset.browser_download_url;
|
|
704
|
+
spinner.text = `Found binary in ${versionChannel} release: ${release.tag_name}`;
|
|
705
|
+
break;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
if (!foundRelease) {
|
|
710
|
+
// No release has the binary, try constructing URL from first filtered release
|
|
711
|
+
const firstRelease = filteredReleases[0];
|
|
712
|
+
if (firstRelease) {
|
|
713
|
+
downloadUrl = `https://github.com/${githubRepo}/releases/download/${firstRelease.tag_name}/tribe-${platform}-${arch}`;
|
|
714
|
+
spinner.text = `Trying ${versionChannel} release: ${firstRelease.tag_name}`;
|
|
715
|
+
} else {
|
|
716
|
+
throw new Error(`No suitable release found for channel: ${versionChannel}`);
|
|
717
|
+
}
|
|
662
718
|
}
|
|
663
|
-
|
|
664
|
-
downloadUrl = asset.browser_download_url;
|
|
665
|
-
spinner.text = `Found latest release: ${latestRelease.tag_name}`;
|
|
666
719
|
} catch (error) {
|
|
667
|
-
|
|
668
|
-
//
|
|
720
|
+
log.warning(`Failed to get release info: ${error.message}`);
|
|
721
|
+
// Try to get the latest release tag directly
|
|
722
|
+
try {
|
|
723
|
+
const tagResponse = await fetch(`https://api.github.com/repos/${githubRepo}/releases`, {
|
|
724
|
+
headers: { 'User-Agent': 'TRIBE-Installer' }
|
|
725
|
+
});
|
|
726
|
+
if (tagResponse.ok) {
|
|
727
|
+
const releases = await tagResponse.json();
|
|
728
|
+
if (releases && releases.length > 0) {
|
|
729
|
+
const tag = releases[0].tag_name;
|
|
730
|
+
// Construct direct download URL
|
|
731
|
+
downloadUrl = `https://github.com/${githubRepo}/releases/download/${tag}/tribe-${platform}-${arch}`;
|
|
732
|
+
spinner.text = `Using direct download for release: ${tag}`;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
} catch (e) {
|
|
736
|
+
// Ignore and use fallback URLs
|
|
737
|
+
}
|
|
669
738
|
}
|
|
670
739
|
|
|
671
|
-
// Check if there's a local build available
|
|
672
|
-
const localBuildPath = path.join(__dirname, '..', '..', '..', 'sdk', 'cmd', '
|
|
740
|
+
// Check if there's a local build available (use tribe-new, not cli-gui)
|
|
741
|
+
const localBuildPath = path.join(__dirname, '..', '..', '..', 'sdk', 'cmd', 'tribe-new', 'tribe');
|
|
673
742
|
const hasLocalBuild = fs.existsSync(localBuildPath);
|
|
674
743
|
|
|
675
744
|
const sources = isTestEnv ? [isTestEnv] : [
|
|
@@ -993,6 +1062,9 @@ async function verifyInstallation() {
|
|
|
993
1062
|
results[tool] = await checkCommand(tool);
|
|
994
1063
|
}
|
|
995
1064
|
|
|
1065
|
+
// Store results globally for later use
|
|
1066
|
+
global.installationChecks = results;
|
|
1067
|
+
|
|
996
1068
|
// Special check for container runtime
|
|
997
1069
|
let containerWorking = false;
|
|
998
1070
|
if (platform === 'darwin') {
|
|
@@ -1523,6 +1595,17 @@ async function forceCleanInstallation() {
|
|
|
1523
1595
|
log.info('npm cache clean attempted (may have failed, which is okay)');
|
|
1524
1596
|
}
|
|
1525
1597
|
|
|
1598
|
+
// Remove first-install marker to allow auto-launch
|
|
1599
|
+
const firstInstallMarker = path.join(tribeDir, '.first-install-complete');
|
|
1600
|
+
if (fs.existsSync(firstInstallMarker)) {
|
|
1601
|
+
try {
|
|
1602
|
+
fs.unlinkSync(firstInstallMarker);
|
|
1603
|
+
log.success('Removed first-install marker');
|
|
1604
|
+
} catch (error) {
|
|
1605
|
+
log.warning(`Could not remove first-install marker: ${error.message}`);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1526
1609
|
// Platform-specific cleanup
|
|
1527
1610
|
if (platform === 'darwin') {
|
|
1528
1611
|
// Check if Colima is running and stop it
|
|
@@ -1554,29 +1637,12 @@ async function forceCleanInstallation() {
|
|
|
1554
1637
|
}
|
|
1555
1638
|
|
|
1556
1639
|
async function main() {
|
|
1557
|
-
|
|
1558
|
-
console.log('');
|
|
1559
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░`) + chalk.yellow(` ░▒▓`) + chalk.red(` `) + chalk.yellow(` ▓▒░ `) + chalk.red(`░▒▓█▓▒░`));
|
|
1560
|
-
console.log(chalk.red(` ░▒▓█████▓▒░ ░▒▓█████▓▒░`) + chalk.yellow(` ░▒▓██`) + chalk.red(` `) + chalk.yellow(` ▓██▓▒░ `) + chalk.red(`░▒▓█████▓▒░`));
|
|
1561
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░▒▓█▓▒░`) + chalk.yellow(`░▒▓██`) + chalk.red(` `) + chalk.yellow(`▓██▓▒░ `) + chalk.red(`░▒▓█▓▒░░▒▓█▓▒░`));
|
|
1562
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░`) + chalk.yellow(` ░▒▓██`) + chalk.red(``) + chalk.yellow(`▓██▓▒░ `) + chalk.red(`░▒▓█▓▒░ ░▒▓█▓▒░`));
|
|
1563
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░`) + chalk.yellow(` ░▒▓██`) + chalk.red(``) + chalk.yellow(`██▓▒░ `) + chalk.red(`░▒▓█▓▒░ ░▒▓█▓▒░`));
|
|
1564
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░`) + chalk.yellow(` ░▒▓`) + chalk.red(`██`) + chalk.yellow(`▓▒░ `) + chalk.red(`░▒▓█▓▒░ ░▒▓█▓▒░`));
|
|
1565
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░`) + chalk.yellow(` ░▒`) + chalk.red(`▓`) + chalk.yellow(`▒░ `) + chalk.red(`░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░`));
|
|
1566
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░`) + chalk.yellow(` `) + chalk.red(`░`) + chalk.yellow(` `) + chalk.red(`░▒▓█▓▒░ ░▒▓█████▓▒░`));
|
|
1567
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░`) + chalk.yellow(` `) + chalk.red(`░▒▓█▓▒░ ░▒▓█▓▒░`));
|
|
1568
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░`) + chalk.yellow(` `) + chalk.red(`░▒▓█▓▒░ ░▒▓█▓▒░`));
|
|
1569
|
-
console.log(chalk.red(` ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒`) + chalk.red(`▓█▓▒░ ░▒▓█▓▒░`));
|
|
1570
|
-
console.log('');
|
|
1571
|
-
console.log(chalk.yellow(` ╔═══════════════════════════════════╗`));
|
|
1572
|
-
console.log(chalk.yellow(` ║ `) + chalk.white.bold(`Multi-Agent Orchestration System`) + chalk.yellow(` ║`));
|
|
1573
|
-
console.log(chalk.yellow(` ╚═══════════════════════════════════╝`));
|
|
1574
|
-
console.log('');
|
|
1640
|
+
console.log(chalk.bold.blue('\n🚀 TRIBE CLI Installer\n'));
|
|
1575
1641
|
|
|
1576
1642
|
// Detect and display platform info
|
|
1577
1643
|
const displayArch = process.arch === 'x64' ? 'amd64' : process.arch;
|
|
1578
|
-
console.log(chalk.
|
|
1579
|
-
console.log(chalk.
|
|
1644
|
+
console.log(chalk.gray(`Platform: ${platform} (${displayArch})`));
|
|
1645
|
+
console.log(chalk.gray(`Node: ${process.version}`));
|
|
1580
1646
|
console.log('');
|
|
1581
1647
|
|
|
1582
1648
|
// Check for unsupported platforms early
|
|
@@ -1678,6 +1744,16 @@ async function main() {
|
|
|
1678
1744
|
// Verify everything first
|
|
1679
1745
|
const verified = await verifyInstallation();
|
|
1680
1746
|
|
|
1747
|
+
// If critical components failed (especially TRIBE CLI), exit with error
|
|
1748
|
+
if (!allSuccess) {
|
|
1749
|
+
// Check specifically if TRIBE CLI installation failed
|
|
1750
|
+
const tribeBinaryExists = fs.existsSync(path.join(tribeBinDir, 'tribe'));
|
|
1751
|
+
if (!tribeBinaryExists) {
|
|
1752
|
+
console.error(chalk.red('\n❌ Installation failed: TRIBE CLI could not be installed'));
|
|
1753
|
+
process.exit(1);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1681
1757
|
// Try to start container runtime (after showing results)
|
|
1682
1758
|
const runtimeStarted = await startContainerRuntime();
|
|
1683
1759
|
|
|
@@ -1824,6 +1900,22 @@ async function main() {
|
|
|
1824
1900
|
log.info('Then run: tribe start');
|
|
1825
1901
|
}
|
|
1826
1902
|
|
|
1903
|
+
// Auto-launch handling (only for successful installations)
|
|
1904
|
+
const checks = global.installationChecks || {};
|
|
1905
|
+
if (checks.kubectl && checks.tribe) {
|
|
1906
|
+
try {
|
|
1907
|
+
const autoLaunch = require('./install-tribe-autolaunch.js');
|
|
1908
|
+
if (autoLaunch.shouldAutoLaunch()) {
|
|
1909
|
+
console.log(''); // Spacing before auto-launch
|
|
1910
|
+
await autoLaunch.handleAutoLaunch();
|
|
1911
|
+
// If auto-launch takes over, we won't reach here
|
|
1912
|
+
}
|
|
1913
|
+
} catch (error) {
|
|
1914
|
+
// Silently ignore auto-launch errors to not break the installer
|
|
1915
|
+
// Auto-launch is a nice-to-have feature, not critical
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1827
1919
|
// Exit cleanly
|
|
1828
1920
|
process.exit(0);
|
|
1829
1921
|
}
|
|
@@ -1836,15 +1928,43 @@ if (!global.fetch) {
|
|
|
1836
1928
|
if (require.main === module) {
|
|
1837
1929
|
const args = process.argv.slice(2);
|
|
1838
1930
|
|
|
1931
|
+
// Parse version/channel flags
|
|
1932
|
+
let versionChannel = 'latest'; // default to latest stable
|
|
1933
|
+
const versionArg = args.find(arg => arg.startsWith('--version='));
|
|
1934
|
+
const channelArg = args.find(arg => arg.startsWith('--channel='));
|
|
1935
|
+
|
|
1936
|
+
if (versionArg) {
|
|
1937
|
+
versionChannel = versionArg.split('=')[1];
|
|
1938
|
+
} else if (channelArg) {
|
|
1939
|
+
versionChannel = channelArg.split('=')[1];
|
|
1940
|
+
} else if (args.includes('--beta')) {
|
|
1941
|
+
versionChannel = 'beta';
|
|
1942
|
+
} else if (args.includes('--latest')) {
|
|
1943
|
+
versionChannel = 'latest';
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
// Store globally for use in download functions
|
|
1947
|
+
global.versionChannel = versionChannel;
|
|
1948
|
+
|
|
1839
1949
|
if (args.includes('--help') || args.includes('-h')) {
|
|
1840
1950
|
console.log(chalk.bold.blue('TRIBE CLI Installer\n'));
|
|
1841
1951
|
console.log('Usage: npx @_xtribe/cli [options]\n');
|
|
1842
1952
|
console.log('Options:');
|
|
1843
|
-
console.log(' --help, -h
|
|
1844
|
-
console.log(' --verify
|
|
1845
|
-
console.log(' --dry-run
|
|
1846
|
-
console.log(' --skip-cluster
|
|
1847
|
-
console.log(' --
|
|
1953
|
+
console.log(' --help, -h Show this help message');
|
|
1954
|
+
console.log(' --verify Only verify existing installation');
|
|
1955
|
+
console.log(' --dry-run Show what would be installed');
|
|
1956
|
+
console.log(' --skip-cluster Skip cluster deployment (for testing)');
|
|
1957
|
+
console.log(' --no-start Alias for --skip-cluster (for CI environments)');
|
|
1958
|
+
console.log(' --force Force clean installation (removes existing installations)');
|
|
1959
|
+
console.log(' --latest Install latest stable release (default)');
|
|
1960
|
+
console.log(' --beta Install latest beta release');
|
|
1961
|
+
console.log(' --version=TAG Install specific version tag');
|
|
1962
|
+
console.log(' --channel=CHANNEL Install from specific channel (latest/beta)');
|
|
1963
|
+
console.log('\nVersion Examples:');
|
|
1964
|
+
console.log(' npx @_xtribe/cli@latest # Latest stable (equivalent to --latest)');
|
|
1965
|
+
console.log(' npx @_xtribe/cli@beta # Latest beta');
|
|
1966
|
+
console.log(' npx @_xtribe/cli --beta # Latest beta (flag version)');
|
|
1967
|
+
console.log(' npx @_xtribe/cli --version=v1.2.3 # Specific version');
|
|
1848
1968
|
console.log('\nThis installer sets up the complete TRIBE development environment:');
|
|
1849
1969
|
|
|
1850
1970
|
if (platform === 'darwin') {
|
|
@@ -1877,6 +1997,7 @@ if (require.main === module) {
|
|
|
1877
1997
|
console.log(chalk.bold.blue('🔍 TRIBE CLI Installation Preview\n'));
|
|
1878
1998
|
log.info(`Platform: ${platform} (${arch})`);
|
|
1879
1999
|
log.info(`Install directory: ${binDir}`);
|
|
2000
|
+
log.info(`Version channel: ${versionChannel}`);
|
|
1880
2001
|
console.log('\nWould install:');
|
|
1881
2002
|
console.log('• Colima - Container runtime with Kubernetes (macOS only)');
|
|
1882
2003
|
console.log('• kubectl - Kubernetes CLI');
|
|
@@ -1884,8 +2005,8 @@ if (require.main === module) {
|
|
|
1884
2005
|
process.exit(0);
|
|
1885
2006
|
}
|
|
1886
2007
|
|
|
1887
|
-
// Store skip-cluster flag
|
|
1888
|
-
global.skipCluster = args.includes('--skip-cluster');
|
|
2008
|
+
// Store skip-cluster flag (--no-start is an alias)
|
|
2009
|
+
global.skipCluster = args.includes('--skip-cluster') || args.includes('--no-start');
|
|
1889
2010
|
|
|
1890
2011
|
// Check for force flag
|
|
1891
2012
|
if (args.includes('--force')) {
|
package/install.sh
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# TRIBE Quick Installer
|
|
3
|
+
# This script provides a one-command installation with immediate PATH access
|
|
4
|
+
|
|
5
|
+
# Source constants
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
source "$SCRIPT_DIR/../../../constants.sh" 2>/dev/null || true
|
|
8
|
+
|
|
9
|
+
# If constants not found, define locally
|
|
10
|
+
if [ -z "$TRIBE_INSTALL_COMMAND" ]; then
|
|
11
|
+
TRIBE_INSTALL_COMMAND="npx @_xtribe/cli"
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
# Colors
|
|
15
|
+
RED='\033[0;31m'
|
|
16
|
+
GREEN='\033[0;32m'
|
|
17
|
+
BLUE='\033[0;34m'
|
|
18
|
+
YELLOW='\033[1;33m'
|
|
19
|
+
NC='\033[0m' # No Color
|
|
20
|
+
|
|
21
|
+
echo -e "${BLUE}🚀 TRIBE Quick Installer${NC}"
|
|
22
|
+
echo ""
|
|
23
|
+
|
|
24
|
+
# Download and run the installer
|
|
25
|
+
echo "Installing TRIBE components..."
|
|
26
|
+
${TRIBE_INSTALL_COMMAND}@latest "$@"
|
|
27
|
+
|
|
28
|
+
# Check if installation was successful
|
|
29
|
+
if [ -f ~/.tribe/tribe-env.sh ]; then
|
|
30
|
+
# Source the environment file
|
|
31
|
+
source ~/.tribe/tribe-env.sh
|
|
32
|
+
|
|
33
|
+
echo ""
|
|
34
|
+
echo -e "${GREEN}✅ Installation complete!${NC}"
|
|
35
|
+
echo -e "${GREEN}✅ PATH configured for this session!${NC}"
|
|
36
|
+
echo ""
|
|
37
|
+
|
|
38
|
+
# Verify tribe is available
|
|
39
|
+
if command -v tribe &> /dev/null; then
|
|
40
|
+
echo -e "${YELLOW}You can now use the 'tribe' command immediately!${NC}"
|
|
41
|
+
echo ""
|
|
42
|
+
echo "Try these commands:"
|
|
43
|
+
echo -e " ${GREEN}tribe${NC} - Launch TRIBE"
|
|
44
|
+
echo -e " ${GREEN}tribe status${NC} - Check cluster status"
|
|
45
|
+
else
|
|
46
|
+
echo -e "${YELLOW}Run this command to use tribe:${NC}"
|
|
47
|
+
echo -e " ${GREEN}source ~/.tribe/tribe-env.sh${NC}"
|
|
48
|
+
fi
|
|
49
|
+
else
|
|
50
|
+
echo -e "${RED}❌ Installation may have failed${NC}"
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
package/package.json
CHANGED
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_xtribe/cli",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.5",
|
|
4
|
+
"description": "TRIBE multi-agent development system - Zero to productive with one command",
|
|
5
5
|
"main": "install-tribe.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"
|
|
7
|
+
"cli": "./index.js",
|
|
8
|
+
"install-tribe": "./install-tribe.js",
|
|
9
|
+
"setup-path": "./setup-path.js"
|
|
8
10
|
},
|
|
9
11
|
"scripts": {
|
|
10
12
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
13
|
},
|
|
12
14
|
"keywords": [
|
|
13
|
-
"ai",
|
|
14
|
-
"claude",
|
|
15
|
-
"anthropic",
|
|
16
|
-
"code-generation",
|
|
17
|
-
"ai-agents",
|
|
18
|
-
"multi-agent",
|
|
19
|
-
"autonomous-development",
|
|
20
|
-
"ai-developer",
|
|
21
|
-
"code-assistant",
|
|
22
|
-
"llm",
|
|
23
15
|
"tribe",
|
|
24
16
|
"cli",
|
|
25
17
|
"kubernetes",
|
|
26
18
|
"docker",
|
|
27
19
|
"colima",
|
|
20
|
+
"multi-agent",
|
|
21
|
+
"ai",
|
|
28
22
|
"development",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"productivity",
|
|
32
|
-
"natural-language-programming"
|
|
23
|
+
"autonomous",
|
|
24
|
+
"agents"
|
|
33
25
|
],
|
|
34
26
|
"engines": {
|
|
35
27
|
"node": ">=16.0.0"
|
|
@@ -44,25 +36,33 @@
|
|
|
44
36
|
"registry": "https://registry.npmjs.org/"
|
|
45
37
|
},
|
|
46
38
|
"files": [
|
|
39
|
+
"index.js",
|
|
47
40
|
"install-tribe.js",
|
|
41
|
+
"install-tribe-minimal.js",
|
|
42
|
+
"install-tribe-autolaunch.js",
|
|
43
|
+
"setup-path.js",
|
|
44
|
+
"install.sh",
|
|
45
|
+
"tribe-deployment.yaml",
|
|
48
46
|
"README.md",
|
|
47
|
+
"AUTOLAUNCH_IMPLEMENTATION.md",
|
|
49
48
|
"package.json"
|
|
50
49
|
],
|
|
51
50
|
"dependencies": {
|
|
51
|
+
"adm-zip": "^0.5.9",
|
|
52
52
|
"chalk": "^4.1.2",
|
|
53
|
-
"ora": "^5.4.1",
|
|
54
53
|
"node-fetch": "^2.6.7",
|
|
54
|
+
"ora": "^5.4.1",
|
|
55
55
|
"tar": "^6.1.15",
|
|
56
56
|
"which": "^2.0.2"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|
|
60
|
-
"url": "git+https://github.com/
|
|
60
|
+
"url": "git+https://github.com/TRIBE-INC/0zen.git"
|
|
61
61
|
},
|
|
62
|
-
"author": "
|
|
62
|
+
"author": "TRIBE-INC",
|
|
63
63
|
"license": "MIT",
|
|
64
|
-
"homepage": "https://github.com/
|
|
64
|
+
"homepage": "https://github.com/TRIBE-INC/0zen",
|
|
65
65
|
"bugs": {
|
|
66
|
-
"url": "https://github.com/
|
|
66
|
+
"url": "https://github.com/TRIBE-INC/0zen/issues"
|
|
67
67
|
}
|
|
68
68
|
}
|