videonut 1.2.6 → 1.2.8
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 +102 -54
- package/package.json +1 -1
- package/setup.js +89 -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,66 +434,102 @@ 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
|
|
463
|
+
console.log('\n📦 CLI Installation:');
|
|
464
|
+
console.log(' 1. Install BOTH Gemini + Qwen (⭐ RECOMMENDED)');
|
|
465
|
+
console.log(' → Gemini: Best for content writing & creativity');
|
|
466
|
+
console.log(' → Qwen: Best for instruction following & agent tasks');
|
|
467
|
+
console.log(' 2. Install Gemini CLI only (by Google)');
|
|
468
|
+
console.log(' 3. Install Qwen CLI only (by Alibaba)');
|
|
431
469
|
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'; }
|
|
470
|
+
console.log(' 4. Skip - Use existing CLI\n');
|
|
436
471
|
} 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
472
|
console.log(' 4. Skip - I will install manually\n');
|
|
473
|
+
}
|
|
444
474
|
|
|
445
|
-
|
|
475
|
+
const choice = await ask('Enter choice [1 for BOTH]: ');
|
|
446
476
|
|
|
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
|
-
|
|
477
|
+
if (choice === '2') {
|
|
478
|
+
// Install Gemini CLI only
|
|
479
|
+
try {
|
|
480
|
+
info('Installing Gemini CLI globally...');
|
|
481
|
+
execSync('npm install -g @google/gemini-cli', { stdio: 'inherit' });
|
|
482
|
+
success('Gemini CLI installed successfully!');
|
|
483
|
+
info('Run "gemini" to start - Best for content writing');
|
|
484
|
+
selectedCli = 'gemini';
|
|
485
|
+
} catch (e) {
|
|
486
|
+
error('Failed to install Gemini CLI');
|
|
487
|
+
info('Please install manually: npm install -g @google/gemini-cli');
|
|
488
|
+
}
|
|
489
|
+
} else if (choice === '3') {
|
|
490
|
+
// Install Qwen CLI only
|
|
491
|
+
try {
|
|
492
|
+
info('Installing Qwen CLI globally...');
|
|
493
|
+
execSync('npm install -g @qwen-code/qwen-code', { stdio: 'inherit' });
|
|
494
|
+
success('Qwen CLI installed successfully!');
|
|
495
|
+
info('Run "qwen" to start - Best for instruction following');
|
|
496
|
+
selectedCli = 'qwen';
|
|
497
|
+
} catch (e) {
|
|
498
|
+
error('Failed to install Qwen CLI');
|
|
499
|
+
info('Please install manually: npm install -g @qwen-code/qwen-code');
|
|
500
|
+
}
|
|
501
|
+
} else if (choice === '4') {
|
|
502
|
+
// Skip - use existing or none
|
|
503
|
+
if (hasGemini) selectedCli = 'gemini';
|
|
504
|
+
else if (hasQwen) selectedCli = 'qwen';
|
|
505
|
+
else if (hasClaude) selectedCli = 'claude';
|
|
506
|
+
info('Skipped CLI installation');
|
|
507
|
+
} else {
|
|
508
|
+
// Install BOTH Gemini + Qwen (default for choice 1 or empty)
|
|
509
|
+
info('Installing BOTH Gemini CLI and Qwen CLI...\n');
|
|
510
|
+
|
|
511
|
+
// Install Gemini
|
|
512
|
+
try {
|
|
513
|
+
info('Installing Gemini CLI globally...');
|
|
514
|
+
execSync('npm install -g @google/gemini-cli', { stdio: 'inherit' });
|
|
515
|
+
success('Gemini CLI installed! (Best for content writing)');
|
|
516
|
+
} catch (e) {
|
|
517
|
+
warning('Could not install Gemini CLI');
|
|
484
518
|
}
|
|
519
|
+
|
|
520
|
+
// Install Qwen
|
|
521
|
+
try {
|
|
522
|
+
info('Installing Qwen CLI globally...');
|
|
523
|
+
execSync('npm install -g @qwen-code/qwen-code', { stdio: 'inherit' });
|
|
524
|
+
success('Qwen CLI installed! (Best for instruction following)');
|
|
525
|
+
} catch (e) {
|
|
526
|
+
warning('Could not install Qwen CLI');
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
selectedCli = 'gemini'; // Default to Gemini for launch
|
|
530
|
+
console.log('\n✅ Both CLIs installed!');
|
|
531
|
+
console.log(' Use "gemini" for creative content');
|
|
532
|
+
console.log(' Use "qwen" for agent/instruction tasks');
|
|
485
533
|
}
|
|
486
534
|
|
|
487
535
|
// ═══════════════════════════════════════════════════════════════
|
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,52 +274,87 @@ 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
|
+
}
|
|
267
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
|
+
}
|
|
299
|
+
|
|
300
|
+
// Always offer installation choice
|
|
301
|
+
console.log('\n📦 CLI Installation:');
|
|
302
|
+
console.log(' 1. Install BOTH Gemini + Qwen (⭐ RECOMMENDED)');
|
|
303
|
+
console.log(' → Gemini: Best for content writing & creativity');
|
|
304
|
+
console.log(' → Qwen: Best for instruction following & agent tasks');
|
|
305
|
+
console.log(' 2. Install Gemini CLI only (by Google)');
|
|
306
|
+
console.log(' 3. Install Qwen CLI only (by Alibaba)');
|
|
268
307
|
if (hasGemini || hasQwen || hasClaude) {
|
|
269
|
-
|
|
270
|
-
if (hasQwen) success('Qwen CLI found');
|
|
271
|
-
if (hasClaude) success('Claude CLI found');
|
|
308
|
+
console.log(' 4. Skip - Use existing CLI\n');
|
|
272
309
|
} 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
310
|
console.log(' 4. Skip - I will install manually\n');
|
|
311
|
+
}
|
|
279
312
|
|
|
280
|
-
|
|
313
|
+
const answer = await ask('Enter choice [1 for BOTH]: ');
|
|
281
314
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
} else if (answer === '3') {
|
|
292
|
-
try {
|
|
293
|
-
info('Installing Qwen CLI globally...');
|
|
294
|
-
execSync('npm install -g @qwen-code/qwen-code', { stdio: 'inherit' });
|
|
295
|
-
success('Qwen CLI installed! Run "qwen" to start.');
|
|
296
|
-
} catch (e) {
|
|
297
|
-
warning('Could not install CLI.');
|
|
298
|
-
info('Install manually: npm install -g @qwen-code/qwen-code');
|
|
299
|
-
}
|
|
300
|
-
} else if (answer !== '4') {
|
|
301
|
-
try {
|
|
302
|
-
info('Installing Gemini CLI globally...');
|
|
303
|
-
execSync('npm install -g @google/gemini-cli', { stdio: 'inherit' });
|
|
304
|
-
success('Gemini CLI installed! Run "gemini" to start.');
|
|
305
|
-
} catch (e) {
|
|
306
|
-
warning('Could not install CLI.');
|
|
307
|
-
info('Install manually: npm install -g @google/gemini-cli');
|
|
308
|
-
}
|
|
315
|
+
if (answer === '2') {
|
|
316
|
+
// Install Gemini CLI only
|
|
317
|
+
try {
|
|
318
|
+
info('Installing Gemini CLI globally...');
|
|
319
|
+
execSync('npm install -g @google/gemini-cli', { stdio: 'inherit' });
|
|
320
|
+
success('Gemini CLI installed! (Best for content writing)');
|
|
321
|
+
} catch (e) {
|
|
322
|
+
warning('Could not install Gemini CLI.');
|
|
323
|
+
info('Install manually: npm install -g @google/gemini-cli');
|
|
309
324
|
}
|
|
325
|
+
} else if (answer === '3') {
|
|
326
|
+
// Install Qwen CLI only
|
|
327
|
+
try {
|
|
328
|
+
info('Installing Qwen CLI globally...');
|
|
329
|
+
execSync('npm install -g @qwen-code/qwen-code', { stdio: 'inherit' });
|
|
330
|
+
success('Qwen CLI installed! (Best for instruction following)');
|
|
331
|
+
} catch (e) {
|
|
332
|
+
warning('Could not install Qwen CLI.');
|
|
333
|
+
info('Install manually: npm install -g @qwen-code/qwen-code');
|
|
334
|
+
}
|
|
335
|
+
} else if (answer !== '4') {
|
|
336
|
+
// Install BOTH Gemini + Qwen (default)
|
|
337
|
+
info('Installing BOTH Gemini CLI and Qwen CLI...\n');
|
|
338
|
+
|
|
339
|
+
try {
|
|
340
|
+
info('Installing Gemini CLI globally...');
|
|
341
|
+
execSync('npm install -g @google/gemini-cli', { stdio: 'inherit' });
|
|
342
|
+
success('Gemini CLI installed! (Best for content writing)');
|
|
343
|
+
} catch (e) {
|
|
344
|
+
warning('Could not install Gemini CLI.');
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
try {
|
|
348
|
+
info('Installing Qwen CLI globally...');
|
|
349
|
+
execSync('npm install -g @qwen-code/qwen-code', { stdio: 'inherit' });
|
|
350
|
+
success('Qwen CLI installed! (Best for instruction following)');
|
|
351
|
+
} catch (e) {
|
|
352
|
+
warning('Could not install Qwen CLI.');
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
console.log('\n✅ Both CLIs installed!');
|
|
356
|
+
console.log(' Use "gemini" for creative content');
|
|
357
|
+
console.log(' Use "qwen" for agent/instruction tasks');
|
|
310
358
|
}
|
|
311
359
|
|
|
312
360
|
// ═══════════════════════════════════════════════════════════════
|