@hasnatools/skills 0.1.28 → 0.1.30
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 +18 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21144,12 +21144,13 @@ async function installCommand(slug, options = {}) {
|
|
|
21144
21144
|
const apiKey = getApiKey();
|
|
21145
21145
|
let installDir;
|
|
21146
21146
|
if (isLocal) {
|
|
21147
|
-
|
|
21147
|
+
const projectRoot = findProjectRoot();
|
|
21148
|
+
if (!projectRoot) {
|
|
21148
21149
|
console.log(colors.warning("Not in a skills.md project"));
|
|
21149
21150
|
console.log(colors.dim("Run `skills init` first or install globally (default)"));
|
|
21150
21151
|
return;
|
|
21151
21152
|
}
|
|
21152
|
-
installDir = target === "claude" ? getProjectClaudeSkillsDir() : getProjectCodexSkillsDir();
|
|
21153
|
+
installDir = target === "claude" ? getProjectClaudeSkillsDir(projectRoot) : getProjectCodexSkillsDir(projectRoot);
|
|
21153
21154
|
} else {
|
|
21154
21155
|
installDir = target === "claude" ? getClaudeSkillsDir() : getCodexSkillsDir();
|
|
21155
21156
|
}
|
|
@@ -21200,12 +21201,13 @@ async function installAllSkills(options) {
|
|
|
21200
21201
|
const apiKey = getApiKey();
|
|
21201
21202
|
let installDir;
|
|
21202
21203
|
if (isLocal) {
|
|
21203
|
-
|
|
21204
|
+
const projectRoot = findProjectRoot();
|
|
21205
|
+
if (!projectRoot) {
|
|
21204
21206
|
console.log(colors.warning("Not in a skills.md project"));
|
|
21205
21207
|
console.log(colors.dim("Run `skills init` first or install globally (default)"));
|
|
21206
21208
|
return;
|
|
21207
21209
|
}
|
|
21208
|
-
installDir = target === "claude" ? getProjectClaudeSkillsDir() : getProjectCodexSkillsDir();
|
|
21210
|
+
installDir = target === "claude" ? getProjectClaudeSkillsDir(projectRoot) : getProjectCodexSkillsDir(projectRoot);
|
|
21209
21211
|
} else {
|
|
21210
21212
|
installDir = target === "claude" ? getClaudeSkillsDir() : getCodexSkillsDir();
|
|
21211
21213
|
}
|
|
@@ -21335,12 +21337,13 @@ async function uninstallCommand(slug, options = {}) {
|
|
|
21335
21337
|
const target = options.target ?? getDefaultTarget();
|
|
21336
21338
|
let installDir;
|
|
21337
21339
|
if (isLocal) {
|
|
21338
|
-
|
|
21340
|
+
const projectRoot = findProjectRoot();
|
|
21341
|
+
if (!projectRoot) {
|
|
21339
21342
|
console.log(colors.warning("Not in a skills.md project"));
|
|
21340
21343
|
console.log(colors.dim("Run `skills init` first or uninstall from global (default)"));
|
|
21341
21344
|
return;
|
|
21342
21345
|
}
|
|
21343
|
-
installDir = target === "claude" ? getProjectClaudeSkillsDir() : getProjectCodexSkillsDir();
|
|
21346
|
+
installDir = target === "claude" ? getProjectClaudeSkillsDir(projectRoot) : getProjectCodexSkillsDir(projectRoot);
|
|
21344
21347
|
} else {
|
|
21345
21348
|
installDir = target === "claude" ? getClaudeSkillsDir() : getCodexSkillsDir();
|
|
21346
21349
|
}
|
|
@@ -21814,8 +21817,9 @@ async function listCommand(options = {}) {
|
|
|
21814
21817
|
if (isGlobal) {
|
|
21815
21818
|
dirs.push(target === "claude" ? getClaudeSkillsDir() : getCodexSkillsDir());
|
|
21816
21819
|
} else {
|
|
21817
|
-
|
|
21818
|
-
|
|
21820
|
+
const projectRoot = findProjectRoot();
|
|
21821
|
+
if (projectRoot) {
|
|
21822
|
+
dirs.push(target === "claude" ? getProjectClaudeSkillsDir(projectRoot) : getProjectCodexSkillsDir(projectRoot));
|
|
21819
21823
|
}
|
|
21820
21824
|
dirs.push(target === "claude" ? getClaudeSkillsDir() : getCodexSkillsDir());
|
|
21821
21825
|
}
|
|
@@ -21833,11 +21837,12 @@ async function listCommand(options = {}) {
|
|
|
21833
21837
|
continue;
|
|
21834
21838
|
const content = readFileSync3(skillMdPath, "utf-8");
|
|
21835
21839
|
const frontmatter = parseFrontmatter(content);
|
|
21840
|
+
const globalDir = target === "claude" ? getClaudeSkillsDir() : getCodexSkillsDir();
|
|
21836
21841
|
installedSkills.push({
|
|
21837
21842
|
slug: entry.name,
|
|
21838
21843
|
name: frontmatter.name || entry.name,
|
|
21839
21844
|
version: frontmatter.version || "unknown",
|
|
21840
|
-
location: dir
|
|
21845
|
+
location: dir === globalDir ? "global" : "project"
|
|
21841
21846
|
});
|
|
21842
21847
|
}
|
|
21843
21848
|
}
|
|
@@ -22203,8 +22208,9 @@ function formatDuration(ms) {
|
|
|
22203
22208
|
}
|
|
22204
22209
|
function findSkillDir(slug, target) {
|
|
22205
22210
|
const searchDirs = [];
|
|
22206
|
-
|
|
22207
|
-
|
|
22211
|
+
const projectRoot = findProjectRoot();
|
|
22212
|
+
if (projectRoot) {
|
|
22213
|
+
searchDirs.push(target === "claude" ? getProjectClaudeSkillsDir(projectRoot) : getProjectCodexSkillsDir(projectRoot));
|
|
22208
22214
|
}
|
|
22209
22215
|
searchDirs.push(target === "claude" ? getClaudeSkillsDir() : getCodexSkillsDir());
|
|
22210
22216
|
for (const dir of searchDirs) {
|
|
@@ -23734,7 +23740,7 @@ async function setupCommand(promptArg, options = {}) {
|
|
|
23734
23740
|
// src/index.ts
|
|
23735
23741
|
var indigo12 = colors.primary;
|
|
23736
23742
|
var program2 = new Command;
|
|
23737
|
-
program2.name("skills").description("CLI for skills.md - AI Agent Skills Marketplace").version("0.1.
|
|
23743
|
+
program2.name("skills").description("CLI for skills.md - AI Agent Skills Marketplace").version("0.1.30");
|
|
23738
23744
|
program2.command("init").description("Initialize skills.md in current project").option("-f, --force", "Force re-initialization (removes existing .skills/)").action((options) => {
|
|
23739
23745
|
initCommand({ force: options.force });
|
|
23740
23746
|
});
|