@hasnatools/skills 0.1.1 → 0.1.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/dist/index.js +54 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20698,6 +20698,17 @@ async function apiRequest(path6, options = {}) {
|
|
|
20698
20698
|
async function searchSkills(query) {
|
|
20699
20699
|
return apiRequest(`/skills?q=${encodeURIComponent(query)}`);
|
|
20700
20700
|
}
|
|
20701
|
+
async function getMarketplaceSkills(options) {
|
|
20702
|
+
const params = new URLSearchParams;
|
|
20703
|
+
if (options?.limit)
|
|
20704
|
+
params.set("limit", options.limit.toString());
|
|
20705
|
+
if (options?.offset)
|
|
20706
|
+
params.set("offset", options.offset.toString());
|
|
20707
|
+
if (options?.category)
|
|
20708
|
+
params.set("category", options.category);
|
|
20709
|
+
const query = params.toString();
|
|
20710
|
+
return apiRequest(`/skills${query ? `?${query}` : ""}`);
|
|
20711
|
+
}
|
|
20701
20712
|
async function installSkill(slug) {
|
|
20702
20713
|
return apiRequest(`/skills/${slug}/install`);
|
|
20703
20714
|
}
|
|
@@ -21887,6 +21898,40 @@ function formatBytes(bytes) {
|
|
|
21887
21898
|
}
|
|
21888
21899
|
}
|
|
21889
21900
|
|
|
21901
|
+
// src/commands/marketplace.ts
|
|
21902
|
+
async function marketplaceCommand(options = {}) {
|
|
21903
|
+
const spinner = ora("Fetching skills from marketplace...").start();
|
|
21904
|
+
const result = await getMarketplaceSkills({
|
|
21905
|
+
limit: options.limit || 200,
|
|
21906
|
+
category: options.category
|
|
21907
|
+
});
|
|
21908
|
+
if (result.error || !result.data) {
|
|
21909
|
+
spinner.fail("Failed to fetch marketplace");
|
|
21910
|
+
console.error(source_default.red(result.error || "Unknown error"));
|
|
21911
|
+
return;
|
|
21912
|
+
}
|
|
21913
|
+
const skills = result.data.skills;
|
|
21914
|
+
spinner.stop();
|
|
21915
|
+
if (skills.length === 0) {
|
|
21916
|
+
console.log(source_default.dim("No skills found in marketplace"));
|
|
21917
|
+
return;
|
|
21918
|
+
}
|
|
21919
|
+
console.log();
|
|
21920
|
+
console.log(source_default.bold(`Skills Marketplace`) + source_default.dim(` (${skills.length} skills)`));
|
|
21921
|
+
console.log();
|
|
21922
|
+
for (const skill of skills) {
|
|
21923
|
+
const verified = skill.isVerified ? source_default.blue(" ✓") : "";
|
|
21924
|
+
const downloads = skill.downloadCount > 0 ? source_default.dim(` (${skill.downloadCount} installs)`) : "";
|
|
21925
|
+
console.log(" " + source_default.bold(skill.name) + verified + source_default.dim(` v${skill.version}`) + downloads);
|
|
21926
|
+
console.log(" " + source_default.dim(skill.description || "No description"));
|
|
21927
|
+
console.log(" " + source_default.cyan(`skills install ${skill.slug}`));
|
|
21928
|
+
console.log();
|
|
21929
|
+
}
|
|
21930
|
+
console.log(source_default.dim("─".repeat(50)));
|
|
21931
|
+
console.log(source_default.dim(`Run ${source_default.cyan("skills install <name>")} to install a skill`));
|
|
21932
|
+
console.log(source_default.dim(`Run ${source_default.cyan("skills search <query>")} to search for specific skills`));
|
|
21933
|
+
}
|
|
21934
|
+
|
|
21890
21935
|
// src/index.ts
|
|
21891
21936
|
var program2 = new Command;
|
|
21892
21937
|
program2.name("skills").description("CLI for skills.md - AI Agent Skills Marketplace").version("0.1.0");
|
|
@@ -21899,6 +21944,12 @@ program2.command("login").description("Authenticate with skills.md").option("-k,
|
|
|
21899
21944
|
program2.command("logout").description("Log out of skills.md").action(logoutCommand);
|
|
21900
21945
|
program2.command("whoami").description("Show current user info").action(whoamiCommand);
|
|
21901
21946
|
program2.command("search <query>").description("Search for skills").action(searchCommand);
|
|
21947
|
+
program2.command("marketplace").alias("market").description("Browse skills from the marketplace").option("-l, --limit <number>", "Number of skills to show", "200").option("-c, --category <category>", "Filter by category").action((options) => {
|
|
21948
|
+
marketplaceCommand({
|
|
21949
|
+
limit: parseInt(options.limit, 10),
|
|
21950
|
+
category: options.category
|
|
21951
|
+
});
|
|
21952
|
+
});
|
|
21902
21953
|
program2.command("install <name>").alias("i").description("Install a skill (global by default)").option("-l, --local", "Install to current project instead of global").option("-t, --target <target>", "Target platform (claude, codex)").action((name, options) => {
|
|
21903
21954
|
installCommand(name, {
|
|
21904
21955
|
local: options.local,
|
|
@@ -21963,6 +22014,9 @@ ${source_default.bold("Examples:")}
|
|
|
21963
22014
|
${source_default.dim("# Login to your account")}
|
|
21964
22015
|
$ skills login
|
|
21965
22016
|
|
|
22017
|
+
${source_default.dim("# Browse the marketplace")}
|
|
22018
|
+
$ skills marketplace
|
|
22019
|
+
|
|
21966
22020
|
${source_default.dim("# Search for skills")}
|
|
21967
22021
|
$ skills search code review
|
|
21968
22022
|
|