@dealdeploy/skl 0.1.3 → 0.1.5

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/index.ts +26 -10
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -1,25 +1,41 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
- process.on("uncaughtException", (err) => {
4
- console.error(`skl: ${err.message}`);
5
- process.exit(1);
6
- });
3
+ import { readFileSync } from "fs";
4
+ import { join as _join, dirname } from "path";
5
+ import { fileURLToPath } from "url";
6
+
7
+ const _pkgPath = _join(dirname(fileURLToPath(import.meta.url)), "package.json");
8
+ const _pkg = JSON.parse(readFileSync(_pkgPath, "utf8"));
9
+
10
+ // ── Flags ────────────────────────────────────────────────────────────
11
+ const arg = process.argv[2];
12
+ if (arg === "-v" || arg === "--version") {
13
+ console.log(`skl ${_pkg.version}`);
14
+ process.exit(0);
15
+ }
7
16
 
8
17
  // ── Subcommand routing ───────────────────────────────────────────────
9
- const [subcommand] = process.argv.slice(2);
10
- if (subcommand === "add") {
11
- await import("./add.ts");
18
+ if (arg === "add") {
19
+ await import("./add.ts").catch((err) => {
20
+ console.error(`skl: ${err.message}`);
21
+ process.exit(1);
22
+ });
12
23
  process.exit(0);
13
24
  }
14
25
 
15
- import {
26
+ // ── Dynamic import to ensure errors are visible ──────────────────────
27
+ const {
16
28
  createCliRenderer,
17
29
  BoxRenderable,
18
30
  TextRenderable,
19
31
  ScrollBoxRenderable,
20
32
  TextAttributes,
21
- type KeyEvent,
22
- } from "@opentui/core";
33
+ } = await import("@opentui/core").catch((err) => {
34
+ console.error(`skl: failed to load TUI library: ${err.message}`);
35
+ process.exit(1);
36
+ });
37
+ type KeyEvent = import("@opentui/core").KeyEvent;
38
+
23
39
  import {
24
40
  readdirSync,
25
41
  lstatSync,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dealdeploy/skl",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "TUI skill manager for Claude Code agents",
5
5
  "module": "index.ts",
6
6
  "bin": {