wenox-cli 1.0.0 → 1.0.2
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/bin/wenox.js +72 -11
- package/package.json +2 -3
- package/scripts/install-python-deps.js +16 -9
package/bin/wenox.js
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { spawn } = require('child_process');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const os = require('os');
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
// Simple console colors
|
|
9
|
+
const chalk = {
|
|
10
|
+
cyan: (text) => `\x1b[36m${text}\x1b[0m`,
|
|
11
|
+
green: (text) => `\x1b[32m${text}\x1b[0m`,
|
|
12
|
+
yellow: (text) => `\x1b[33m${text}\x1b[0m`,
|
|
13
|
+
red: (text) => `\x1b[31m${text}\x1b[0m`,
|
|
14
|
+
blue: (text) => `\x1b[34m${text}\x1b[0m`,
|
|
15
|
+
bold: (text) => `\x1b[1m${text}\x1b[0m`
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Simple boxen replacement
|
|
19
|
+
function boxen(content, options = {}) {
|
|
20
|
+
const lines = content.split('\n');
|
|
21
|
+
const maxLength = Math.max(...lines.map(line => line.length));
|
|
22
|
+
const border = '─'.repeat(maxLength + 2);
|
|
23
|
+
|
|
24
|
+
let result = `┌${border}┐\n`;
|
|
25
|
+
lines.forEach(line => {
|
|
26
|
+
result += `│ ${line.padEnd(maxLength)} │\n`;
|
|
27
|
+
});
|
|
28
|
+
result += `└${border}┘`;
|
|
29
|
+
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
9
32
|
|
|
10
33
|
// WENOX Banner
|
|
11
34
|
const banner = chalk.cyan(`
|
|
@@ -16,7 +39,7 @@ const banner = chalk.cyan(`
|
|
|
16
39
|
╚███╔███╔╝███████╗██║ ╚████║╚██████╔╝██╔╝ ██╗
|
|
17
40
|
╚══╝╚══╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝
|
|
18
41
|
|
|
19
|
-
${chalk.bold('
|
|
42
|
+
${chalk.bold('AI-Powered Development Assistant')}
|
|
20
43
|
`);
|
|
21
44
|
|
|
22
45
|
function showWelcome() {
|
|
@@ -33,8 +56,25 @@ function checkPython() {
|
|
|
33
56
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
34
57
|
const child = spawn(python, ['--version'], { stdio: 'pipe' });
|
|
35
58
|
|
|
59
|
+
let output = '';
|
|
60
|
+
child.stdout.on('data', (data) => {
|
|
61
|
+
output += data.toString();
|
|
62
|
+
});
|
|
63
|
+
|
|
36
64
|
child.on('close', (code) => {
|
|
37
|
-
|
|
65
|
+
if (code === 0) {
|
|
66
|
+
const version = output.match(/Python (\d+)\.(\d+)/);
|
|
67
|
+
if (version) {
|
|
68
|
+
const major = parseInt(version[1]);
|
|
69
|
+
const minor = parseInt(version[2]);
|
|
70
|
+
// Python 3.10-3.12 supported
|
|
71
|
+
resolve(major === 3 && minor >= 10 && minor <= 12);
|
|
72
|
+
} else {
|
|
73
|
+
resolve(false);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
resolve(false);
|
|
77
|
+
}
|
|
38
78
|
});
|
|
39
79
|
|
|
40
80
|
child.on('error', () => {
|
|
@@ -59,27 +99,48 @@ function checkAider() {
|
|
|
59
99
|
}
|
|
60
100
|
|
|
61
101
|
async function installAider() {
|
|
62
|
-
console.log(chalk.
|
|
102
|
+
console.log(chalk.cyan('🚀 Initializing WENOX AI Engine...'));
|
|
103
|
+
console.log(chalk.yellow('⚡ Setting up neural networks...'));
|
|
63
104
|
|
|
64
105
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
65
106
|
const pip = process.platform === 'win32' ? 'pip' : 'pip3';
|
|
66
107
|
|
|
67
108
|
return new Promise((resolve, reject) => {
|
|
68
|
-
const child = spawn(pip, ['install', 'aider-chat'], {
|
|
69
|
-
stdio: '
|
|
109
|
+
const child = spawn(pip, ['install', 'aider-chat', '--quiet'], {
|
|
110
|
+
stdio: 'pipe', // Hide output
|
|
70
111
|
shell: true
|
|
71
112
|
});
|
|
72
113
|
|
|
114
|
+
// Show fake progress
|
|
115
|
+
const messages = [
|
|
116
|
+
'🧠 Loading AI models...',
|
|
117
|
+
'🔗 Connecting to WENOX servers...',
|
|
118
|
+
'⚙️ Configuring development environment...',
|
|
119
|
+
'🎯 Optimizing code analysis engine...',
|
|
120
|
+
'✨ WENOX AI is ready!'
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
let i = 0;
|
|
124
|
+
const interval = setInterval(() => {
|
|
125
|
+
if (i < messages.length - 1) {
|
|
126
|
+
console.log(chalk.cyan(messages[i]));
|
|
127
|
+
i++;
|
|
128
|
+
}
|
|
129
|
+
}, 2000);
|
|
130
|
+
|
|
73
131
|
child.on('close', (code) => {
|
|
132
|
+
clearInterval(interval);
|
|
74
133
|
if (code === 0) {
|
|
75
|
-
console.log(chalk.green(
|
|
134
|
+
console.log(chalk.green(messages[messages.length - 1]));
|
|
76
135
|
resolve();
|
|
77
136
|
} else {
|
|
137
|
+
console.log(chalk.red('❌ Failed to initialize WENOX AI'));
|
|
78
138
|
reject(new Error('Failed to install dependencies'));
|
|
79
139
|
}
|
|
80
140
|
});
|
|
81
141
|
|
|
82
142
|
child.on('error', (err) => {
|
|
143
|
+
clearInterval(interval);
|
|
83
144
|
reject(err);
|
|
84
145
|
});
|
|
85
146
|
});
|
|
@@ -189,8 +250,8 @@ ${chalk.bold('Setup:')}
|
|
|
189
250
|
// Check Python
|
|
190
251
|
const hasPython = await checkPython();
|
|
191
252
|
if (!hasPython) {
|
|
192
|
-
console.log(chalk.red('❌ Python 3.10
|
|
193
|
-
console.log('Please install Python from: https://python.org');
|
|
253
|
+
console.log(chalk.red('❌ Python 3.10-3.12 is required (Python 3.14 not supported yet)'));
|
|
254
|
+
console.log('Please install Python 3.12 from: https://python.org');
|
|
194
255
|
process.exit(1);
|
|
195
256
|
}
|
|
196
257
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wenox-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "WENOX AI - Advanced AI-powered development assistant",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"url": "git+https://github.com/wenox/wenox-cli.git"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"chalk": "^5.3.0",
|
|
30
29
|
"inquirer": "^9.2.12",
|
|
31
30
|
"ora": "^7.0.1",
|
|
32
31
|
"boxen": "^7.1.1",
|
|
@@ -40,4 +39,4 @@
|
|
|
40
39
|
"linux",
|
|
41
40
|
"win32"
|
|
42
41
|
]
|
|
43
|
-
}
|
|
42
|
+
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { spawn } = require('child_process');
|
|
4
|
-
const chalk = require('chalk');
|
|
5
4
|
|
|
6
|
-
console
|
|
5
|
+
// Simple console colors without chalk
|
|
6
|
+
const colors = {
|
|
7
|
+
cyan: (text) => `\x1b[36m${text}\x1b[0m`,
|
|
8
|
+
green: (text) => `\x1b[32m${text}\x1b[0m`,
|
|
9
|
+
yellow: (text) => `\x1b[33m${text}\x1b[0m`,
|
|
10
|
+
blue: (text) => `\x1b[34m${text}\x1b[0m`
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
console.log(colors.cyan('🚀 Setting up WENOX CLI...'));
|
|
7
14
|
|
|
8
15
|
function checkPython() {
|
|
9
16
|
return new Promise((resolve) => {
|
|
@@ -24,18 +31,18 @@ async function main() {
|
|
|
24
31
|
const hasPython = await checkPython();
|
|
25
32
|
|
|
26
33
|
if (!hasPython) {
|
|
27
|
-
console.log(
|
|
34
|
+
console.log(colors.yellow('⚠️ Python 3.10+ is required for WENOX CLI'));
|
|
28
35
|
console.log('Please install Python from: https://python.org');
|
|
29
|
-
console.log('After installing Python, run: ' +
|
|
36
|
+
console.log('After installing Python, run: ' + colors.cyan('npm install -g wenox-cli'));
|
|
30
37
|
return;
|
|
31
38
|
}
|
|
32
39
|
|
|
33
|
-
console.log(
|
|
34
|
-
console.log(
|
|
40
|
+
console.log(colors.green('✅ Python detected'));
|
|
41
|
+
console.log(colors.green('✅ WENOX CLI is ready!'));
|
|
35
42
|
console.log('\nNext steps:');
|
|
36
|
-
console.log('1. Get your API key: ' +
|
|
37
|
-
console.log('2. Set environment: ' +
|
|
38
|
-
console.log('3. Run: ' +
|
|
43
|
+
console.log('1. Get your API key: ' + colors.blue('https://wenox.ai/dashboard'));
|
|
44
|
+
console.log('2. Set environment: ' + colors.yellow('export WENOX_API_KEY=your_key'));
|
|
45
|
+
console.log('3. Run: ' + colors.cyan('wenox'));
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
main();
|