myskill 1.2.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myskill",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "CLI tool for creating and managing AI agent skills",
5
5
  "author": "Sarfraz Ahmed <sarfraznawaz2005@gmail.com>",
6
6
  "license": "MIT",
@@ -41,6 +41,7 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "chalk": "^5.4.1",
44
+ "cli-table3": "^0.6.5",
44
45
  "commander": "^13.1.0",
45
46
  "env-paths": "^3.0.0",
46
47
  "fs-extra": "^11.3.0",
@@ -2,6 +2,7 @@ import fs from "fs-extra";
2
2
  import path from "path";
3
3
  import chalk from "chalk";
4
4
  import yaml from "js-yaml";
5
+ import Table from "cli-table3";
5
6
  import { platforms, getPlatformPath } from "../platforms/index.js";
6
7
 
7
8
  export async function list(options = {}) {
@@ -17,9 +18,9 @@ export async function list(options = {}) {
17
18
  targetPlatforms = Object.values(platforms);
18
19
  }
19
20
 
20
- for (const platform of targetPlatforms) {
21
- console.log(chalk.blue(`\n=== ${platform.name} Skills ===`));
21
+ const skillMap = {};
22
22
 
23
+ for (const platform of targetPlatforms) {
23
24
  const globalPath = await getPlatformPath(platform.id);
24
25
  const locations = [{ name: "Global", path: globalPath }];
25
26
 
@@ -42,14 +43,20 @@ export async function list(options = {}) {
42
43
  const match = content.match(/^---\n([\s\S]*?)\n---/);
43
44
  if (match) {
44
45
  const fm = yaml.load(match[1]);
45
- console.log(
46
- `- ${chalk.bold(fm.name)} (${loc.name}): ${fm.description || "No description"}`,
47
- );
48
- } else {
49
- console.log(`- ${item.name} (${loc.name}): [Invalid Format]`);
46
+ const skillName = fm.name;
47
+ if (!skillMap[skillName]) {
48
+ skillMap[skillName] = {
49
+ description: fm.description || "No description",
50
+ platforms: [],
51
+ location: loc.name,
52
+ };
53
+ }
54
+ if (!skillMap[skillName].platforms.includes(platform.name)) {
55
+ skillMap[skillName].platforms.push(platform.name);
56
+ }
50
57
  }
51
58
  } catch (e) {
52
- console.log(`- ${item.name} (${loc.name}): [Read Error]`);
59
+ // Intentionally skip errors to avoid cluttering output
53
60
  }
54
61
  }
55
62
  }
@@ -57,4 +64,28 @@ export async function list(options = {}) {
57
64
  }
58
65
  }
59
66
  }
67
+
68
+ const table = new Table({
69
+ head: [
70
+ chalk.bold("Skill Name"),
71
+ chalk.bold("Platforms"),
72
+ chalk.bold("Location"),
73
+ chalk.bold("Description"),
74
+ ],
75
+ colWidths: [20, 40, 10, 50],
76
+ wordWrap: true,
77
+ });
78
+
79
+ for (const [skillName, data] of Object.entries(skillMap)) {
80
+ const platformsStr = chalk.cyan(data.platforms.join(", "));
81
+ table.push([
82
+ chalk.bold(skillName),
83
+ platformsStr,
84
+ data.location,
85
+ data.description,
86
+ ]);
87
+ }
88
+
89
+ console.log(chalk.bold("Skill Listing:"));
90
+ console.log(table.toString());
60
91
  }