reskill 1.0.4 → 1.1.0

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/README.md CHANGED
@@ -40,10 +40,10 @@ npx reskill@latest <command> # Or use npx directly
40
40
 
41
41
  ## Commands
42
42
 
43
- | Command | Description |
44
- | -------------------- | ----------------------------------------- |
45
- | `init` | Initialize `skills.json` |
46
- | `install [skill]` | Install skills |
43
+ | Command | Description |
44
+ | --------------------- | ----------------------------------------- |
45
+ | `init` | Initialize `skills.json` |
46
+ | `install [skills...]` | Install one or more skills |
47
47
  | `list` | List installed skills |
48
48
  | `info <skill>` | Show skill details |
49
49
  | `update [skill]` | Update skills |
@@ -74,6 +74,9 @@ npx reskill@latest install gitlab.company.com:team/skill@v1.0.0
74
74
 
75
75
  # Default registry (from skills.json)
76
76
  npx reskill@latest install user/skill@v1.0.0
77
+
78
+ # Install multiple skills at once
79
+ npx reskill@latest install github:user/skill1 github:user/skill2@v1.0.0
77
80
  ```
78
81
 
79
82
  ## Version Specification
package/README.zh-CN.md CHANGED
@@ -40,10 +40,10 @@ npx reskill@latest <command> # 或直接使用 npx
40
40
 
41
41
  ## 命令
42
42
 
43
- | 命令 | 说明 |
44
- | -------------------- | -------------------- |
45
- | `init` | 初始化 `skills.json` |
46
- | `install [skill]` | 安装 skills |
43
+ | 命令 | 说明 |
44
+ | --------------------- | ----------------------- |
45
+ | `init` | 初始化 `skills.json` |
46
+ | `install [skills...]` | 安装一个或多个 skills |
47
47
  | `list` | 列出已安装的 skills |
48
48
  | `info <skill>` | 查看 skill 详情 |
49
49
  | `update [skill]` | 更新 skills |
@@ -61,6 +61,9 @@ github:user/skill@v1.0.0 # GitHub 简写
61
61
  gitlab:group/skill@latest # GitLab 简写
62
62
  gitlab.company.com:team/skill@v1.0.0 # 自建实例
63
63
  https://github.com/user/repo/tree/main/path # 网页 URL(支持子路径)
64
+
65
+ # 一次安装多个 skills
66
+ reskill install github:user/skill1 github:user/skill2@v1.0.0
64
67
  ```
65
68
 
66
69
  ## 版本规范
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAijBpC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,SA6DvB,CAAC;AAEL,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwqBpC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,SA+DvB,CAAC;AAEL,eAAe,cAAc,CAAC"}
package/dist/cli/index.js CHANGED
@@ -2495,7 +2495,7 @@ function filterValidAgents(storedAgents, validAgents) {
2495
2495
  const filtered = storedAgents.filter((a)=>validAgents.includes(a));
2496
2496
  return filtered.length > 0 ? filtered : void 0;
2497
2497
  }
2498
- function createInstallContext(skill, options) {
2498
+ function createInstallContext(skills, options) {
2499
2499
  const configLoader = new ConfigLoader();
2500
2500
  const allAgentTypes = Object.keys(agents);
2501
2501
  const hasSkillsJson = configLoader.exists();
@@ -2503,7 +2503,7 @@ function createInstallContext(skill, options) {
2503
2503
  const storedAgents = filterValidAgents(storedDefaults?.targetAgents, allAgentTypes);
2504
2504
  const storedMode = storedDefaults?.installMode;
2505
2505
  return {
2506
- skill,
2506
+ skills,
2507
2507
  options,
2508
2508
  configLoader,
2509
2509
  allAgentTypes,
@@ -2511,7 +2511,8 @@ function createInstallContext(skill, options) {
2511
2511
  storedAgents,
2512
2512
  hasStoredAgents: !!storedAgents && storedAgents.length > 0,
2513
2513
  storedMode,
2514
- isReinstallAll: !skill,
2514
+ isReinstallAll: 0 === skills.length,
2515
+ isBatchInstall: skills.length > 1,
2515
2516
  skipConfirm: options.yes ?? false
2516
2517
  };
2517
2518
  }
@@ -2684,7 +2685,8 @@ async function installAllSkills(ctx, targetAgents, installMode, spinner) {
2684
2685
  });
2685
2686
  }
2686
2687
  async function installSingleSkill(ctx, targetAgents, installGlobally, installMode, spinner) {
2687
- const { skill, options, configLoader, skipConfirm } = ctx;
2688
+ const { skills, options, configLoader, skipConfirm } = ctx;
2689
+ const skill = skills[0];
2688
2690
  const cwd = process.cwd();
2689
2691
  const summaryLines = [
2690
2692
  __WEBPACK_EXTERNAL_MODULE_chalk__["default"].cyan(skill),
@@ -2722,6 +2724,81 @@ async function installSingleSkill(ctx, targetAgents, installGlobally, installMod
2722
2724
  });
2723
2725
  }
2724
2726
  }
2727
+ async function installMultipleSkills(ctx, targetAgents, installGlobally, installMode, spinner) {
2728
+ const { skills, options, configLoader, skipConfirm } = ctx;
2729
+ const summaryLines = [
2730
+ `${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].cyan(skills.length)} skills:`,
2731
+ ...skills.map((s)=>` ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].dim('•')} ${s}`),
2732
+ '',
2733
+ ` ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].dim('→')} ${formatAgentNames(targetAgents)}`,
2734
+ ` ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].dim('Scope:')} ${installGlobally ? 'Global' : 'Project'}${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].dim(', Mode:')} ${installMode}`
2735
+ ];
2736
+ __WEBPACK_EXTERNAL_MODULE__clack_prompts__.note(summaryLines.join('\n'), 'Installation Summary');
2737
+ if (!skipConfirm) {
2738
+ const confirmed = await __WEBPACK_EXTERNAL_MODULE__clack_prompts__.confirm({
2739
+ message: 'Proceed with installation?'
2740
+ });
2741
+ if (__WEBPACK_EXTERNAL_MODULE__clack_prompts__.isCancel(confirmed) || !confirmed) {
2742
+ __WEBPACK_EXTERNAL_MODULE__clack_prompts__.cancel('Installation cancelled');
2743
+ process.exit(0);
2744
+ }
2745
+ }
2746
+ const skillManager = new SkillManager(void 0, {
2747
+ global: installGlobally
2748
+ });
2749
+ const successfulSkills = [];
2750
+ const failedSkills = [];
2751
+ spinner.start(`Installing ${skills.length} skills in parallel...`);
2752
+ const installPromises = skills.map(async (skillRef)=>{
2753
+ try {
2754
+ const { skill: installed, results } = await skillManager.installToAgents(skillRef, targetAgents, {
2755
+ force: options.force,
2756
+ save: false !== options.save && !installGlobally,
2757
+ mode: installMode
2758
+ });
2759
+ const successful = Array.from(results.values()).filter((r)=>r.success);
2760
+ if (successful.length > 0) return {
2761
+ success: true,
2762
+ skillRef,
2763
+ skill: installed
2764
+ };
2765
+ const firstError = Array.from(results.values()).find((r)=>!r.success)?.error;
2766
+ return {
2767
+ success: false,
2768
+ skillRef,
2769
+ error: firstError || 'Unknown error'
2770
+ };
2771
+ } catch (error) {
2772
+ return {
2773
+ success: false,
2774
+ skillRef,
2775
+ error: error.message
2776
+ };
2777
+ }
2778
+ });
2779
+ const results = await Promise.all(installPromises);
2780
+ spinner.stop(`Processed ${skills.length} skills`);
2781
+ for (const result of results)if (result.success) {
2782
+ successfulSkills.push(result.skill);
2783
+ __WEBPACK_EXTERNAL_MODULE__clack_prompts__.log.success(`${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green('✓')} ${result.skill.name}@${result.skill.version}`);
2784
+ } else {
2785
+ failedSkills.push({
2786
+ ref: result.skillRef,
2787
+ error: result.error
2788
+ });
2789
+ __WEBPACK_EXTERNAL_MODULE__clack_prompts__.log.error(`${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].red('✗')} ${result.skillRef}`);
2790
+ }
2791
+ console.log();
2792
+ displayBatchInstallResults(successfulSkills, failedSkills, targetAgents.length);
2793
+ if (!installGlobally && successfulSkills.length > 0 && configLoader.exists()) {
2794
+ configLoader.reload();
2795
+ configLoader.updateDefaults({
2796
+ targetAgents,
2797
+ installMode
2798
+ });
2799
+ }
2800
+ if (failedSkills.length > 0) process.exit(1);
2801
+ }
2725
2802
  function displayInstallSummary(info) {
2726
2803
  const summaryLines = [
2727
2804
  `${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].cyan(info.skillCount)} skill(s) → ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].cyan(info.agentCount)} agent(s)`,
@@ -2733,6 +2810,16 @@ function displayInstallResults(skillCount, agentCount, totalInstalled, totalFail
2733
2810
  if (0 === totalFailed) __WEBPACK_EXTERNAL_MODULE__clack_prompts__.log.success(`Installed ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green(skillCount)} skill(s) to ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green(agentCount)} agent(s)`);
2734
2811
  else __WEBPACK_EXTERNAL_MODULE__clack_prompts__.log.warn(`Installed ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green(totalInstalled)} successfully, ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].red(totalFailed)} failed`);
2735
2812
  }
2813
+ function displayBatchInstallResults(successfulSkills, failedSkills, agentCount) {
2814
+ if (successfulSkills.length > 0) {
2815
+ const resultLines = successfulSkills.map((s)=>` ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green('✓')} ${s.name}@${s.version}`);
2816
+ __WEBPACK_EXTERNAL_MODULE__clack_prompts__.note(resultLines.join('\n'), __WEBPACK_EXTERNAL_MODULE_chalk__["default"].green(`Installed ${successfulSkills.length} skill(s) to ${agentCount} agent(s)`));
2817
+ }
2818
+ if (failedSkills.length > 0) {
2819
+ __WEBPACK_EXTERNAL_MODULE__clack_prompts__.log.error(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].red(`Failed to install ${failedSkills.length} skill(s):`));
2820
+ for (const { ref, error } of failedSkills)__WEBPACK_EXTERNAL_MODULE__clack_prompts__.log.message(` ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].red('✗')} ${ref}: ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].dim(error)}`);
2821
+ }
2822
+ }
2736
2823
  function displaySingleSkillResults(installed, successful, failed, cwd) {
2737
2824
  if (successful.length > 0) {
2738
2825
  const resultLines = [];
@@ -2761,12 +2848,12 @@ function displaySingleSkillResults(installed, successful, failed, cwd) {
2761
2848
  for (const [agent, result] of failed)__WEBPACK_EXTERNAL_MODULE__clack_prompts__.log.message(` ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].red('✗')} ${agents[agent].displayName}: ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].dim(result.error)}`);
2762
2849
  }
2763
2850
  }
2764
- const installCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('install').alias('i').description('Install a skill or all skills from skills.json').argument('[skill]', 'Skill reference (e.g., github:user/skill@v1.0.0 or git@github.com:user/repo.git)').option('-f, --force', 'Force reinstall even if already installed').option('-g, --global', 'Install globally to user home directory').option('--no-save', 'Do not save to skills.json').option('-a, --agent <agents...>', 'Specify target agents (e.g., cursor, claude-code)').option('--mode <mode>', 'Installation mode: symlink or copy').option('-y, --yes', 'Skip confirmation prompts').option('--all', 'Install to all agents (implies -y -g)').action(async (skill, options)=>{
2851
+ const installCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('install').alias('i').description('Install one or more skills, or all skills from skills.json').argument('[skills...]', 'Skill references (e.g., github:user/skill@v1.0.0 or git@github.com:user/repo.git)').option('-f, --force', 'Force reinstall even if already installed').option('-g, --global', 'Install globally to user home directory').option('--no-save', 'Do not save to skills.json').option('-a, --agent <agents...>', 'Specify target agents (e.g., cursor, claude-code)').option('--mode <mode>', 'Installation mode: symlink or copy').option('-y, --yes', 'Skip confirmation prompts').option('--all', 'Install to all agents (implies -y -g)').action(async (skills, options)=>{
2765
2852
  if (options.all) {
2766
2853
  options.yes = true;
2767
2854
  options.global = true;
2768
2855
  }
2769
- const ctx = createInstallContext(skill, options);
2856
+ const ctx = createInstallContext(skills, options);
2770
2857
  console.log();
2771
2858
  __WEBPACK_EXTERNAL_MODULE__clack_prompts__.intro(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].bgCyan.black(' reskill '));
2772
2859
  try {
@@ -2779,6 +2866,7 @@ const installCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('instal
2779
2866
  }
2780
2867
  const installMode = await resolveInstallMode(ctx);
2781
2868
  if (ctx.isReinstallAll) await installAllSkills(ctx, targetAgents, installMode, spinner);
2869
+ else if (ctx.isBatchInstall) await installMultipleSkills(ctx, targetAgents, installGlobally, installMode, spinner);
2782
2870
  else await installSingleSkill(ctx, targetAgents, installGlobally, installMode, spinner);
2783
2871
  console.log();
2784
2872
  __WEBPACK_EXTERNAL_MODULE__clack_prompts__.outro(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green('Done!'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reskill",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "AI Skills Package Manager - Git-based skills management for AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",