videonut 1.2.6 → 1.2.7
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/videonut.js +86 -54
- package/package.json +1 -1
- package/setup.js +71 -41
package/bin/videonut.js
CHANGED
|
@@ -259,13 +259,25 @@ async function runInit() {
|
|
|
259
259
|
? path.join(localPythonDir, 'python.exe')
|
|
260
260
|
: path.join(localPythonDir, 'bin', 'python3');
|
|
261
261
|
|
|
262
|
-
// Check for system Python first
|
|
263
|
-
|
|
262
|
+
// Check for system Python first (must actually work, not just exist)
|
|
263
|
+
// Windows has a fake 'python' command that opens Microsoft Store
|
|
264
|
+
function isPythonWorking(cmd) {
|
|
265
|
+
try {
|
|
266
|
+
const result = execSync(`"${cmd}" --version`, { stdio: 'pipe', timeout: 5000 });
|
|
267
|
+
return result.toString().toLowerCase().includes('python');
|
|
268
|
+
} catch {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (isPythonWorking('python3')) {
|
|
264
274
|
pythonCmd = 'python3';
|
|
265
275
|
success('Found system Python3');
|
|
266
|
-
} else if (
|
|
276
|
+
} else if (isPythonWorking('python')) {
|
|
267
277
|
pythonCmd = 'python';
|
|
268
278
|
success('Found system Python');
|
|
279
|
+
} else {
|
|
280
|
+
info('No working Python found on system');
|
|
269
281
|
}
|
|
270
282
|
|
|
271
283
|
// If no Python found, download it (Windows only for now)
|
|
@@ -422,65 +434,85 @@ async function runInit() {
|
|
|
422
434
|
// ═══════════════════════════════════════════════════════════════
|
|
423
435
|
header('Step 5/6: Setting Up AI CLI');
|
|
424
436
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
437
|
+
// Verify CLI actually works (not just exists in PATH)
|
|
438
|
+
function isCliWorking(cmd) {
|
|
439
|
+
try {
|
|
440
|
+
execSync(`${cmd} --version`, { stdio: 'pipe', timeout: 10000 });
|
|
441
|
+
return true;
|
|
442
|
+
} catch {
|
|
443
|
+
return false;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const hasGemini = isCliWorking('gemini');
|
|
448
|
+
const hasQwen = isCliWorking('qwen');
|
|
449
|
+
const hasClaude = isCliWorking('claude');
|
|
428
450
|
|
|
429
451
|
let selectedCli = null;
|
|
430
452
|
|
|
453
|
+
// Show what's detected
|
|
454
|
+
console.log('Checking installed CLIs...');
|
|
455
|
+
if (hasGemini) { success(' Gemini CLI - Installed'); }
|
|
456
|
+
if (hasQwen) { success(' Qwen CLI - Installed'); }
|
|
457
|
+
if (hasClaude) { success(' Claude CLI - Installed'); }
|
|
458
|
+
if (!hasGemini && !hasQwen && !hasClaude) {
|
|
459
|
+
info(' No AI CLI currently installed');
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// Always offer installation choice (Gemini recommended)
|
|
463
|
+
console.log('\n📦 CLI Installation:');
|
|
464
|
+
console.log(' 1. Install Gemini CLI (recommended - by Google)');
|
|
465
|
+
console.log(' 2. Install Claude CLI (by Anthropic)');
|
|
466
|
+
console.log(' 3. Install Qwen CLI (by Alibaba)');
|
|
431
467
|
if (hasGemini || hasQwen || hasClaude) {
|
|
432
|
-
console.log('
|
|
433
|
-
if (hasGemini) { success(' Gemini CLI - Installed'); selectedCli = 'gemini'; }
|
|
434
|
-
if (hasQwen) { success(' Qwen CLI - Installed'); selectedCli = selectedCli || 'qwen'; }
|
|
435
|
-
if (hasClaude) { success(' Claude CLI - Installed'); selectedCli = selectedCli || 'claude'; }
|
|
468
|
+
console.log(' 4. Skip - Use existing CLI\n');
|
|
436
469
|
} else {
|
|
437
|
-
info('No AI CLI found. Installing Gemini CLI (recommended)...\n');
|
|
438
|
-
|
|
439
|
-
console.log('Which CLI would you like to install?');
|
|
440
|
-
console.log(' 1. Gemini CLI (recommended - by Google)');
|
|
441
|
-
console.log(' 2. Claude CLI (by Anthropic)');
|
|
442
|
-
console.log(' 3. Qwen CLI (by Alibaba)');
|
|
443
470
|
console.log(' 4. Skip - I will install manually\n');
|
|
471
|
+
}
|
|
444
472
|
|
|
445
|
-
|
|
473
|
+
const choice = await ask('Enter choice [1 for Gemini]: ');
|
|
446
474
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
475
|
+
if (choice === '2') {
|
|
476
|
+
// Install Claude CLI
|
|
477
|
+
try {
|
|
478
|
+
info('Installing Claude CLI globally...');
|
|
479
|
+
execSync('npm install -g @anthropic-ai/claude-code', { stdio: 'inherit' });
|
|
480
|
+
success('Claude CLI installed successfully!');
|
|
481
|
+
info('Run "claude" to start Claude CLI');
|
|
482
|
+
selectedCli = 'claude';
|
|
483
|
+
} catch (e) {
|
|
484
|
+
error('Failed to install Claude CLI');
|
|
485
|
+
info('Please install manually: npm install -g @anthropic-ai/claude-code');
|
|
486
|
+
}
|
|
487
|
+
} else if (choice === '3') {
|
|
488
|
+
// Install Qwen CLI
|
|
489
|
+
try {
|
|
490
|
+
info('Installing Qwen CLI globally...');
|
|
491
|
+
execSync('npm install -g @qwen-code/qwen-code', { stdio: 'inherit' });
|
|
492
|
+
success('Qwen CLI installed successfully!');
|
|
493
|
+
info('Run "qwen" to start Qwen CLI');
|
|
494
|
+
selectedCli = 'qwen';
|
|
495
|
+
} catch (e) {
|
|
496
|
+
error('Failed to install Qwen CLI');
|
|
497
|
+
info('Please install manually: npm install -g @qwen-code/qwen-code');
|
|
498
|
+
}
|
|
499
|
+
} else if (choice === '4') {
|
|
500
|
+
// Skip - use existing or none
|
|
501
|
+
if (hasGemini) selectedCli = 'gemini';
|
|
502
|
+
else if (hasQwen) selectedCli = 'qwen';
|
|
503
|
+
else if (hasClaude) selectedCli = 'claude';
|
|
504
|
+
info('Skipped CLI installation');
|
|
505
|
+
} else {
|
|
506
|
+
// Install Gemini CLI (default for choice 1 or empty)
|
|
507
|
+
try {
|
|
508
|
+
info('Installing Gemini CLI globally...');
|
|
509
|
+
execSync('npm install -g @google/gemini-cli', { stdio: 'inherit' });
|
|
510
|
+
success('Gemini CLI installed successfully!');
|
|
511
|
+
info('Run "gemini" to start Gemini CLI');
|
|
512
|
+
selectedCli = 'gemini';
|
|
513
|
+
} catch (e) {
|
|
514
|
+
warning('Could not auto-install Gemini CLI');
|
|
515
|
+
info('Please install manually: npm install -g @google/gemini-cli');
|
|
484
516
|
}
|
|
485
517
|
}
|
|
486
518
|
|
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -128,12 +128,25 @@ async function main() {
|
|
|
128
128
|
|
|
129
129
|
let pythonCmd = null;
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
// Check for system Python (must actually work, not just exist)
|
|
132
|
+
// Windows has a fake 'python' command that opens Microsoft Store
|
|
133
|
+
function isPythonWorking(cmd) {
|
|
134
|
+
try {
|
|
135
|
+
const result = execSync(`"${cmd}" --version`, { stdio: 'pipe', timeout: 5000 });
|
|
136
|
+
return result.toString().toLowerCase().includes('python');
|
|
137
|
+
} catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (isPythonWorking('python3')) {
|
|
132
143
|
pythonCmd = 'python3';
|
|
133
144
|
success('Found Python3');
|
|
134
|
-
} else if (
|
|
145
|
+
} else if (isPythonWorking('python')) {
|
|
135
146
|
pythonCmd = 'python';
|
|
136
147
|
success('Found Python');
|
|
148
|
+
} else {
|
|
149
|
+
info('No working Python found on system');
|
|
137
150
|
}
|
|
138
151
|
|
|
139
152
|
if (!pythonCmd && isWindows) {
|
|
@@ -261,51 +274,68 @@ async function main() {
|
|
|
261
274
|
// ═══════════════════════════════════════════════════════════════
|
|
262
275
|
header('Step 4/4: Checking AI CLI');
|
|
263
276
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
277
|
+
// Verify CLI actually works (not just exists in PATH)
|
|
278
|
+
function isCliWorking(cmd) {
|
|
279
|
+
try {
|
|
280
|
+
execSync(`${cmd} --version`, { stdio: 'pipe', timeout: 10000 });
|
|
281
|
+
return true;
|
|
282
|
+
} catch {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const hasGemini = isCliWorking('gemini');
|
|
288
|
+
const hasQwen = isCliWorking('qwen');
|
|
289
|
+
const hasClaude = isCliWorking('claude');
|
|
290
|
+
|
|
291
|
+
// Show what's detected
|
|
292
|
+
console.log('Checking installed CLIs...');
|
|
293
|
+
if (hasGemini) { success(' Gemini CLI - Installed'); }
|
|
294
|
+
if (hasQwen) { success(' Qwen CLI - Installed'); }
|
|
295
|
+
if (hasClaude) { success(' Claude CLI - Installed'); }
|
|
296
|
+
if (!hasGemini && !hasQwen && !hasClaude) {
|
|
297
|
+
info(' No AI CLI currently installed');
|
|
298
|
+
}
|
|
267
299
|
|
|
300
|
+
// Always offer installation choice (Gemini recommended)
|
|
301
|
+
console.log('\n📦 CLI Installation:');
|
|
302
|
+
console.log(' 1. Install Gemini CLI (recommended - by Google)');
|
|
303
|
+
console.log(' 2. Install Claude CLI (by Anthropic)');
|
|
304
|
+
console.log(' 3. Install Qwen CLI (by Alibaba)');
|
|
268
305
|
if (hasGemini || hasQwen || hasClaude) {
|
|
269
|
-
|
|
270
|
-
if (hasQwen) success('Qwen CLI found');
|
|
271
|
-
if (hasClaude) success('Claude CLI found');
|
|
306
|
+
console.log(' 4. Skip - Use existing CLI\n');
|
|
272
307
|
} else {
|
|
273
|
-
warning('No AI CLI found.');
|
|
274
|
-
console.log('\nWhich CLI would you like to install?');
|
|
275
|
-
console.log(' 1. Gemini CLI (recommended - by Google)');
|
|
276
|
-
console.log(' 2. Claude CLI (by Anthropic)');
|
|
277
|
-
console.log(' 3. Qwen CLI (by Alibaba)');
|
|
278
308
|
console.log(' 4. Skip - I will install manually\n');
|
|
309
|
+
}
|
|
279
310
|
|
|
280
|
-
|
|
311
|
+
const answer = await ask('Enter choice [1 for Gemini]: ');
|
|
281
312
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
313
|
+
if (answer === '2') {
|
|
314
|
+
try {
|
|
315
|
+
info('Installing Claude CLI globally...');
|
|
316
|
+
execSync('npm install -g @anthropic-ai/claude-code', { stdio: 'inherit' });
|
|
317
|
+
success('Claude CLI installed! Run "claude" to start.');
|
|
318
|
+
} catch (e) {
|
|
319
|
+
warning('Could not install CLI.');
|
|
320
|
+
info('Install manually: npm install -g @anthropic-ai/claude-code');
|
|
321
|
+
}
|
|
322
|
+
} else if (answer === '3') {
|
|
323
|
+
try {
|
|
324
|
+
info('Installing Qwen CLI globally...');
|
|
325
|
+
execSync('npm install -g @qwen-code/qwen-code', { stdio: 'inherit' });
|
|
326
|
+
success('Qwen CLI installed! Run "qwen" to start.');
|
|
327
|
+
} catch (e) {
|
|
328
|
+
warning('Could not install CLI.');
|
|
329
|
+
info('Install manually: npm install -g @qwen-code/qwen-code');
|
|
330
|
+
}
|
|
331
|
+
} else if (answer !== '4') {
|
|
332
|
+
try {
|
|
333
|
+
info('Installing Gemini CLI globally...');
|
|
334
|
+
execSync('npm install -g @google/gemini-cli', { stdio: 'inherit' });
|
|
335
|
+
success('Gemini CLI installed! Run "gemini" to start.');
|
|
336
|
+
} catch (e) {
|
|
337
|
+
warning('Could not install CLI.');
|
|
338
|
+
info('Install manually: npm install -g @google/gemini-cli');
|
|
309
339
|
}
|
|
310
340
|
}
|
|
311
341
|
|