aladdin-ai 1.1.7 → 1.2.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.
Files changed (2) hide show
  1. package/index.js +28 -25
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -27,7 +27,7 @@ console.log(chalk.cyan(`
27
27
  program
28
28
  .name('aladdin-ai')
29
29
  .description('Bootstrap your own AladdinAI instance')
30
- .version('2.0.3')
30
+ .version('1.2.0')
31
31
  .action(async () => {
32
32
  const { mode } = await inquirer.prompt([
33
33
  {
@@ -48,10 +48,12 @@ program
48
48
  let downloadUrl = '';
49
49
  let fileName = '';
50
50
 
51
+ // GitHub Release assets usually follow this pattern
51
52
  if (platform === 'darwin') {
52
53
  downloadUrl = 'https://github.com/aliyevaladddin/AladdinAI/releases/latest/download/AladdinAI.dmg';
53
54
  fileName = 'AladdinAI.dmg';
54
55
  } else if (platform === 'win32') {
56
+ // Changed to match electron-builder default naming or redirect
55
57
  downloadUrl = 'https://github.com/aliyevaladddin/AladdinAI/releases/latest/download/AladdinAI.exe';
56
58
  fileName = 'AladdinAI.exe';
57
59
  } else if (platform === 'linux') {
@@ -64,18 +66,35 @@ program
64
66
 
65
67
  spinner.text = `Downloading ${fileName} for ${platform}...`;
66
68
  const downloadPath = path.join(process.cwd(), fileName);
67
-
68
- await execa('curl', ['-L', '-o', downloadPath, downloadUrl]);
69
+
70
+ // Use -f to fail on 404, -L to follow redirects
71
+ try {
72
+ await execa('curl', ['-f', '-L', '-o', downloadPath, downloadUrl]);
73
+ } catch (downloadErr) {
74
+ spinner.fail(chalk.red(`\n❌ Failed to download ${fileName}. Possibly the version is not yet available on GitHub Releases.`));
75
+ console.log(chalk.yellow(`\nTry downloading manually from: https://github.com/aliyevaladddin/AladdinAI/releases`));
76
+ return;
77
+ }
78
+
69
79
  spinner.succeed(chalk.green(`\n✅ Download complete: ${fileName}`));
70
-
71
80
  console.log(chalk.cyan(`\n👉 Opening ${fileName} for installation...`));
72
-
73
- // Cross-platform open command
74
- const openCmd = platform === 'darwin' ? 'open' : platform === 'win32' ? 'start' : 'xdg-open';
75
- await execa(openCmd, [downloadPath]);
81
+
82
+ try {
83
+ if (platform === 'darwin') {
84
+ await execa('open', [downloadPath]);
85
+ } else if (platform === 'win32') {
86
+ // More robust Windows open command using shell
87
+ await execa('powershell', ['-Command', `Start-Process "${downloadPath}"`], { shell: true });
88
+ } else {
89
+ await execa('xdg-open', [downloadPath]);
90
+ }
91
+ } catch (openErr) {
92
+ console.log(chalk.yellow(`\n⚠️ Could not open automatically. Please run ${fileName} manually from this folder.`));
93
+ }
76
94
 
77
95
  } catch (err) {
78
- spinner.fail(chalk.red('Failed to download Desktop App. Check your internet or GitHub release.'));
96
+ spinner.fail(chalk.red('An unexpected error occurred during installation.'));
97
+ console.error(err);
79
98
  }
80
99
  return;
81
100
  }
@@ -105,34 +124,18 @@ program
105
124
  const spinner = ora('Cloning AladdinAI repository...').start();
106
125
 
107
126
  try {
108
- // Clone the repo
109
127
  await execa('git', ['clone', REPO_URL, targetDir]);
110
128
  spinner.succeed(chalk.green('Repository cloned successfully!'));
111
-
112
- // Remove .git from the new project to start fresh
113
129
  await fs.remove(path.join(targetDir, '.git'));
114
130
 
115
131
  if (answers.installDeps) {
116
- // Install Frontend
117
132
  const feSpinner = ora('Installing Frontend dependencies...').start();
118
133
  await execa('npm', ['install'], { cwd: path.join(targetDir, 'frontend') });
119
134
  feSpinner.succeed(chalk.green('Frontend dependencies installed!'));
120
-
121
- // Backend setup suggestion
122
- console.log(chalk.yellow('\n💡 Note: To set up the Backend, make sure you have Python 3.10+ and run:'));
123
- console.log(chalk.cyan(` cd ${answers.projectName}/backend && pip install -r requirements.txt`));
124
135
  }
125
136
 
126
- // RCF Initialization notice
127
137
  console.log(chalk.blue('\n🛡️ RCF Protocol: Your project is pre-marked for RCF compliance.'));
128
- console.log(chalk.blue(' Run `npx rcf-cli audit .` to verify your installation.'));
129
-
130
138
  console.log(chalk.green(`\n🚀 Success! Your AladdinAI platform is ready in ${answers.projectName}`));
131
- console.log(chalk.white('\nNext steps:'));
132
- console.log(chalk.cyan(` 1. cd ${answers.projectName}`));
133
- console.log(chalk.cyan(` 2. Configure your .env files in /backend and /frontend`));
134
- console.log(chalk.cyan(` 3. Run 'npm run dev' in /frontend`));
135
- console.log(chalk.cyan(` 4. Start the backend with 'uvicorn app.main:app --reload'`));
136
139
 
137
140
  } catch (error) {
138
141
  spinner.fail(chalk.red('Failed to bootstrap project.'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aladdin-ai",
3
- "version": "1.1.7",
3
+ "version": "1.2.0",
4
4
  "description": "The official CLI for AladdinAI Platform. Powered by RCF Protocol.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -40,4 +40,4 @@
40
40
  "inquirer": "^9.2.22",
41
41
  "ora": "^8.0.1"
42
42
  }
43
- }
43
+ }