@crafter/skillkit 0.0.1 → 0.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/package.json +1 -1
- package/src/bin.ts +45 -11
- package/src/commands/find.ts +13 -0
- package/src/commands/install.ts +21 -0
- package/src/commands/uninstall.ts +16 -0
- package/src/commands/update.ts +11 -0
package/package.json
CHANGED
package/src/bin.ts
CHANGED
|
@@ -1,30 +1,64 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { bold, cyan, dim, yellow } from "./tui/colors";
|
|
3
3
|
|
|
4
|
-
const VERSION = "0.0
|
|
4
|
+
const VERSION = "0.1.0";
|
|
5
5
|
|
|
6
6
|
function printHelp(): void {
|
|
7
7
|
console.log(`
|
|
8
|
-
${bold("skill-kit")} ${dim(`v${VERSION}`)} -
|
|
8
|
+
${bold("skill-kit")} ${dim(`v${VERSION}`)} - Analytics & management for AI agent skills
|
|
9
9
|
|
|
10
10
|
${bold("USAGE")}
|
|
11
|
-
skill-kit <command>
|
|
11
|
+
skill-kit <command> [args]
|
|
12
12
|
|
|
13
|
-
${bold("
|
|
14
|
-
${cyan("
|
|
15
|
-
${cyan("
|
|
16
|
-
${cyan("
|
|
17
|
-
${cyan("
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
${bold("MANAGEMENT")} ${dim("(powered by skills.sh)")}
|
|
14
|
+
${cyan("install")} Install a skill ${dim("(skill-kit install owner/repo)")}
|
|
15
|
+
${cyan("uninstall")} Remove a skill ${dim("(skill-kit uninstall name)")}
|
|
16
|
+
${cyan("update")} Update all skills to latest
|
|
17
|
+
${cyan("find")} Search the skills.sh registry
|
|
18
|
+
|
|
19
|
+
${bold("ANALYTICS")} ${dim("(local-first)")}
|
|
20
|
+
${cyan("list")} List installed skills with size & context budget
|
|
21
|
+
${cyan("stats")} Usage analytics with sparklines (last 30 days)
|
|
22
|
+
${cyan("health")} Health check: unused skills, context budget, DB
|
|
23
|
+
${cyan("analyze")} Scan session files to populate analytics DB
|
|
24
|
+
|
|
25
|
+
${bold("OTHER")}
|
|
26
|
+
${cyan("version")} Print version
|
|
27
|
+
${cyan("help")} Show this help message
|
|
20
28
|
`);
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
async function main(): Promise<void> {
|
|
24
32
|
const cmd = process.argv[2];
|
|
33
|
+
const args = process.argv.slice(3);
|
|
25
34
|
|
|
26
35
|
switch (cmd) {
|
|
27
|
-
case "
|
|
36
|
+
case "install":
|
|
37
|
+
case "add": {
|
|
38
|
+
const { runInstall } = await import("./commands/install");
|
|
39
|
+
runInstall(args);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case "uninstall":
|
|
43
|
+
case "remove": {
|
|
44
|
+
const { runUninstall } = await import("./commands/uninstall");
|
|
45
|
+
runUninstall(args);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case "update":
|
|
49
|
+
case "upgrade": {
|
|
50
|
+
const { runUpdate } = await import("./commands/update");
|
|
51
|
+
runUpdate();
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case "find":
|
|
55
|
+
case "search": {
|
|
56
|
+
const { runFind } = await import("./commands/find");
|
|
57
|
+
runFind(args);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
case "list":
|
|
61
|
+
case "ls": {
|
|
28
62
|
const { runList } = await import("./commands/list");
|
|
29
63
|
runList();
|
|
30
64
|
break;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { dim } from "../tui/colors";
|
|
3
|
+
|
|
4
|
+
export function runFind(args: string[]): void {
|
|
5
|
+
const query = args.join(" ");
|
|
6
|
+
console.log(`\n ${dim("Searching skills.sh registry...")}\n`);
|
|
7
|
+
try {
|
|
8
|
+
const cmd = query ? `npx -y skills find ${query}` : "npx -y skills find";
|
|
9
|
+
execSync(cmd, { stdio: "inherit" });
|
|
10
|
+
} catch {
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { bold, dim, yellow } from "../tui/colors";
|
|
3
|
+
|
|
4
|
+
export function runInstall(args: string[]): void {
|
|
5
|
+
const source = args.join(" ");
|
|
6
|
+
if (!source) {
|
|
7
|
+
console.error(`\n ${yellow("Usage:")} skill-kit install <owner/repo>\n`);
|
|
8
|
+
console.log(` ${dim("Examples:")}`);
|
|
9
|
+
console.log(` skill-kit install vercel-labs/agent-skills`);
|
|
10
|
+
console.log(` skill-kit install crafter-station/skill-kit\n`);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
console.log(
|
|
14
|
+
`\n ${dim("Installing via")} ${bold("skills.sh")}${dim("...")}\n`,
|
|
15
|
+
);
|
|
16
|
+
try {
|
|
17
|
+
execSync(`npx -y skills add ${source}`, { stdio: "inherit" });
|
|
18
|
+
} catch {
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { dim, yellow } from "../tui/colors";
|
|
3
|
+
|
|
4
|
+
export function runUninstall(args: string[]): void {
|
|
5
|
+
const name = args.join(" ");
|
|
6
|
+
if (!name) {
|
|
7
|
+
console.error(`\n ${yellow("Usage:")} skill-kit uninstall <skill-name>\n`);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
console.log(`\n ${dim("Removing via skills.sh...")}\n`);
|
|
11
|
+
try {
|
|
12
|
+
execSync(`npx -y skills remove ${name}`, { stdio: "inherit" });
|
|
13
|
+
} catch {
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { dim } from "../tui/colors";
|
|
3
|
+
|
|
4
|
+
export function runUpdate(): void {
|
|
5
|
+
console.log(`\n ${dim("Checking for updates via skills.sh...")}\n`);
|
|
6
|
+
try {
|
|
7
|
+
execSync("npx -y skills update", { stdio: "inherit" });
|
|
8
|
+
} catch {
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
}
|