wenox-cli 1.0.3 ā 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 +12 -59
- package/package.json +1 -1
package/bin/wenox.js
CHANGED
|
@@ -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,56 +82,27 @@ function checkAider() {
|
|
|
99
82
|
}
|
|
100
83
|
|
|
101
84
|
async function installAider() {
|
|
102
|
-
console.log(chalk.cyan('
|
|
103
|
-
|
|
104
|
-
// Loading animation
|
|
105
|
-
const frames = ['ā ', 'ā ', 'ā ¹', 'ā ø', 'ā ¼', 'ā “', 'ā ¦', 'ā §', 'ā ', 'ā '];
|
|
106
|
-
let i = 0;
|
|
107
|
-
|
|
108
|
-
const loadingInterval = setInterval(() => {
|
|
109
|
-
process.stdout.write(`\r${chalk.cyan(frames[i % frames.length])} Setting up Claude API environment...`);
|
|
110
|
-
i++;
|
|
111
|
-
}, 100);
|
|
85
|
+
console.log(chalk.cyan('š¦ Installing WENOX dependencies...'));
|
|
112
86
|
|
|
113
87
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
114
88
|
const pip = process.platform === 'win32' ? 'pip' : 'pip3';
|
|
115
89
|
|
|
116
90
|
return new Promise((resolve, reject) => {
|
|
117
|
-
const child = spawn(pip, ['install', 'aider-chat'
|
|
118
|
-
stdio: '
|
|
91
|
+
const child = spawn(pip, ['install', 'aider-chat'], {
|
|
92
|
+
stdio: 'inherit', // Show all output for debugging
|
|
119
93
|
shell: true
|
|
120
94
|
});
|
|
121
95
|
|
|
122
|
-
// Timeout after 2 minutes
|
|
123
|
-
const timeout = setTimeout(() => {
|
|
124
|
-
clearInterval(loadingInterval);
|
|
125
|
-
child.kill();
|
|
126
|
-
console.log(chalk.red('\nā Installation timeout. Please check your internet connection.'));
|
|
127
|
-
reject(new Error('Installation timeout'));
|
|
128
|
-
}, 120000);
|
|
129
|
-
|
|
130
96
|
child.on('close', (code) => {
|
|
131
|
-
clearTimeout(timeout);
|
|
132
|
-
clearInterval(loadingInterval);
|
|
133
|
-
process.stdout.write('\r' + ' '.repeat(50) + '\r'); // Clear loading line
|
|
134
|
-
|
|
135
97
|
if (code === 0) {
|
|
136
|
-
console.log(chalk.green('ā
WENOX
|
|
137
|
-
console.log(chalk.cyan('š Connected to Claude API servers'));
|
|
98
|
+
console.log(chalk.green('ā
WENOX dependencies installed successfully!'));
|
|
138
99
|
resolve();
|
|
139
100
|
} else {
|
|
140
|
-
console.log(chalk.red('ā Failed to initialize WENOX Platform'));
|
|
141
|
-
console.log(chalk.yellow('š” Try: pip install --upgrade pip setuptools wheel'));
|
|
142
|
-
console.log(chalk.yellow('š” Or install Python 3.11/3.12 from python.org'));
|
|
143
101
|
reject(new Error('Failed to install dependencies'));
|
|
144
102
|
}
|
|
145
103
|
});
|
|
146
104
|
|
|
147
105
|
child.on('error', (err) => {
|
|
148
|
-
clearTimeout(timeout);
|
|
149
|
-
clearInterval(loadingInterval);
|
|
150
|
-
process.stdout.write('\r' + ' '.repeat(50) + '\r');
|
|
151
|
-
console.log(chalk.red('ā Installation failed'));
|
|
152
106
|
reject(err);
|
|
153
107
|
});
|
|
154
108
|
});
|
|
@@ -162,9 +116,9 @@ function checkApiKey() {
|
|
|
162
116
|
console.log('\nTo get started with WENOX:');
|
|
163
117
|
console.log('1. Get your API key from: ' + chalk.blue('https://wenox.ai/dashboard'));
|
|
164
118
|
console.log('2. Set your API key:');
|
|
165
|
-
console.log(' ' + chalk.bold('
|
|
119
|
+
console.log(' ' + chalk.bold('$env:WENOX_API_KEY="your_api_key_here"'));
|
|
166
120
|
console.log(' or');
|
|
167
|
-
console.log(' ' + chalk.bold('
|
|
121
|
+
console.log(' ' + chalk.bold('$env:OPENAI_API_KEY="your_wenox_api_key"'));
|
|
168
122
|
console.log('\n3. Run ' + chalk.cyan('wenox') + ' again');
|
|
169
123
|
process.exit(1);
|
|
170
124
|
}
|
|
@@ -198,7 +152,7 @@ async function runAider() {
|
|
|
198
152
|
// Combine default and user arguments
|
|
199
153
|
const args = [...defaultArgs, ...userArgs];
|
|
200
154
|
|
|
201
|
-
console.log(chalk.green('ā
|
|
155
|
+
console.log(chalk.green('ā
Starting WENOX Claude API Platform...\n'));
|
|
202
156
|
|
|
203
157
|
const child = spawn(python, args, {
|
|
204
158
|
stdio: 'inherit',
|
|
@@ -229,7 +183,7 @@ async function main() {
|
|
|
229
183
|
// Handle help flag
|
|
230
184
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
231
185
|
console.log(`
|
|
232
|
-
${chalk.cyan.bold('WENOX CLI')} -
|
|
186
|
+
${chalk.cyan.bold('WENOX CLI')} - Claude API Enterprise Platform
|
|
233
187
|
|
|
234
188
|
${chalk.bold('Usage:')}
|
|
235
189
|
wenox [options] [files...]
|
|
@@ -247,7 +201,7 @@ ${chalk.bold('Examples:')}
|
|
|
247
201
|
|
|
248
202
|
${chalk.bold('Setup:')}
|
|
249
203
|
1. Get API key: ${chalk.blue('https://wenox.ai/dashboard')}
|
|
250
|
-
2. Set environment: ${chalk.yellow('
|
|
204
|
+
2. Set environment: ${chalk.yellow('$env:WENOX_API_KEY="your_key"')}
|
|
251
205
|
3. Run: ${chalk.cyan('wenox')}
|
|
252
206
|
`);
|
|
253
207
|
return;
|
|
@@ -258,9 +212,8 @@ ${chalk.bold('Setup:')}
|
|
|
258
212
|
// Check Python
|
|
259
213
|
const hasPython = await checkPython();
|
|
260
214
|
if (!hasPython) {
|
|
261
|
-
console.log(chalk.red('ā Python 3.10
|
|
262
|
-
console.log(
|
|
263
|
-
console.log(chalk.yellow('š” After install, restart terminal and try again'));
|
|
215
|
+
console.log(chalk.red('ā Python 3.10+ is required'));
|
|
216
|
+
console.log('Please install Python from: https://python.org');
|
|
264
217
|
process.exit(1);
|
|
265
218
|
}
|
|
266
219
|
|