wenox-cli 1.0.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.
- package/README.md +67 -0
- package/bin/wenox.js +227 -0
- package/package.json +43 -0
- package/scripts/install-python-deps.js +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# WENOX CLI
|
|
2
|
+
|
|
3
|
+
š Advanced AI-powered development assistant for your terminal.
|
|
4
|
+
|
|
5
|
+
## Quick Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g wenox-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup & Usage
|
|
12
|
+
|
|
13
|
+
1. **Get your API key** from [WENOX Dashboard](https://wenox.ai/dashboard)
|
|
14
|
+
|
|
15
|
+
2. **Set your API key:**
|
|
16
|
+
```bash
|
|
17
|
+
export WENOX_API_KEY="your_api_key_here"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. **Start coding with AI:**
|
|
21
|
+
```bash
|
|
22
|
+
wenox
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- š¤ **Latest AI Models** - Claude, GPT-4, and more
|
|
28
|
+
- š» **Terminal Native** - Works in your existing workflow
|
|
29
|
+
- š **Real-time Collaboration** - AI pair programming
|
|
30
|
+
- š **Project Aware** - Understands your entire codebase
|
|
31
|
+
- ā” **Lightning Fast** - Optimized for productivity
|
|
32
|
+
|
|
33
|
+
## Usage Examples
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Start WENOX in current directory
|
|
37
|
+
wenox
|
|
38
|
+
|
|
39
|
+
# Work with specific files
|
|
40
|
+
wenox src/app.js components/Header.tsx
|
|
41
|
+
|
|
42
|
+
# Use different model
|
|
43
|
+
wenox --model gpt-4
|
|
44
|
+
|
|
45
|
+
# Get help
|
|
46
|
+
wenox --help
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Requirements
|
|
50
|
+
|
|
51
|
+
- Node.js 16+
|
|
52
|
+
- Python 3.10+ (auto-detected and prompted if missing)
|
|
53
|
+
|
|
54
|
+
## Environment Variables
|
|
55
|
+
|
|
56
|
+
- `WENOX_API_KEY` - Your WENOX API key (required)
|
|
57
|
+
- `WENOX_MODEL` - Default model (optional)
|
|
58
|
+
|
|
59
|
+
## Support
|
|
60
|
+
|
|
61
|
+
- š [Documentation](https://docs.wenox.ai)
|
|
62
|
+
- š¬ [Discord](https://discord.gg/wenox)
|
|
63
|
+
- š§ [Support](mailto:support@wenox.ai)
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
**WENOX** - AI-powered development, simplified.
|
package/bin/wenox.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const chalk = require('chalk');
|
|
8
|
+
const boxen = require('boxen');
|
|
9
|
+
|
|
10
|
+
// WENOX Banner
|
|
11
|
+
const banner = chalk.cyan(`
|
|
12
|
+
āāā āāāāāāāāāāāāāāā āāā āāāāāāā āāā āāā
|
|
13
|
+
āāā āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā
|
|
14
|
+
āāā āā āāāāāāāāā āāāāāā āāāāāā āāā āāāāāā
|
|
15
|
+
āāāāāāāāāāāāāāāā āāāāāāāāāāāāā āāā āāāāāā
|
|
16
|
+
āāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāā
|
|
17
|
+
āāāāāāāā āāāāāāāāāāā āāāāā āāāāāāā āāā āāā
|
|
18
|
+
|
|
19
|
+
${chalk.bold('Advanced AI Development Assistant')}
|
|
20
|
+
`);
|
|
21
|
+
|
|
22
|
+
function showWelcome() {
|
|
23
|
+
console.log(boxen(banner, {
|
|
24
|
+
padding: 1,
|
|
25
|
+
margin: 1,
|
|
26
|
+
borderStyle: 'round',
|
|
27
|
+
borderColor: 'cyan'
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function checkPython() {
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
34
|
+
const child = spawn(python, ['--version'], { stdio: 'pipe' });
|
|
35
|
+
|
|
36
|
+
child.on('close', (code) => {
|
|
37
|
+
resolve(code === 0);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
child.on('error', () => {
|
|
41
|
+
resolve(false);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function checkAider() {
|
|
47
|
+
return new Promise((resolve) => {
|
|
48
|
+
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
49
|
+
const child = spawn(python, ['-c', 'import aider'], { stdio: 'pipe' });
|
|
50
|
+
|
|
51
|
+
child.on('close', (code) => {
|
|
52
|
+
resolve(code === 0);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
child.on('error', () => {
|
|
56
|
+
resolve(false);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function installAider() {
|
|
62
|
+
console.log(chalk.yellow('š¦ Installing WENOX dependencies...'));
|
|
63
|
+
|
|
64
|
+
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
65
|
+
const pip = process.platform === 'win32' ? 'pip' : 'pip3';
|
|
66
|
+
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
const child = spawn(pip, ['install', 'aider-chat'], {
|
|
69
|
+
stdio: 'inherit',
|
|
70
|
+
shell: true
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
child.on('close', (code) => {
|
|
74
|
+
if (code === 0) {
|
|
75
|
+
console.log(chalk.green('ā
WENOX dependencies installed successfully!'));
|
|
76
|
+
resolve();
|
|
77
|
+
} else {
|
|
78
|
+
reject(new Error('Failed to install dependencies'));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
child.on('error', (err) => {
|
|
83
|
+
reject(err);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function checkApiKey() {
|
|
89
|
+
const apiKey = process.env.WENOX_API_KEY || process.env.OPENAI_API_KEY;
|
|
90
|
+
|
|
91
|
+
if (!apiKey) {
|
|
92
|
+
console.log(chalk.red('\nā WENOX API Key Required'));
|
|
93
|
+
console.log('\nTo get started with WENOX:');
|
|
94
|
+
console.log('1. Get your API key from: ' + chalk.blue('https://wenox.ai/dashboard'));
|
|
95
|
+
console.log('2. Set your API key:');
|
|
96
|
+
console.log(' ' + chalk.bold('export WENOX_API_KEY=your_api_key_here'));
|
|
97
|
+
console.log(' or');
|
|
98
|
+
console.log(' ' + chalk.bold('export OPENAI_API_KEY=your_wenox_api_key'));
|
|
99
|
+
console.log('\n3. Run ' + chalk.cyan('wenox') + ' again');
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Set OPENAI_API_KEY for aider compatibility
|
|
104
|
+
if (process.env.WENOX_API_KEY && !process.env.OPENAI_API_KEY) {
|
|
105
|
+
process.env.OPENAI_API_KEY = process.env.WENOX_API_KEY;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function setupWenoxDefaults() {
|
|
110
|
+
// Set WENOX API base URL
|
|
111
|
+
process.env.OPENAI_API_BASE = process.env.OPENAI_API_BASE || 'https://api.wenox.ai/v1';
|
|
112
|
+
process.env.OPENAI_BASE_URL = process.env.OPENAI_BASE_URL || 'https://api.wenox.ai/v1';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function runAider() {
|
|
116
|
+
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
117
|
+
|
|
118
|
+
// Default arguments for WENOX
|
|
119
|
+
const defaultArgs = [
|
|
120
|
+
'-m', 'aider.main',
|
|
121
|
+
'--model', 'claude-sonnet-4-5-20250929',
|
|
122
|
+
'--no-git',
|
|
123
|
+
'--map-tokens', '0'
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
// Get user arguments (skip 'node' and script name)
|
|
127
|
+
const userArgs = process.argv.slice(2);
|
|
128
|
+
|
|
129
|
+
// Combine default and user arguments
|
|
130
|
+
const args = [...defaultArgs, ...userArgs];
|
|
131
|
+
|
|
132
|
+
console.log(chalk.green('ā
Starting WENOX AI Assistant...\n'));
|
|
133
|
+
|
|
134
|
+
const child = spawn(python, args, {
|
|
135
|
+
stdio: 'inherit',
|
|
136
|
+
shell: true
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
child.on('close', (code) => {
|
|
140
|
+
if (code !== 0) {
|
|
141
|
+
console.log(chalk.yellow('\nš Thanks for using WENOX!'));
|
|
142
|
+
}
|
|
143
|
+
process.exit(code);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
child.on('error', (err) => {
|
|
147
|
+
console.error(chalk.red('ā Error starting WENOX:'), err.message);
|
|
148
|
+
process.exit(1);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function main() {
|
|
153
|
+
// Handle version flag
|
|
154
|
+
if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
155
|
+
const packageJson = require('../package.json');
|
|
156
|
+
console.log(`WENOX CLI v${packageJson.version}`);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Handle help flag
|
|
161
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
162
|
+
console.log(`
|
|
163
|
+
${chalk.cyan.bold('WENOX CLI')} - Advanced AI Development Assistant
|
|
164
|
+
|
|
165
|
+
${chalk.bold('Usage:')}
|
|
166
|
+
wenox [options] [files...]
|
|
167
|
+
|
|
168
|
+
${chalk.bold('Options:')}
|
|
169
|
+
-h, --help Show help
|
|
170
|
+
-v, --version Show version
|
|
171
|
+
--model MODEL Specify AI model to use
|
|
172
|
+
--no-git Disable git integration
|
|
173
|
+
|
|
174
|
+
${chalk.bold('Examples:')}
|
|
175
|
+
wenox # Start WENOX in current directory
|
|
176
|
+
wenox file1.py file2.js # Work with specific files
|
|
177
|
+
wenox --model gpt-4 # Use specific model
|
|
178
|
+
|
|
179
|
+
${chalk.bold('Setup:')}
|
|
180
|
+
1. Get API key: ${chalk.blue('https://wenox.ai/dashboard')}
|
|
181
|
+
2. Set environment: ${chalk.yellow('export WENOX_API_KEY=your_key')}
|
|
182
|
+
3. Run: ${chalk.cyan('wenox')}
|
|
183
|
+
`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
showWelcome();
|
|
188
|
+
|
|
189
|
+
// Check Python
|
|
190
|
+
const hasPython = await checkPython();
|
|
191
|
+
if (!hasPython) {
|
|
192
|
+
console.log(chalk.red('ā Python 3.10+ is required'));
|
|
193
|
+
console.log('Please install Python from: https://python.org');
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Check and install aider if needed
|
|
198
|
+
const hasAider = await checkAider();
|
|
199
|
+
if (!hasAider) {
|
|
200
|
+
try {
|
|
201
|
+
await installAider();
|
|
202
|
+
} catch (err) {
|
|
203
|
+
console.error(chalk.red('ā Failed to install dependencies:'), err.message);
|
|
204
|
+
process.exit(1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Setup WENOX defaults
|
|
209
|
+
setupWenoxDefaults();
|
|
210
|
+
|
|
211
|
+
// Check API key
|
|
212
|
+
checkApiKey();
|
|
213
|
+
|
|
214
|
+
// Run aider with WENOX branding
|
|
215
|
+
await runAider();
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Handle Ctrl+C gracefully
|
|
219
|
+
process.on('SIGINT', () => {
|
|
220
|
+
console.log(chalk.yellow('\nš Thanks for using WENOX!'));
|
|
221
|
+
process.exit(0);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
main().catch(err => {
|
|
225
|
+
console.error(chalk.red('ā Error:'), err.message);
|
|
226
|
+
process.exit(1);
|
|
227
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wenox-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "WENOX AI - Advanced AI-powered development assistant",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"wenox": "bin/wenox.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node scripts/install-python-deps.js",
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"ai",
|
|
15
|
+
"cli",
|
|
16
|
+
"development",
|
|
17
|
+
"assistant",
|
|
18
|
+
"wenox",
|
|
19
|
+
"coding"
|
|
20
|
+
],
|
|
21
|
+
"author": "WENOX Team",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"homepage": "https://wenox.ai",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/wenox/wenox-cli.git"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"chalk": "^5.3.0",
|
|
30
|
+
"inquirer": "^9.2.12",
|
|
31
|
+
"ora": "^7.0.1",
|
|
32
|
+
"boxen": "^7.1.1",
|
|
33
|
+
"node-fetch": "^3.3.2"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=16.0.0"
|
|
37
|
+
},
|
|
38
|
+
"os": [
|
|
39
|
+
"darwin",
|
|
40
|
+
"linux",
|
|
41
|
+
"win32"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
|
|
6
|
+
console.log(chalk.cyan('š Setting up WENOX CLI...'));
|
|
7
|
+
|
|
8
|
+
function checkPython() {
|
|
9
|
+
return new Promise((resolve) => {
|
|
10
|
+
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
11
|
+
const child = spawn(python, ['--version'], { stdio: 'pipe' });
|
|
12
|
+
|
|
13
|
+
child.on('close', (code) => {
|
|
14
|
+
resolve(code === 0);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
child.on('error', () => {
|
|
18
|
+
resolve(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function main() {
|
|
24
|
+
const hasPython = await checkPython();
|
|
25
|
+
|
|
26
|
+
if (!hasPython) {
|
|
27
|
+
console.log(chalk.yellow('ā ļø Python 3.10+ is required for WENOX CLI'));
|
|
28
|
+
console.log('Please install Python from: https://python.org');
|
|
29
|
+
console.log('After installing Python, run: ' + chalk.cyan('npm install -g wenox-cli'));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.log(chalk.green('ā
Python detected'));
|
|
34
|
+
console.log(chalk.green('ā
WENOX CLI is ready!'));
|
|
35
|
+
console.log('\nNext steps:');
|
|
36
|
+
console.log('1. Get your API key: ' + chalk.blue('https://wenox.ai/dashboard'));
|
|
37
|
+
console.log('2. Set environment: ' + chalk.yellow('export WENOX_API_KEY=your_key'));
|
|
38
|
+
console.log('3. Run: ' + chalk.cyan('wenox'));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
main();
|