skillhub 0.1.5 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/index.js +23 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ import { parseSkillMd } from "skillhub-core";
25
25
  import https from "https";
26
26
  import http from "http";
27
27
  var API_BASE_URL = process.env.SKILLHUB_API_URL || "https://skills.palebluedot.live/api";
28
- var API_TIMEOUT = parseInt(process.env.SKILLHUB_API_TIMEOUT || "30000");
28
+ var API_TIMEOUT = parseInt(process.env.SKILLHUB_API_TIMEOUT || "10000");
29
29
  function httpsRequest(url, options = {}) {
30
30
  return new Promise((resolve, reject) => {
31
31
  const parsedUrl = new URL(url);
@@ -247,7 +247,7 @@ async function getDefaultBranch(owner, repo) {
247
247
 
248
248
  // src/commands/install.ts
249
249
  async function install(skillId, options) {
250
- const spinner = ora("Fetching skill information...").start();
250
+ const spinner = ora("Parsing skill ID...").start();
251
251
  try {
252
252
  const parts = skillId.split("/");
253
253
  if (parts.length < 2) {
@@ -255,18 +255,29 @@ async function install(skillId, options) {
255
255
  process.exit(1);
256
256
  }
257
257
  const [owner, repo, ...rest] = parts;
258
- const skillPath = rest.join("/");
258
+ let skillPath = rest.join("/");
259
259
  let skillInfo;
260
- try {
261
- skillInfo = await getSkill(skillId);
262
- } catch (error) {
263
- spinner.warn(`API error: ${error.message}`);
264
- spinner.start("Falling back to direct GitHub fetch...");
260
+ if (!options.noApi) {
261
+ spinner.text = `Connecting to ${process.env.SKILLHUB_API_URL || "https://skills.palebluedot.live"}...`;
262
+ try {
263
+ skillInfo = await getSkill(skillId);
264
+ if (skillInfo) {
265
+ spinner.succeed(`Found in registry: ${skillInfo.name}`);
266
+ spinner.start("Preparing installation...");
267
+ }
268
+ } catch (error) {
269
+ spinner.warn(`API unavailable: ${error.message}`);
270
+ spinner.start("Falling back to direct GitHub fetch...");
271
+ }
272
+ } else {
273
+ spinner.text = "Skipping API lookup (--no-api flag)";
265
274
  }
266
275
  let skillName;
267
276
  let branch = "main";
268
277
  if (skillInfo) {
269
278
  skillName = skillInfo.name;
279
+ skillPath = skillInfo.skillPath;
280
+ branch = skillInfo.branch || "main";
270
281
  spinner.text = `Found skill: ${chalk.cyan(skillName)}`;
271
282
  } else {
272
283
  spinner.text = "Skill not in registry, fetching from GitHub...";
@@ -578,11 +589,13 @@ var pkg = require2("../package.json");
578
589
  var VERSION = pkg.version;
579
590
  var program = new Command();
580
591
  program.name("skillhub").description("CLI for managing AI Agent skills").version(VERSION);
581
- program.command("install <skill-id>").description("Install a skill from the registry").option("-p, --platform <platform>", "Target platform (claude, codex, copilot, cursor, windsurf)", "claude").option("--project", "Install in the current project instead of globally").option("-f, --force", "Overwrite existing skill").action(async (skillId, options) => {
592
+ program.command("install <skill-id>").description("Install a skill from the registry").option("-p, --platform <platform>", "Target platform (claude, codex, copilot, cursor, windsurf)", "claude").option("--project", "Install in the current project instead of globally").option("-f, --force", "Overwrite existing skill").option("--no-api", "Skip API lookup and fetch directly from GitHub").action(async (skillId, options) => {
582
593
  await install(skillId, {
583
594
  platform: options.platform,
584
595
  project: options.project,
585
- force: options.force
596
+ force: options.force,
597
+ noApi: !options.api
598
+ // Commander converts --no-api to api: false
586
599
  });
587
600
  });
588
601
  program.command("search <query>").description("Search for skills in the registry").option("-p, --platform <platform>", "Filter by platform").option("-l, --limit <number>", "Number of results", "10").action(async (query, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillhub",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "CLI tool for managing AI Agent skills - search, install, and update skills for Claude, Codex, Copilot, and more",
5
5
  "author": "SkillHub Contributors",
6
6
  "license": "MIT",