skillbin 0.1.1 → 0.1.2
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/skillbin.js +21 -14
- package/package.json +1 -1
package/bin/skillbin.js
CHANGED
|
@@ -88,20 +88,24 @@ async function install(ref, opts) {
|
|
|
88
88
|
throw new Error('Skill has no files');
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
let
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
91
|
+
let destDir;
|
|
92
|
+
if (opts.dir) {
|
|
93
|
+
destDir = path.resolve(opts.dir);
|
|
94
|
+
} else {
|
|
95
|
+
let scope = opts.scope;
|
|
96
|
+
if (getFormatConfig(format).hasScope && !scope) {
|
|
97
|
+
if (process.stdin.isTTY) {
|
|
98
|
+
console.error(`\nInstall "${skillName}" (${format}) to:`);
|
|
99
|
+
console.error(' 1) Global (~/.claude/skills/)');
|
|
100
|
+
console.error(' 2) Project (.claude/skills/ in current directory)\n');
|
|
101
|
+
const choice = await promptUser('Choice (1 or 2, default 1): ');
|
|
102
|
+
scope = choice === '2' ? 'project' : 'global';
|
|
103
|
+
} else {
|
|
104
|
+
scope = 'global';
|
|
105
|
+
}
|
|
101
106
|
}
|
|
107
|
+
destDir = resolveInstallDir(skillName, scope, format);
|
|
102
108
|
}
|
|
103
|
-
|
|
104
|
-
const destDir = resolveInstallDir(skillName, scope, format);
|
|
105
109
|
fs.mkdirSync(destDir, { recursive: true });
|
|
106
110
|
|
|
107
111
|
for (const file of files) {
|
|
@@ -401,6 +405,7 @@ Usage:
|
|
|
401
405
|
Options:
|
|
402
406
|
--global Install to ~/.claude/skills/ (default for claude format)
|
|
403
407
|
--project Install to .claude/skills/ in current directory
|
|
408
|
+
--dir=<path> Install to a custom directory (overrides --global/--project)
|
|
404
409
|
--token=<token> API token for auth
|
|
405
410
|
--all Upload all local skills (all formats)
|
|
406
411
|
--help, -h Show this help
|
|
@@ -416,6 +421,7 @@ Supported formats:
|
|
|
416
421
|
Examples:
|
|
417
422
|
npx skillbin https://skillb.in/s/abc123
|
|
418
423
|
npx skillbin install abc123 --project
|
|
424
|
+
npx skillbin install abc123 --dir=./my-skills/
|
|
419
425
|
npx skillbin upload ./my-skill/
|
|
420
426
|
npx skillbin upload .cursor/rules/my-rule.mdc
|
|
421
427
|
npx skillbin upload --all --token=abc123
|
|
@@ -435,6 +441,7 @@ async function main() {
|
|
|
435
441
|
|
|
436
442
|
const token = flags.token || process.env.SKILLBIN_TOKEN || '';
|
|
437
443
|
const scope = flags.project ? 'project' : flags.global ? 'global' : '';
|
|
444
|
+
const dir = flags.dir || '';
|
|
438
445
|
|
|
439
446
|
const command = args[0];
|
|
440
447
|
|
|
@@ -449,7 +456,7 @@ async function main() {
|
|
|
449
456
|
console.error('Usage: skillbin install <url-or-id>');
|
|
450
457
|
process.exit(1);
|
|
451
458
|
}
|
|
452
|
-
await install(args[1], { token, scope });
|
|
459
|
+
await install(args[1], { token, scope, dir });
|
|
453
460
|
} else if (command === 'upload') {
|
|
454
461
|
await upload(args[1], { token, all: flags.all });
|
|
455
462
|
} else if (command === 'info') {
|
|
@@ -462,7 +469,7 @@ async function main() {
|
|
|
462
469
|
} else if (command === 'help') {
|
|
463
470
|
printHelp();
|
|
464
471
|
} else {
|
|
465
|
-
await install(command, { token, scope });
|
|
472
|
+
await install(command, { token, scope, dir });
|
|
466
473
|
}
|
|
467
474
|
} catch (err) {
|
|
468
475
|
console.error(`Error: ${err.message}`);
|