eskill 1.0.29 → 1.0.31
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/cli.js +1 -1
- package/lib/installer.js +21 -16
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ const program = new Command();
|
|
|
13
13
|
program
|
|
14
14
|
.name('eskill')
|
|
15
15
|
.description('Unified AI Agent Skills Management - Install skills from Git URLs')
|
|
16
|
-
.version('1.0.
|
|
16
|
+
.version('1.0.31')
|
|
17
17
|
.option('-g, --global', '使用全局技能目录(~/.eskill/skills/),否则使用当前目录(./.claude/skills/)', false);
|
|
18
18
|
|
|
19
19
|
// 安装命令
|
package/lib/installer.js
CHANGED
|
@@ -322,17 +322,29 @@ export async function installFromGitUrl(gitUrl, options = {}) {
|
|
|
322
322
|
// 检测并处理 name@author 格式
|
|
323
323
|
let actualUrl = await handleSkillAtAuthorFormat(gitUrl);
|
|
324
324
|
|
|
325
|
-
// 如果 URL 被转换了(即原来是 name@author 格式),需要确认
|
|
326
|
-
if (actualUrl !== gitUrl) {
|
|
327
|
-
const confirmed = await confirmAction('是否安装此技能?');
|
|
328
|
-
if (!confirmed) {
|
|
329
|
-
console.log('\n已取消安装');
|
|
330
|
-
return { success: false, cancelled: true };
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
325
|
// 解析 Git URL
|
|
335
326
|
const parsed = parseGitUrl(actualUrl);
|
|
327
|
+
const skillsDir = getSkillsDir(global);
|
|
328
|
+
|
|
329
|
+
// 确定技能名称
|
|
330
|
+
const skillName = parsed.path ? basename(parsed.path) : parsed.repo;
|
|
331
|
+
const targetPath = join(skillsDir, skillName);
|
|
332
|
+
|
|
333
|
+
// 确认安装(带路径信息)
|
|
334
|
+
let confirmMessage = '';
|
|
335
|
+
if (!global) {
|
|
336
|
+
// 本地模式:显示当前目录
|
|
337
|
+
confirmMessage = `是否在【${process.cwd()}】下安装此技能?`;
|
|
338
|
+
} else {
|
|
339
|
+
// 全局模式:显示 skill 仓库
|
|
340
|
+
confirmMessage = `是否在【skill 仓库】中安装此技能?`;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const confirmed = await confirmAction(confirmMessage);
|
|
344
|
+
if (!confirmed) {
|
|
345
|
+
console.log('\n已取消安装\n');
|
|
346
|
+
return { success: false, cancelled: true };
|
|
347
|
+
}
|
|
336
348
|
console.log(`平台: ${parsed.platform}`);
|
|
337
349
|
console.log(`仓库: ${parsed.owner}/${parsed.repo}`);
|
|
338
350
|
console.log(`分支: ${parsed.branch}`);
|
|
@@ -340,18 +352,11 @@ export async function installFromGitUrl(gitUrl, options = {}) {
|
|
|
340
352
|
console.log(`路径: ${parsed.path}`);
|
|
341
353
|
}
|
|
342
354
|
|
|
343
|
-
// 获取技能目录(技能文件存放位置)
|
|
344
|
-
const skillsDir = getSkillsDir(global);
|
|
345
|
-
|
|
346
355
|
// 确保技能目录存在
|
|
347
356
|
if (!existsSync(skillsDir)) {
|
|
348
357
|
mkdirSync(skillsDir, { recursive: true });
|
|
349
358
|
}
|
|
350
359
|
|
|
351
|
-
// 确定技能名称
|
|
352
|
-
const skillName = parsed.path ? basename(parsed.path) : parsed.repo;
|
|
353
|
-
const targetPath = join(skillsDir, skillName);
|
|
354
|
-
|
|
355
360
|
// 检查是否已存在
|
|
356
361
|
if (existsSync(targetPath)) {
|
|
357
362
|
if (!force) {
|