add-skill 1.0.18 → 1.0.20
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/dist/index.js +31 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,6 +7,16 @@ import chalk from "chalk";
|
|
|
7
7
|
|
|
8
8
|
// src/source-parser.ts
|
|
9
9
|
import { isAbsolute, resolve } from "path";
|
|
10
|
+
function getOwnerRepo(parsed) {
|
|
11
|
+
if (parsed.type === "local") {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const match = parsed.url.match(/(?:github|gitlab)\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
15
|
+
if (match) {
|
|
16
|
+
return `${match[1]}/${match[2]}`;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
10
20
|
function isLocalPath(input) {
|
|
11
21
|
return isAbsolute(input) || input.startsWith("./") || input.startsWith("../") || input === "." || input === ".." || // Windows absolute paths like C:\ or D:\
|
|
12
22
|
/^[a-zA-Z]:[/\\]/.test(input);
|
|
@@ -509,7 +519,7 @@ function track(data) {
|
|
|
509
519
|
// package.json
|
|
510
520
|
var package_default = {
|
|
511
521
|
name: "add-skill",
|
|
512
|
-
version: "1.0.
|
|
522
|
+
version: "1.0.20",
|
|
513
523
|
description: "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
|
|
514
524
|
type: "module",
|
|
515
525
|
bin: {
|
|
@@ -575,7 +585,7 @@ var package_default = {
|
|
|
575
585
|
// src/index.ts
|
|
576
586
|
var version = package_default.version;
|
|
577
587
|
setVersion(version);
|
|
578
|
-
program.name("add-skill").description("Install skills onto coding agents (OpenCode, Claude Code, Codex, Cursor, Antigravity, Github Copilot, Roo Code)").version(version).argument("<source>", "Git repo URL, GitHub shorthand (owner/repo), local path (./path), or direct path to skill").option("-g, --global", "Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>", "Specify agents to install to (opencode, claude-code, codex, cursor, antigravity, gitub-copilot, roo)").option("-s, --skill <skills...>", "Specify skill names to install (skip selection prompt)").option("-l, --list", "List available skills in the repository without installing").option("-y, --yes", "Skip confirmation prompts").configureOutput({
|
|
588
|
+
program.name("add-skill").description("Install skills onto coding agents (OpenCode, Claude Code, Codex, Cursor, Antigravity, Github Copilot, Roo Code)").version(version).argument("<source>", "Git repo URL, GitHub shorthand (owner/repo), local path (./path), or direct path to skill").option("-g, --global", "Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>", "Specify agents to install to (opencode, claude-code, codex, cursor, antigravity, gitub-copilot, roo)").option("-s, --skill <skills...>", "Specify skill names to install (skip selection prompt)").option("-l, --list", "List available skills in the repository without installing").option("-y, --yes", "Skip confirmation prompts").option("--all", "Install all skills to all agents without any prompts (implies -y -g)").configureOutput({
|
|
579
589
|
outputError: (str, write) => {
|
|
580
590
|
if (str.includes("missing required argument")) {
|
|
581
591
|
console.log();
|
|
@@ -598,6 +608,10 @@ program.name("add-skill").description("Install skills onto coding agents (OpenCo
|
|
|
598
608
|
});
|
|
599
609
|
program.parse();
|
|
600
610
|
async function main(source, options) {
|
|
611
|
+
if (options.all) {
|
|
612
|
+
options.yes = true;
|
|
613
|
+
options.global = true;
|
|
614
|
+
}
|
|
601
615
|
console.log();
|
|
602
616
|
p.intro(chalk.bgCyan.black(" skills "));
|
|
603
617
|
let tempDir = null;
|
|
@@ -698,6 +712,9 @@ async function main(source, options) {
|
|
|
698
712
|
process.exit(1);
|
|
699
713
|
}
|
|
700
714
|
targetAgents = options.agent;
|
|
715
|
+
} else if (options.all) {
|
|
716
|
+
targetAgents = validAgents;
|
|
717
|
+
p.log.info(`Installing to all ${targetAgents.length} agents`);
|
|
701
718
|
} else {
|
|
702
719
|
spinner2.start("Detecting installed agents...");
|
|
703
720
|
const installedAgents = await detectInstalledAgents();
|
|
@@ -827,18 +844,21 @@ async function main(source, options) {
|
|
|
827
844
|
} else if (tempDir && skill.path.startsWith(tempDir + "/")) {
|
|
828
845
|
relativePath = skill.path.slice(tempDir.length + 1) + "/SKILL.md";
|
|
829
846
|
} else {
|
|
830
|
-
|
|
847
|
+
continue;
|
|
831
848
|
}
|
|
832
849
|
skillFiles[skill.name] = relativePath;
|
|
833
850
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
851
|
+
const normalizedSource = getOwnerRepo(parsed);
|
|
852
|
+
if (normalizedSource) {
|
|
853
|
+
track({
|
|
854
|
+
event: "install",
|
|
855
|
+
source: normalizedSource,
|
|
856
|
+
skills: selectedSkills.map((s) => s.name).join(","),
|
|
857
|
+
agents: targetAgents.join(","),
|
|
858
|
+
...installGlobally && { global: "1" },
|
|
859
|
+
skillFiles: JSON.stringify(skillFiles)
|
|
860
|
+
});
|
|
861
|
+
}
|
|
842
862
|
if (successful.length > 0) {
|
|
843
863
|
const bySkill = /* @__PURE__ */ new Map();
|
|
844
864
|
for (const r of successful) {
|