aladdin-ai 1.1.8 → 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 +27 -30
  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,24 +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
- if (platform === 'darwin') {
75
- await execa('open', [downloadPath]);
76
- } else if (platform === 'win32') {
77
- // Use shell: true or cmd /c to ensure 'start' works on Windows
78
- await execa('cmd', ['/c', 'start', '', downloadPath]);
79
- } else {
80
- await execa('xdg-open', [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.`));
81
93
  }
82
94
 
83
95
  } catch (err) {
84
- 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);
85
98
  }
86
99
  return;
87
100
  }
@@ -111,34 +124,18 @@ program
111
124
  const spinner = ora('Cloning AladdinAI repository...').start();
112
125
 
113
126
  try {
114
- // Clone the repo
115
127
  await execa('git', ['clone', REPO_URL, targetDir]);
116
128
  spinner.succeed(chalk.green('Repository cloned successfully!'));
117
-
118
- // Remove .git from the new project to start fresh
119
129
  await fs.remove(path.join(targetDir, '.git'));
120
130
 
121
131
  if (answers.installDeps) {
122
- // Install Frontend
123
132
  const feSpinner = ora('Installing Frontend dependencies...').start();
124
133
  await execa('npm', ['install'], { cwd: path.join(targetDir, 'frontend') });
125
134
  feSpinner.succeed(chalk.green('Frontend dependencies installed!'));
126
-
127
- // Backend setup suggestion
128
- console.log(chalk.yellow('\n💡 Note: To set up the Backend, make sure you have Python 3.10+ and run:'));
129
- console.log(chalk.cyan(` cd ${answers.projectName}/backend && pip install -r requirements.txt`));
130
135
  }
131
136
 
132
- // RCF Initialization notice
133
137
  console.log(chalk.blue('\n🛡️ RCF Protocol: Your project is pre-marked for RCF compliance.'));
134
- console.log(chalk.blue(' Run `npx rcf-cli audit .` to verify your installation.'));
135
-
136
138
  console.log(chalk.green(`\n🚀 Success! Your AladdinAI platform is ready in ${answers.projectName}`));
137
- console.log(chalk.white('\nNext steps:'));
138
- console.log(chalk.cyan(` 1. cd ${answers.projectName}`));
139
- console.log(chalk.cyan(` 2. Configure your .env files in /backend and /frontend`));
140
- console.log(chalk.cyan(` 3. Run 'npm run dev' in /frontend`));
141
- console.log(chalk.cyan(` 4. Start the backend with 'uvicorn app.main:app --reload'`));
142
139
 
143
140
  } catch (error) {
144
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.8",
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
+ }