ccski 2.3.0 → 2.3.1

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/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { x as __require } from "./create-prompt-CIJV_96B.mjs";
3
3
  import { $ as AmbiguousSkillNameError, A as highlight, C as formatSkillLabel, D as error, E as duplicateBadge, F as tone, I as warn, L as containsCaseInsensitive, M as renderList, N as setColorEnabled, O as formatBytes, P as success, R as rankStrings, S as SkillRegistry, T as dim, U as compareSkillProviders, W as providerNamesFromSkills, _ as listSkills, a as InstallCancelledError, b as computeDuplicateGroups, f as validateSkill, g as resolveSkill, h as getSkillInfo, i as toggleSkills, j as info, k as heading, l as installSkills, n as MultiSelectError, nt as SkillNotFoundError, o as MultiSkillSelectionError, p as searchSkills, r as ToggleCancelledError, s as createConsoleInstallOutput, t as startMCPServer, u as registerInstallCleanupHandlers, v as buildRegistryOptions, w as colors, x as parseFilters, y as applyFilters } from "./server-y5_8eQ5a.mjs";
4
- import { statSync } from "node:fs";
4
+ import { readFileSync, statSync } from "node:fs";
5
5
  import { readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync as statSync$1, writeFile } from "fs";
6
6
  import { homedir } from "node:os";
7
7
  import { join } from "node:path";
@@ -4553,6 +4553,19 @@ async function validateCommand(argv) {
4553
4553
  }
4554
4554
  }
4555
4555
 
4556
+ //#endregion
4557
+ //#region src/package-version.ts
4558
+ function isRecord(value) {
4559
+ return typeof value === "object" && value !== null && !Array.isArray(value);
4560
+ }
4561
+ function readPackageVersion() {
4562
+ try {
4563
+ const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
4564
+ if (isRecord(packageJson) && typeof packageJson.version === "string") return packageJson.version;
4565
+ } catch {}
4566
+ return "unknown";
4567
+ }
4568
+
4556
4569
  //#endregion
4557
4570
  //#region src/cli.ts
4558
4571
  const listModule = {
@@ -4922,7 +4935,7 @@ await yargs_default(hideBin(process.argv)).scriptName("ccski").usage("$0 <comman
4922
4935
  type: "string",
4923
4936
  description: "Override user directory for default skill roots",
4924
4937
  default: homedir()
4925
- }).command(listModule).command(infoModule).command(searchModule).command(validateModule).command(mcpModule).command(installModule).command(disableModule).command(enableModule).demandCommand(1, "Please provide a command").strict().help().alias("h", "help").alias("v", "version").parse();
4938
+ }).command(listModule).command(infoModule).command(searchModule).command(validateModule).command(mcpModule).command(installModule).command(disableModule).command(enableModule).demandCommand(1, "Please provide a command").strict().help().alias("h", "help").version(readPackageVersion()).alias("v", "version").parse();
4926
4939
 
4927
4940
  //#endregion
4928
4941
  export { };