itismyskillmarket 1.2.0 → 1.2.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/dist/index.js +9 -4
- package/package.json +1 -1
- package/src/cli.ts +8 -8
- package/src/commands/install.ts +8 -5
package/dist/index.js
CHANGED
|
@@ -334,7 +334,9 @@ async function syncPlatformLinks(targetPlatform) {
|
|
|
334
334
|
var execAsync = promisify(exec);
|
|
335
335
|
async function installSkill(skillId, version, targetPlatform) {
|
|
336
336
|
await ensureMarketDirs();
|
|
337
|
-
const
|
|
337
|
+
const isScoped = skillId.startsWith("@");
|
|
338
|
+
const packageName = isScoped ? skillId : `@skillmarket/${skillId}`;
|
|
339
|
+
const shortName = skillId;
|
|
338
340
|
console.log(`Installing ${packageName}${version ? `@${version}` : ""}...`);
|
|
339
341
|
const pkgInfo = await fetchNpmPackage(packageName);
|
|
340
342
|
if (!pkgInfo) {
|
|
@@ -490,8 +492,9 @@ async function uninstallSkill(skillId) {
|
|
|
490
492
|
|
|
491
493
|
// src/cli.ts
|
|
492
494
|
var program = new Command();
|
|
493
|
-
program.name("skm").description("SkillMarket - Cross-platform skill manager for AI coding tools").version("1.
|
|
494
|
-
program.
|
|
495
|
+
program.name("skm").description("SkillMarket - Cross-platform skill manager for AI coding tools").version("1.2.0");
|
|
496
|
+
var helpCmd = program.command("help").description("Display help information");
|
|
497
|
+
helpCmd.action(() => {
|
|
495
498
|
console.log(`
|
|
496
499
|
SkillMarket CLI
|
|
497
500
|
|
|
@@ -519,9 +522,11 @@ Examples:
|
|
|
519
522
|
skm --install brainstorming Install a skill
|
|
520
523
|
skm --install brainstorming@1.0.0 Install specific version
|
|
521
524
|
skm --update --all Update all installed skills
|
|
525
|
+
skm --sync Sync platform links
|
|
522
526
|
`);
|
|
523
527
|
});
|
|
524
|
-
program.
|
|
528
|
+
var lsCmd = program.command("ls").description("List available skills");
|
|
529
|
+
lsCmd.option("--installed", "Show only installed skills").option("--updates", "Check for updates").action((opts) => {
|
|
525
530
|
listSkills(opts);
|
|
526
531
|
});
|
|
527
532
|
var infoCmd = program.command("info").description("Display skill information");
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -63,7 +63,7 @@ const program = new Command();
|
|
|
63
63
|
program
|
|
64
64
|
.name('skm')
|
|
65
65
|
.description('SkillMarket - Cross-platform skill manager for AI coding tools')
|
|
66
|
-
.version('1.
|
|
66
|
+
.version('1.2.0');
|
|
67
67
|
|
|
68
68
|
// -----------------------------------------------------------------------------
|
|
69
69
|
// 帮助命令 (-h, --help)
|
|
@@ -74,10 +74,9 @@ program
|
|
|
74
74
|
*
|
|
75
75
|
* 显示详细的使用说明和命令示例
|
|
76
76
|
*/
|
|
77
|
-
program
|
|
78
|
-
|
|
79
|
-
.
|
|
80
|
-
console.log(`
|
|
77
|
+
const helpCmd = program.command('help').description('Display help information');
|
|
78
|
+
helpCmd.action(() => {
|
|
79
|
+
console.log(`
|
|
81
80
|
SkillMarket CLI
|
|
82
81
|
|
|
83
82
|
Usage: skm <command> [options]
|
|
@@ -104,8 +103,9 @@ Examples:
|
|
|
104
103
|
skm --install brainstorming Install a skill
|
|
105
104
|
skm --install brainstorming@1.0.0 Install specific version
|
|
106
105
|
skm --update --all Update all installed skills
|
|
106
|
+
skm --sync Sync platform links
|
|
107
107
|
`);
|
|
108
|
-
|
|
108
|
+
});
|
|
109
109
|
|
|
110
110
|
// -----------------------------------------------------------------------------
|
|
111
111
|
// 列表命令 (skm ls)
|
|
@@ -121,8 +121,8 @@ Examples:
|
|
|
121
121
|
* - skm ls --installed 列出已安装的 skills
|
|
122
122
|
* - skm ls --updates 检查更新
|
|
123
123
|
*/
|
|
124
|
-
program
|
|
125
|
-
|
|
124
|
+
const lsCmd = program.command('ls').description('List available skills');
|
|
125
|
+
lsCmd
|
|
126
126
|
.option('--installed', 'Show only installed skills')
|
|
127
127
|
.option('--updates', 'Check for updates')
|
|
128
128
|
.action((opts) => {
|
package/src/commands/install.ts
CHANGED
|
@@ -81,13 +81,16 @@ export async function installSkill(
|
|
|
81
81
|
// 步骤 0: 准备
|
|
82
82
|
// ==========================================================================
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
// 确保所有必要的目录都已创建
|
|
85
85
|
await ensureMarketDirs();
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
// 转换包名格式
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
// 用户可以直接指定 @scope/package 或不带前缀的 short name
|
|
89
|
+
// short name 会被添加 @skillmarket/ 前缀尝试
|
|
90
|
+
// 如果是 scoped 包 (@scope/name),直接使用
|
|
91
|
+
const isScoped = skillId.startsWith('@');
|
|
92
|
+
const packageName = isScoped ? skillId : `@skillmarket/${skillId}`;
|
|
93
|
+
const shortName = skillId; // 用于本地目录名
|
|
91
94
|
|
|
92
95
|
console.log(`Installing ${packageName}${version ? `@${version}` : ''}...`);
|
|
93
96
|
|