wenox-cli 1.0.2 → 1.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/bin/wenox.js +13 -51
- package/package.json +1 -1
package/bin/wenox.js
CHANGED
|
@@ -39,7 +39,7 @@ const banner = chalk.cyan(`
|
|
|
39
39
|
╚███╔███╔╝███████╗██║ ╚████║╚██████╔╝██╔╝ ██╗
|
|
40
40
|
╚══╝╚══╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝
|
|
41
41
|
|
|
42
|
-
${chalk.bold('AI
|
|
42
|
+
${chalk.bold('Claude API • Enterprise AI Platform')}
|
|
43
43
|
`);
|
|
44
44
|
|
|
45
45
|
function showWelcome() {
|
|
@@ -56,25 +56,8 @@ function checkPython() {
|
|
|
56
56
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
57
57
|
const child = spawn(python, ['--version'], { stdio: 'pipe' });
|
|
58
58
|
|
|
59
|
-
let output = '';
|
|
60
|
-
child.stdout.on('data', (data) => {
|
|
61
|
-
output += data.toString();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
59
|
child.on('close', (code) => {
|
|
65
|
-
|
|
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
|
-
}
|
|
60
|
+
resolve(code === 0);
|
|
78
61
|
});
|
|
79
62
|
|
|
80
63
|
child.on('error', () => {
|
|
@@ -99,48 +82,27 @@ function checkAider() {
|
|
|
99
82
|
}
|
|
100
83
|
|
|
101
84
|
async function installAider() {
|
|
102
|
-
console.log(chalk.cyan('
|
|
103
|
-
console.log(chalk.yellow('⚡ Setting up neural networks...'));
|
|
85
|
+
console.log(chalk.cyan('📦 Installing WENOX dependencies...'));
|
|
104
86
|
|
|
105
87
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
106
88
|
const pip = process.platform === 'win32' ? 'pip' : 'pip3';
|
|
107
89
|
|
|
108
90
|
return new Promise((resolve, reject) => {
|
|
109
|
-
const child = spawn(pip, ['install', 'aider-chat'
|
|
110
|
-
stdio: '
|
|
91
|
+
const child = spawn(pip, ['install', 'aider-chat'], {
|
|
92
|
+
stdio: 'inherit', // Show all output for debugging
|
|
111
93
|
shell: true
|
|
112
94
|
});
|
|
113
95
|
|
|
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
|
-
|
|
131
96
|
child.on('close', (code) => {
|
|
132
|
-
clearInterval(interval);
|
|
133
97
|
if (code === 0) {
|
|
134
|
-
console.log(chalk.green(
|
|
98
|
+
console.log(chalk.green('✅ WENOX dependencies installed successfully!'));
|
|
135
99
|
resolve();
|
|
136
100
|
} else {
|
|
137
|
-
console.log(chalk.red('❌ Failed to initialize WENOX AI'));
|
|
138
101
|
reject(new Error('Failed to install dependencies'));
|
|
139
102
|
}
|
|
140
103
|
});
|
|
141
104
|
|
|
142
105
|
child.on('error', (err) => {
|
|
143
|
-
clearInterval(interval);
|
|
144
106
|
reject(err);
|
|
145
107
|
});
|
|
146
108
|
});
|
|
@@ -154,9 +116,9 @@ function checkApiKey() {
|
|
|
154
116
|
console.log('\nTo get started with WENOX:');
|
|
155
117
|
console.log('1. Get your API key from: ' + chalk.blue('https://wenox.ai/dashboard'));
|
|
156
118
|
console.log('2. Set your API key:');
|
|
157
|
-
console.log(' ' + chalk.bold('
|
|
119
|
+
console.log(' ' + chalk.bold('$env:WENOX_API_KEY="your_api_key_here"'));
|
|
158
120
|
console.log(' or');
|
|
159
|
-
console.log(' ' + chalk.bold('
|
|
121
|
+
console.log(' ' + chalk.bold('$env:OPENAI_API_KEY="your_wenox_api_key"'));
|
|
160
122
|
console.log('\n3. Run ' + chalk.cyan('wenox') + ' again');
|
|
161
123
|
process.exit(1);
|
|
162
124
|
}
|
|
@@ -190,7 +152,7 @@ async function runAider() {
|
|
|
190
152
|
// Combine default and user arguments
|
|
191
153
|
const args = [...defaultArgs, ...userArgs];
|
|
192
154
|
|
|
193
|
-
console.log(chalk.green('✅ Starting WENOX
|
|
155
|
+
console.log(chalk.green('✅ Starting WENOX Claude API Platform...\n'));
|
|
194
156
|
|
|
195
157
|
const child = spawn(python, args, {
|
|
196
158
|
stdio: 'inherit',
|
|
@@ -221,7 +183,7 @@ async function main() {
|
|
|
221
183
|
// Handle help flag
|
|
222
184
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
223
185
|
console.log(`
|
|
224
|
-
${chalk.cyan.bold('WENOX CLI')} -
|
|
186
|
+
${chalk.cyan.bold('WENOX CLI')} - Claude API Enterprise Platform
|
|
225
187
|
|
|
226
188
|
${chalk.bold('Usage:')}
|
|
227
189
|
wenox [options] [files...]
|
|
@@ -239,7 +201,7 @@ ${chalk.bold('Examples:')}
|
|
|
239
201
|
|
|
240
202
|
${chalk.bold('Setup:')}
|
|
241
203
|
1. Get API key: ${chalk.blue('https://wenox.ai/dashboard')}
|
|
242
|
-
2. Set environment: ${chalk.yellow('
|
|
204
|
+
2. Set environment: ${chalk.yellow('$env:WENOX_API_KEY="your_key"')}
|
|
243
205
|
3. Run: ${chalk.cyan('wenox')}
|
|
244
206
|
`);
|
|
245
207
|
return;
|
|
@@ -250,8 +212,8 @@ ${chalk.bold('Setup:')}
|
|
|
250
212
|
// Check Python
|
|
251
213
|
const hasPython = await checkPython();
|
|
252
214
|
if (!hasPython) {
|
|
253
|
-
console.log(chalk.red('❌ Python 3.10
|
|
254
|
-
console.log('Please install Python
|
|
215
|
+
console.log(chalk.red('❌ Python 3.10+ is required'));
|
|
216
|
+
console.log('Please install Python from: https://python.org');
|
|
255
217
|
process.exit(1);
|
|
256
218
|
}
|
|
257
219
|
|