@pigcloud/skills 1.0.10 → 1.0.11
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/cli.js +22 -37
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -468,27 +468,18 @@ function printHelp() {
|
|
|
468
468
|
console.log(' pig-skills update [--tool codex]');
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
-
async function
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
return { installed: false, skipped: false, npmPath: 'npm' };
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
async function run() {
|
|
480
|
-
const { options, positionals } = parseArgs(process.argv.slice(2));
|
|
481
|
-
const command = positionals[0];
|
|
471
|
+
async function run() {
|
|
472
|
+
const { options, positionals } = parseArgs(process.argv.slice(2));
|
|
473
|
+
const command = positionals[0];
|
|
482
474
|
|
|
483
475
|
if (!command) {
|
|
484
476
|
printHelp();
|
|
485
477
|
return;
|
|
486
478
|
}
|
|
487
479
|
|
|
488
|
-
if (command === 'init') {
|
|
489
|
-
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
490
|
-
try {
|
|
491
|
-
await ensureRuntimeForInstall();
|
|
480
|
+
if (command === 'init') {
|
|
481
|
+
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
482
|
+
try {
|
|
492
483
|
const tools = resolveRequestedTools(options.tool);
|
|
493
484
|
await installSkillsForTools(skills, tools, getInstallRoot(), { resetCodexNamespace: true });
|
|
494
485
|
console.log(chalk.green(`Installed ${skills.length} skills for ${tools.join(', ')}`));
|
|
@@ -499,10 +490,9 @@ async function run() {
|
|
|
499
490
|
return;
|
|
500
491
|
}
|
|
501
492
|
|
|
502
|
-
if (command === 'auto') {
|
|
503
|
-
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
504
|
-
try {
|
|
505
|
-
await ensureRuntimeForInstall();
|
|
493
|
+
if (command === 'auto') {
|
|
494
|
+
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
495
|
+
try {
|
|
506
496
|
const tools = resolveRequestedTools('auto');
|
|
507
497
|
await installSkillsForTools(skills, tools, getInstallRoot(), { resetCodexNamespace: true });
|
|
508
498
|
console.log(chalk.green(`Auto-installed ${skills.length} skills for ${tools.join(', ')}`));
|
|
@@ -513,13 +503,12 @@ async function run() {
|
|
|
513
503
|
return;
|
|
514
504
|
}
|
|
515
505
|
|
|
516
|
-
if (command === 'codex') {
|
|
517
|
-
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
518
|
-
try {
|
|
519
|
-
await ensureRuntimeForInstall();
|
|
506
|
+
if (command === 'codex') {
|
|
507
|
+
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
508
|
+
try {
|
|
520
509
|
await installSkills(skills, 'codex', getInstallRoot(), { resetCodexNamespace: true });
|
|
521
510
|
console.log(chalk.green(`Synced ${skills.length} skills into Codex`));
|
|
522
|
-
console.log(chalk.green(`Installed Codex command pack: ${COMMAND_PACK_NAME}`));
|
|
511
|
+
console.log(chalk.green(`Installed Codex command pack: ${COMMAND_PACK_NAME}`));
|
|
523
512
|
} catch (error) {
|
|
524
513
|
console.error(chalk.red(error.message));
|
|
525
514
|
process.exitCode = 1;
|
|
@@ -553,19 +542,15 @@ async function run() {
|
|
|
553
542
|
return;
|
|
554
543
|
}
|
|
555
544
|
|
|
556
|
-
if (command === 'bootstrap') {
|
|
557
|
-
try {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
} catch (error) {
|
|
567
|
-
console.error(chalk.red(error.message));
|
|
568
|
-
process.exitCode = 1;
|
|
545
|
+
if (command === 'bootstrap') {
|
|
546
|
+
try {
|
|
547
|
+
if (!commandAvailable('npm')) {
|
|
548
|
+
throw new Error('npm is not available. Install Node.js LTS first, then rerun the command.');
|
|
549
|
+
}
|
|
550
|
+
console.log(chalk.green('Node.js/npm runtime is already available.'));
|
|
551
|
+
} catch (error) {
|
|
552
|
+
console.error(chalk.red(error.message));
|
|
553
|
+
process.exitCode = 1;
|
|
569
554
|
}
|
|
570
555
|
return;
|
|
571
556
|
}
|