joyskills-cli 0.2.8 → 0.2.10
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/package.json +1 -1
- package/src/commands/install.js +34 -21
- package/src/commands/remove.js +2 -1
- package/src/commands/upgrade.js +7 -4
package/package.json
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -206,29 +206,26 @@ async function tryInstallFromRegistryDir(skillName, registryDirPath, targetDir,
|
|
|
206
206
|
return false;
|
|
207
207
|
}
|
|
208
208
|
} else {
|
|
209
|
-
// No registry.yaml: scan skill directories
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const version = versionMatch?.[1]?.trim() || '1.0.0';
|
|
209
|
+
// No registry.yaml: scan skill directories recursively
|
|
210
|
+
const skills = await findSkills(registryDirPath);
|
|
211
|
+
const skill = skills.find(s => s.name === skillName);
|
|
212
|
+
|
|
213
|
+
if (!skill) return false;
|
|
214
|
+
|
|
215
|
+
const targetPath = path.join(targetDir, skillName);
|
|
216
|
+
copyRecursive(skill.path, targetPath);
|
|
218
217
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
218
|
+
const lockfileManager = new LockfileManager(projectRoot);
|
|
219
|
+
await lockfileManager.load();
|
|
220
|
+
lockfileManager.updateSkill(skillName, {
|
|
221
|
+
version: skill.version || '1.0.0',
|
|
222
|
+
source: sourceLabel,
|
|
223
|
+
installedAt: new Date().toISOString()
|
|
224
|
+
});
|
|
225
|
+
await lockfileManager.save();
|
|
227
226
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
return false;
|
|
227
|
+
console.log(chalk.green(`✅ Installed ${skillName} v${skill.version || '1.0.0'} from ${sourceLabel}`));
|
|
228
|
+
return true;
|
|
232
229
|
}
|
|
233
230
|
}
|
|
234
231
|
|
|
@@ -380,6 +377,14 @@ async function installFromGitUrl(gitUrl, targetDir, options) {
|
|
|
380
377
|
console.log(chalk.green(' ✓ Repository cloned'));
|
|
381
378
|
} else {
|
|
382
379
|
console.log(chalk.gray(' Using cached repository'));
|
|
380
|
+
// Try to update cache
|
|
381
|
+
try {
|
|
382
|
+
const git = simpleGit(cachePath);
|
|
383
|
+
await git.pull('origin', 'main', ['--depth', '1']);
|
|
384
|
+
console.log(chalk.gray(' ✓ Cache updated'));
|
|
385
|
+
} catch (e) {
|
|
386
|
+
// Ignore update errors, use cached version
|
|
387
|
+
}
|
|
383
388
|
}
|
|
384
389
|
|
|
385
390
|
const skills = await findSkills(cachePath);
|
|
@@ -442,6 +447,14 @@ async function installFromGitHub(owner, repo, skillPath, targetDir, options) {
|
|
|
442
447
|
console.log(chalk.green(' ✓ Repository cloned'));
|
|
443
448
|
} else {
|
|
444
449
|
console.log(chalk.gray(' Using cached repository'));
|
|
450
|
+
// Try to update cache
|
|
451
|
+
try {
|
|
452
|
+
const git = simpleGit(cachePath);
|
|
453
|
+
await git.pull('origin', 'main', ['--depth', '1']);
|
|
454
|
+
console.log(chalk.gray(' ✓ Cache updated'));
|
|
455
|
+
} catch (e) {
|
|
456
|
+
// Ignore update errors, use cached version
|
|
457
|
+
}
|
|
445
458
|
}
|
|
446
459
|
|
|
447
460
|
// Find skills in the repo
|
package/src/commands/remove.js
CHANGED
|
@@ -23,7 +23,8 @@ export function removeCommand(program) {
|
|
|
23
23
|
program
|
|
24
24
|
.command('remove <skill>')
|
|
25
25
|
.description('Remove a skill')
|
|
26
|
-
.
|
|
26
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
27
|
+
.action(async (skillName, options) => {
|
|
27
28
|
const projectRoot = process.cwd();
|
|
28
29
|
const lockfileManager = new LockfileManager(projectRoot);
|
|
29
30
|
|
package/src/commands/upgrade.js
CHANGED
|
@@ -269,9 +269,12 @@ async function upgradeFromGitHub(skill, skillsDir) {
|
|
|
269
269
|
const git = simpleGit(cachePath);
|
|
270
270
|
await git.pull();
|
|
271
271
|
|
|
272
|
-
// Find skill in cache
|
|
273
|
-
const
|
|
274
|
-
|
|
272
|
+
// Find skill in cache (support nested directories)
|
|
273
|
+
const { findSkills } = await import('../commands/install.js');
|
|
274
|
+
const skills = await findSkills(cachePath);
|
|
275
|
+
const skillInfo = skills.find(s => s.name === skill.name);
|
|
276
|
+
|
|
277
|
+
if (!skillInfo) {
|
|
275
278
|
throw new Error(`Skill not found in repository: ${skill.name}`);
|
|
276
279
|
}
|
|
277
280
|
|
|
@@ -282,7 +285,7 @@ async function upgradeFromGitHub(skill, skillsDir) {
|
|
|
282
285
|
}
|
|
283
286
|
|
|
284
287
|
// Copy new version
|
|
285
|
-
copyRecursive(
|
|
288
|
+
copyRecursive(skillInfo.path, targetPath);
|
|
286
289
|
}
|
|
287
290
|
|
|
288
291
|
async function upgradeFromRegistry(skill, skillsDir) {
|