@_xtribe/cli 2.0.1 → 2.0.4

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.
@@ -231,8 +231,11 @@ async function handleAutoLaunch() {
231
231
  await sleep(1000);
232
232
  }
233
233
 
234
- // Check and start cluster if needed
235
- if (!await isClusterRunning()) {
234
+ // Check and start cluster if needed (skip if --no-start was used)
235
+ const args = process.argv.slice(2);
236
+ const skipCluster = args.includes('--skip-cluster') || args.includes('--no-start');
237
+
238
+ if (!skipCluster && !await isClusterRunning()) {
236
239
  const started = await startCluster();
237
240
  if (!started) {
238
241
  showManualInstructions();
@@ -108,7 +108,7 @@ function updatePath() {
108
108
  const tribeEnvPath = path.join(tribeDir, 'tribe-env.sh');
109
109
  const envScriptContent = `#!/bin/bash
110
110
  # TRIBE CLI Environment Setup
111
- # Auto-generated by TRIBE minimal installer
111
+ # Auto-generated by TRIBE installer
112
112
 
113
113
  # Add TRIBE bin directory to PATH if not already present
114
114
  TRIBE_BIN_DIR="$HOME/.tribe/bin"
package/install-tribe.js CHANGED
@@ -654,7 +654,8 @@ async function installTribeCLI() {
654
654
  let downloadUrl = '';
655
655
 
656
656
  try {
657
- spinner.text = 'Fetching latest release information from GitHub...';
657
+ const versionChannel = global.versionChannel || 'latest';
658
+ spinner.text = `Fetching ${versionChannel} release information from GitHub...`;
658
659
  const response = await fetch(`https://api.github.com/repos/${githubRepo}/releases`, {
659
660
  headers: {
660
661
  'User-Agent': 'TRIBE-Installer',
@@ -670,26 +671,50 @@ async function installTribeCLI() {
670
671
  throw new Error('No releases found');
671
672
  }
672
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
+
673
695
  // Find a release with the binary we need
674
696
  let foundRelease = null;
675
697
  const assetName = `tribe-${platform}-${arch}`;
676
698
 
677
- for (const release of releases) {
678
- if (release.draft) continue;
699
+ for (const release of filteredReleases) {
679
700
  const asset = release.assets?.find(a => a.name === assetName || a.name === `${assetName}.exe`);
680
701
  if (asset) {
681
702
  foundRelease = release;
682
703
  downloadUrl = asset.browser_download_url;
683
- spinner.text = `Found binary in release: ${release.tag_name}`;
704
+ spinner.text = `Found binary in ${versionChannel} release: ${release.tag_name}`;
684
705
  break;
685
706
  }
686
707
  }
687
708
 
688
709
  if (!foundRelease) {
689
- // No release has the binary, try constructing URL from latest release
690
- const latestRelease = releases[0];
691
- downloadUrl = `https://github.com/${githubRepo}/releases/download/${latestRelease.tag_name}/tribe-${platform}-${arch}`;
692
- spinner.text = `Trying release: ${latestRelease.tag_name}`;
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
+ }
693
718
  }
694
719
  } catch (error) {
695
720
  log.warning(`Failed to get release info: ${error.message}`);
@@ -712,8 +737,8 @@ async function installTribeCLI() {
712
737
  }
713
738
  }
714
739
 
715
- // Check if there's a local build available
716
- const localBuildPath = path.join(__dirname, '..', '..', '..', 'sdk', 'cmd', 'cli-gui', 'tribe');
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');
717
742
  const hasLocalBuild = fs.existsSync(localBuildPath);
718
743
 
719
744
  const sources = isTestEnv ? [isTestEnv] : [
@@ -1903,16 +1928,43 @@ if (!global.fetch) {
1903
1928
  if (require.main === module) {
1904
1929
  const args = process.argv.slice(2);
1905
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
+
1906
1949
  if (args.includes('--help') || args.includes('-h')) {
1907
1950
  console.log(chalk.bold.blue('TRIBE CLI Installer\n'));
1908
1951
  console.log('Usage: npx @_xtribe/cli [options]\n');
1909
1952
  console.log('Options:');
1910
- console.log(' --help, -h Show this help message');
1911
- console.log(' --verify Only verify existing installation');
1912
- console.log(' --dry-run Show what would be installed');
1913
- console.log(' --skip-cluster Skip cluster deployment (for testing)');
1914
- console.log(' --no-start Alias for --skip-cluster (for CI environments)');
1915
- console.log(' --force Force clean installation (removes existing installations)');
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');
1916
1968
  console.log('\nThis installer sets up the complete TRIBE development environment:');
1917
1969
 
1918
1970
  if (platform === 'darwin') {
@@ -1945,6 +1997,7 @@ if (require.main === module) {
1945
1997
  console.log(chalk.bold.blue('🔍 TRIBE CLI Installation Preview\n'));
1946
1998
  log.info(`Platform: ${platform} (${arch})`);
1947
1999
  log.info(`Install directory: ${binDir}`);
2000
+ log.info(`Version channel: ${versionChannel}`);
1948
2001
  console.log('\nWould install:');
1949
2002
  console.log('• Colima - Container runtime with Kubernetes (macOS only)');
1950
2003
  console.log('• kubectl - Kubernetes CLI');
package/install.sh CHANGED
@@ -2,6 +2,15 @@
2
2
  # TRIBE Quick Installer
3
3
  # This script provides a one-command installation with immediate PATH access
4
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
+
5
14
  # Colors
6
15
  RED='\033[0;31m'
7
16
  GREEN='\033[0;32m'
@@ -14,7 +23,7 @@ echo ""
14
23
 
15
24
  # Download and run the installer
16
25
  echo "Installing TRIBE components..."
17
- npx @_xtribe/cli@latest "$@"
26
+ ${TRIBE_INSTALL_COMMAND}@latest "$@"
18
27
 
19
28
  # Check if installation was successful
20
29
  if [ -f ~/.tribe/tribe-env.sh ]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_xtribe/cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.4",
4
4
  "description": "TRIBE multi-agent development system - Zero to productive with one command",
5
5
  "main": "install-tribe.js",
6
6
  "bin": {
@@ -8,6 +8,14 @@
8
8
  # - tribexal/tribe:latest-claude-agent
9
9
  #
10
10
  # DO NOT change these to local image names for the npm package!
11
+ # ⚠️ CRITICAL WARNING: DATA PROTECTION ⚠️
12
+ # BEFORE APPLYING THIS MANIFEST:
13
+ # 1. Run: /Users/almorris/TRIBE/0zen/scripts/data-safety-check.sh
14
+ # 2. Check for existing PVCs: kubectl get pvc -n tribe-system
15
+ # 3. NEVER delete PVCs - they contain your data!
16
+ #
17
+ # This manifest will CREATE resources if they don't exist
18
+ # or UPDATE them if they do. PVCs are NEVER deleted.
11
19
  ---
12
20
  apiVersion: v1
13
21
  kind: Namespace