@darkrymit/crunes-cli 0.7.1 → 0.8.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.
Files changed (75) hide show
  1. package/README.md +5 -4
  2. package/dist/chunks/{add-OWYVF3IE.js → add-CBHWFGCA.js} +2 -2
  3. package/dist/chunks/{apply-OMEVXCHC.js → apply-YC6JEPUN.js} +6 -5
  4. package/dist/chunks/args-repl-TX3YWUOO.js +81 -0
  5. package/dist/chunks/banner-repl-DD22Z33A.js +52 -0
  6. package/dist/chunks/benchmark-BJEAAFWG.js +234 -0
  7. package/dist/chunks/{browse-COH6IJEX.js → browse-JZFU52ET.js} +2 -2
  8. package/dist/chunks/{chunk-2Q24YPGL.js → chunk-2PBPDTRD.js} +2 -2
  9. package/dist/chunks/chunk-63H5VXZY.js +101 -0
  10. package/dist/chunks/{chunk-GHQOK4L7.js → chunk-65J65MAP.js} +1 -1
  11. package/dist/chunks/{chunk-HMU2J25D.js → chunk-6MRZXASS.js} +3 -3
  12. package/dist/chunks/{chunk-HOH7WZX4.js → chunk-ASZKAC24.js} +9 -1
  13. package/dist/chunks/{chunk-AIEWOUXT.js → chunk-DZJRYFOP.js} +104 -41
  14. package/dist/chunks/{chunk-QMWGQXEZ.js → chunk-G4ZAUHHA.js} +2 -4
  15. package/dist/chunks/{chunk-67I2J474.js → chunk-J3GZ3DXD.js} +14 -55
  16. package/dist/chunks/{chunk-XIXND2M4.js → chunk-JOAL437H.js} +5 -1
  17. package/dist/chunks/{chunk-6I7RHSAA.js → chunk-JU6FKUBY.js} +30394 -26055
  18. package/dist/chunks/{chunk-BVY5LN7X.js → chunk-NAEVMRNA.js} +22031 -13350
  19. package/dist/chunks/{chunk-NXSDVVTW.js → chunk-NDEYEYSU.js} +22 -69
  20. package/dist/chunks/{chunk-L72BG6DS.js → chunk-NYLRTAAA.js} +1 -1
  21. package/dist/chunks/{chunk-UGN3FFEF.js → chunk-V35LVVNV.js} +5113 -2117
  22. package/dist/chunks/chunk-ZJDKCC2Y.js +105 -0
  23. package/dist/chunks/{clear-Y5POLIMF.js → clear-YBDIPEEH.js} +5 -9
  24. package/dist/chunks/commands-repl-IPLJ4M7X.js +65 -0
  25. package/dist/chunks/complete-input-repl-IDSCMRYL.js +71 -0
  26. package/dist/chunks/{create-I6BNYZ5Q.js → create-ZFFV3Z2P.js} +2 -1
  27. package/dist/chunks/{delete-UB5SXO5I.js → delete-C4UJ7X5K.js} +5 -9
  28. package/dist/chunks/delete-E4TEBRPX.js +27 -0
  29. package/dist/chunks/{delete-7CQFYIXS.js → delete-LNOYM5KG.js} +5 -9
  30. package/dist/chunks/{disable-FCBW7WVG.js → disable-TMG2K3BF.js} +6 -6
  31. package/dist/chunks/{doctor-DS57HDLJ.js → doctor-N43QEMAH.js} +2 -2
  32. package/dist/chunks/{enable-IXRVUXJM.js → enable-327OMBPC.js} +6 -6
  33. package/dist/chunks/{globals-YCJ2DGWC.js → globals-H2WF344Y.js} +2 -2
  34. package/dist/chunks/{init-WGKQVAZE.js → init-HU5OMHEH.js} +1 -1
  35. package/dist/chunks/input-repl-ZBH6FVPV.js +87 -0
  36. package/dist/chunks/{install-BCTBOPBS.js → install-RRLUOYFO.js} +6 -6
  37. package/dist/chunks/intro-4CICBP2J.js +2727 -0
  38. package/dist/chunks/{kill-LWRXZVM5.js → kill-2UG7PHUV.js} +4 -10
  39. package/dist/chunks/list-4X3JFQGS.js +41 -0
  40. package/dist/chunks/{list-ZBYPMUID.js → list-7VHJIUDX.js} +2 -2
  41. package/dist/chunks/list-A5WVDBWF.js +53 -0
  42. package/dist/chunks/{list-NGOCMJXE.js → list-CK5X2YN3.js} +5 -4
  43. package/dist/chunks/{list-TTKLNJKI.js → list-FLAYJQKN.js} +2 -2
  44. package/dist/chunks/list-PTAWQYWG.js +35 -0
  45. package/dist/chunks/list-U7PAYNAH.js +47 -0
  46. package/dist/chunks/{list-OTOMCFLA.js → list-WH7KESMV.js} +12 -11
  47. package/dist/chunks/{query-NY4SCO77.js → query-AW7WYILM.js} +5 -9
  48. package/dist/chunks/{registry-W5XFI5T6.js → registry-3QIL5SVL.js} +2 -2
  49. package/dist/chunks/{remove-WEAZFZCO.js → remove-QUH2D3S5.js} +2 -2
  50. package/dist/chunks/repl-STBZC4P2.js +180 -0
  51. package/dist/chunks/repl-VGC5FUJG.js +378 -0
  52. package/dist/chunks/resolver-QMIY33FM.js +26 -0
  53. package/dist/chunks/run-T33CMCFZ.js +26 -0
  54. package/dist/chunks/{run-J2A5YTTY.js → run-Y4TG3EM3.js} +22 -3
  55. package/dist/chunks/rune-UBRVWG5A.js +139 -0
  56. package/dist/chunks/{search-XENXL3GC.js → search-MSSDGJTF.js} +2 -2
  57. package/dist/chunks/{uninstall-MX5PLGDI.js → uninstall-55YTHZRH.js} +5 -5
  58. package/dist/chunks/unset-YASSMSE5.js +24 -0
  59. package/dist/chunks/{update-7XDTVFZ3.js → update-EWWDROKW.js} +2 -2
  60. package/dist/chunks/{update-IEE54GPY.js → update-G6XO4RIM.js} +6 -6
  61. package/dist/chunks/{utils-PO3ZK53L.js → utils-XOWJQWNR.js} +2 -2
  62. package/dist/chunks/{version-V67W66HQ.js → version-I442SSH7.js} +10 -5
  63. package/dist/cli.js +114 -81
  64. package/package.json +9 -4
  65. package/dist/chunks/benchmark-ATSRQIDC.js +0 -164
  66. package/dist/chunks/check-G72VZKIP.js +0 -144
  67. package/dist/chunks/chunk-3TM6B4E5.js +0 -70
  68. package/dist/chunks/chunk-XXUNHQIB.js +0 -129
  69. package/dist/chunks/intro-RFWW5HIO.js +0 -1510
  70. package/dist/chunks/list-5DVVP7HX.js +0 -50
  71. package/dist/chunks/list-6WL5LGIZ.js +0 -80
  72. package/dist/chunks/list-YPI7YDKK.js +0 -80
  73. package/dist/chunks/run-AUAGELWL.js +0 -23
  74. package/dist/chunks/rune-D2FL547U.js +0 -87
  75. package/dist/chunks/unset-KQOZYVTE.js +0 -28
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveFromMarketplace
3
- } from "./chunk-L72BG6DS.js";
3
+ } from "./chunk-NYLRTAAA.js";
4
4
  import {
5
5
  installPlugin
6
- } from "./chunk-2Q24YPGL.js";
6
+ } from "./chunk-2PBPDTRD.js";
7
7
  import {
8
8
  R2 as R,
9
9
  fe,
@@ -13,8 +13,8 @@ import {
13
13
  import {
14
14
  loadRegistry,
15
15
  resolvePluginKey
16
- } from "./chunk-GHQOK4L7.js";
17
- import "./chunk-HMU2J25D.js";
16
+ } from "./chunk-65J65MAP.js";
17
+ import "./chunk-6MRZXASS.js";
18
18
  import "./chunk-G3U4V32O.js";
19
19
  import {
20
20
  init_require_shim
@@ -22,7 +22,7 @@ import {
22
22
 
23
23
  // src/plugin/commands/update.js
24
24
  init_require_shim();
25
- async function handler({ name, projectRoot }) {
25
+ async function handler({ name, projectRoot, configRoot }) {
26
26
  const registry = await loadRegistry();
27
27
  let plugins;
28
28
  if (name) {
@@ -62,7 +62,7 @@ async function handler({ name, projectRoot }) {
62
62
  continue;
63
63
  }
64
64
  try {
65
- const result = await installPlugin(resolvedSource, projectRoot, provenance);
65
+ const result = await installPlugin(resolvedSource, configRoot ?? projectRoot, provenance);
66
66
  if (result.installed) {
67
67
  R.success(`Updated ${pluginName}@${result.version}`);
68
68
  } else {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  utils_api_default
3
- } from "./chunk-BVY5LN7X.js";
3
+ } from "./chunk-NAEVMRNA.js";
4
4
  import {
5
5
  formatNode,
6
6
  walk
7
- } from "./chunk-XIXND2M4.js";
7
+ } from "./chunk-JOAL437H.js";
8
8
  import {
9
9
  output
10
10
  } from "./chunk-6XLT25GS.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-WCODTMDN.js";
4
4
  import {
5
5
  getStorePath
6
- } from "./chunk-HMU2J25D.js";
6
+ } from "./chunk-6MRZXASS.js";
7
7
  import {
8
8
  init_require_shim
9
9
  } from "./chunk-TPK5AGRA.js";
@@ -16,7 +16,7 @@ import path from "node:path";
16
16
  // package.json
17
17
  var package_default = {
18
18
  name: "@darkrymit/crunes-cli",
19
- version: "0.7.1",
19
+ version: "0.8.1",
20
20
  description: "CLI tool for querying crunes enrichers",
21
21
  type: "module",
22
22
  bin: {
@@ -31,7 +31,12 @@ var package_default = {
31
31
  test: "vitest run"
32
32
  },
33
33
  dependencies: {
34
- "isolated-vm": "^6.1.2"
34
+ chokidar: "^5.0.0",
35
+ "comment-json": "^5.0.0",
36
+ "csv-parse": "^7.0.0",
37
+ "csv-stringify": "^6.8.0",
38
+ "isolated-vm": "^6.1.2",
39
+ json5: "^2.2.3"
35
40
  },
36
41
  optionalDependencies: {
37
42
  "better-sqlite3": "^12.10.0"
@@ -39,7 +44,7 @@ var package_default = {
39
44
  devDependencies: {
40
45
  "@clack/prompts": "^1.5.0",
41
46
  archiver: "^8.0.0",
42
- chalk: "^5.4.1",
47
+ chalk: "^5.6.2",
43
48
  "cli-table3": "^0.6.5",
44
49
  commander: "^15.0.0",
45
50
  dotenv: "^17.4.2",
@@ -47,9 +52,9 @@ var package_default = {
47
52
  "fast-text-encoding": "^1.0.6",
48
53
  "fast-xml-parser": "^5.8.0",
49
54
  "jsonpath-plus": "^10.4.0",
50
- micromatch: "^4.0.8",
51
55
  mysql2: "^3.12.0",
52
56
  pg: "^8.11.0",
57
+ picomatch: "^4.0.2",
53
58
  tar: "^7.5.15",
54
59
  tinyglobby: "^0.2.17",
55
60
  typedoc: "^0.28.19",
package/dist/cli.js CHANGED
@@ -3396,7 +3396,7 @@ var program = new Command();
3396
3396
  // src/cli/program.js
3397
3397
  function buildProgram() {
3398
3398
  const program3 = new Command();
3399
- program3.name("crunes").description("CLI tool for managing context runes").version("0.7.1", "-v, --version").enablePositionalOptions().option("-y, --yes", "assume yes to all prompts and skip interactive mode (also auto-detected in non-TTY environments)").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").option("--cwd <path>", "project root to use instead of the current working directory").option("--ccd <path>", "config directory \u2014 where .crunes/config.json and local rune files live (default: --cwd)").option("--verbose", "print full error stack traces and other verbose output");
3399
+ program3.name("crunes").description("CLI tool for managing context runes").version("0.8.1", "-v, --version").enablePositionalOptions().option("-y, --yes", "assume yes to all prompts and skip interactive mode (also auto-detected in non-TTY environments)").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").option("--cwd <path>", "project root to use instead of the current working directory").option("--ccd <path>", "config directory \u2014 where .crunes/config.json and local rune files live (default: --cwd)").option("--verbose", "print full error stack traces and other verbose output");
3400
3400
  program3.hook("preAction", (_thisCommand, actionCommand) => {
3401
3401
  configure({ plain: !!program3.opts().plain, verbose: !!program3.opts().verbose });
3402
3402
  if (program3.opts().verbose) {
@@ -3413,27 +3413,35 @@ function buildProgram() {
3413
3413
  }
3414
3414
  program3.command("run [args...]").description("Run one or more runes and output the result.").addHelpText(
3415
3415
  "after",
3416
- '\nImportant: Global flags (e.g. --cwd) MUST appear before the "run" command.\n\nSyntax:\n [-b] [--section s1,s2] <key> [rune-args...] [+ [--section s] <key> [rune-args...]]...\n\nCommand flags:\n -b, --batch enable batching multiple runes with +\n --section s1,s2 filter output sections (per rune, before the key)\n --format text|jsonl output format (default: text)\n --fail-fast stop on first error\n\nKey prefixes:\n project:name resolve from project config only\n plugin:name resolve directly from an enabled plugin\n name auto-resolve: project config first, then plugins'
3417
- ).allowUnknownOption().passThroughOptions().action(async (args) => {
3418
- const { handler, parseRunArgs } = await import("./chunks/run-AUAGELWL.js");
3419
- const { segments, format, failFast } = parseRunArgs(args);
3420
- await handler({ segments, format, failFast, projectRoot: projectRoot(), configRoot: configRoot() });
3416
+ '\nImportant: Global flags (e.g. --cwd) MUST appear before the "run" command.\n\nSyntax:\n [run-flags] <key>[-s s1,s2] [rune-args...]\n -b [run-flags] <key1>[-s s1] [rune-args1] + <key2>[-s s2] [rune-args2]\n\nCommand flags:\n -b, --batch enable batching multiple runes with +\n --format text|jsonl output format (default: text)\n --fail-fast stop on first error\n\nPer-rune bracket flags (inside key[...]):\n -s, --section s1,s2 filter output sections for this rune\n\nKey prefixes:\n project:name resolve from project config only\n plugin:name resolve directly from an enabled plugin\n name auto-resolve: project config first, then plugins\n\nFor rune argument documentation: crunes docs rune <key>'
3417
+ ).allowUnknownOption().passThroughOptions().action(async (args, _opts, _command) => {
3418
+ const { handler, parseRunArgs } = await import("./chunks/run-T33CMCFZ.js");
3419
+ const { segments, format, failFast, isBatch } = parseRunArgs(args);
3420
+ await handler({ segments, format, failFast, isBatch, projectRoot: projectRoot(), configRoot: configRoot() });
3421
+ });
3422
+ program3.command("repl [args...]").description("Run a rune in interactive REPL mode (keeps isolate alive across inputs).").addHelpText(
3423
+ "after",
3424
+ '\nImportant: Global flags (e.g. --cwd) MUST appear before the "repl" command.\n\nSyntax:\n [--format text|jsonl] <key>[-s s1,s2] [rune-args...]\n\nPer-rune bracket flags (inside key[...]):\n -s, --section s1,s2 filter output sections for this rune\n\nThe rune must export repl(args) and/or inputRepl(input).\nFor rune argument documentation: crunes docs rune <key>'
3425
+ ).allowUnknownOption().passThroughOptions().action(async (args, _opts, _command) => {
3426
+ const { handler, parseReplArgs } = await import("./chunks/repl-VGC5FUJG.js");
3427
+ const { key, runeArgs, sections, format } = parseReplArgs(args);
3428
+ await handler({ key, runeArgs, sections, format, projectRoot: projectRoot(), configRoot: configRoot() });
3421
3429
  });
3422
3430
  const helpGroup = program3.command("docs").description("Show documentation for runes and other resources");
3423
3431
  helpGroup.command("rune <rune...>").description("Show usage, argument schema, and examples for one or more runes").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (keys, opts) => {
3424
- const { handler } = await import("./chunks/rune-D2FL547U.js");
3432
+ const { handler } = await import("./chunks/rune-UBRVWG5A.js");
3425
3433
  await handler({ keys, format: opts.format, projectRoot: projectRoot(), configRoot: configRoot() });
3426
3434
  });
3427
3435
  helpGroup.command("utils [namespaces...]").description("Show function signatures and parameter docs for utils.* namespaces").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (namespaces, opts) => {
3428
- const { handler } = await import("./chunks/utils-PO3ZK53L.js");
3436
+ const { handler } = await import("./chunks/utils-XOWJQWNR.js");
3429
3437
  await handler({ namespaces, format: opts.format });
3430
3438
  });
3431
3439
  helpGroup.command("globals").description("Show injected sandbox globals and ES2020 builtins available in rune scripts").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (opts) => {
3432
- const { handler } = await import("./chunks/globals-YCJ2DGWC.js");
3440
+ const { handler } = await import("./chunks/globals-H2WF344Y.js");
3433
3441
  await handler({ format: opts.format });
3434
3442
  });
3435
3443
  helpGroup.command("intro").description("Generate a comprehensive introduction and context document for Crunes and the active project").option("-g, --global", "generate a global, pure-ecosystem guide (skip local project context)").option("--out <path>", "output file path (defaults to stdout)").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (opts) => {
3436
- const { handler } = await import("./chunks/intro-RFWW5HIO.js");
3444
+ const { handler } = await import("./chunks/intro-4CICBP2J.js");
3437
3445
  await handler({
3438
3446
  global: !!opts.global,
3439
3447
  out: opts.out,
@@ -3447,32 +3455,48 @@ function buildProgram() {
3447
3455
  await handler();
3448
3456
  });
3449
3457
  helpGroup.command("run").description("Show detailed documentation, conventions, and examples for the run(args) export").action(async () => {
3450
- const { handler } = await import("./chunks/run-J2A5YTTY.js");
3458
+ const { handler } = await import("./chunks/run-Y4TG3EM3.js");
3459
+ await handler();
3460
+ });
3461
+ helpGroup.command("repl").description("Show detailed documentation, conventions, and examples for the repl(args) export").action(async () => {
3462
+ const { handler } = await import("./chunks/repl-STBZC4P2.js");
3463
+ await handler();
3464
+ });
3465
+ helpGroup.command("args-repl").description("Show detailed documentation, conventions, and examples for the argsRepl(builder) export").action(async () => {
3466
+ const { handler } = await import("./chunks/args-repl-TX3YWUOO.js");
3467
+ await handler();
3468
+ });
3469
+ helpGroup.command("banner-repl").description("Show detailed documentation and examples for the bannerRepl(args) export").action(async () => {
3470
+ const { handler } = await import("./chunks/banner-repl-DD22Z33A.js");
3471
+ await handler();
3472
+ });
3473
+ helpGroup.command("commands-repl").description("Show detailed documentation and examples for the commandsRepl(builder) export").action(async () => {
3474
+ const { handler } = await import("./chunks/commands-repl-IPLJ4M7X.js");
3475
+ await handler();
3476
+ });
3477
+ helpGroup.command("input-repl").description("Show detailed documentation and examples for the inputRepl(input) export").action(async () => {
3478
+ const { handler } = await import("./chunks/input-repl-ZBH6FVPV.js");
3479
+ await handler();
3480
+ });
3481
+ helpGroup.command("complete-input-repl").description("Show detailed documentation and examples for the completeInputRepl(tokens) export").action(async () => {
3482
+ const { handler } = await import("./chunks/complete-input-repl-IDSCMRYL.js");
3451
3483
  await handler();
3452
3484
  });
3453
3485
  program3.command("version").description("Print the installed version and check for updates").option("--no-check", "skip the npm update check").action(async (opts) => {
3454
- const { handler } = await import("./chunks/version-V67W66HQ.js");
3486
+ const { handler } = await import("./chunks/version-I442SSH7.js");
3455
3487
  await handler({ check: opts.check, plain: !!program3.opts().plain });
3456
3488
  });
3457
3489
  program3.command("doctor").description("Verify environment and project setup").action(async () => {
3458
- const { handler } = await import("./chunks/doctor-DS57HDLJ.js");
3490
+ const { handler } = await import("./chunks/doctor-N43QEMAH.js");
3459
3491
  await handler({ projectRoot: projectRoot() });
3460
3492
  });
3461
- program3.command("check [args...]").description("Run a rune and validate its output shape.").addHelpText("after", '\nImportant: Global flags (e.g. --cwd) MUST appear before the "check" command.\n\nSyntax:\n [--section s1,s2] <key> [rune-args...]').allowUnknownOption().passThroughOptions().action(async (args) => {
3462
- const { parseSegment } = await import("./chunks/run-AUAGELWL.js");
3463
- const { handler } = await import("./chunks/check-G72VZKIP.js");
3464
- const { key, sections, runeArgs } = parseSegment(args);
3465
- if (!key) {
3466
- const { output } = await import("./chunks/output-RJ6JSNY7.js");
3467
- output.error("Missing required argument: <rune>");
3468
- process.exit(1);
3469
- }
3470
- await handler({ key, sections, runeArgs, projectRoot: projectRoot(), configRoot: configRoot() });
3471
- });
3472
- program3.command("bench [args...]").description("Time rune execution and report fast, ok, or slow.").addHelpText("after", '\nImportant: Global flags (e.g. --cwd) MUST appear before the "bench" command.\n\nSyntax:\n [--runs <n>] [--warmup] [--section s1,s2] <key> [rune-args...]').allowUnknownOption().passThroughOptions().action(async (args) => {
3473
- const { handler, parseBenchArgs } = await import("./chunks/benchmark-ATSRQIDC.js");
3493
+ program3.command("bench [args...]").description("Time rune execution and report fast, ok, or slow.").addHelpText(
3494
+ "after",
3495
+ '\nImportant: Global flags (e.g. --cwd) MUST appear before the "bench" command.\n\nSyntax:\n [--runs <n>] [--warmup] <key>[--runs <n>] [--warmup] [-s s1,s2] [rune-args...]\n\nCommand flags:\n -b, --batch enable batching multiple runes with +\n --format text|jsonl output format (default: text)\n --fail-fast stop on first error\n --runs <n> default number of runs for all runes (default: 1)\n --warmup default warmup run for all runes\n\nPer-rune bracket flags (inside key[...]):\n --runs <n> override run count for this rune\n --warmup override warmup for this rune\n -s, --section s1,s2 filter output sections for this rune'
3496
+ ).allowUnknownOption().passThroughOptions().action(async (args, _opts, _command) => {
3497
+ const { handler, parseBenchArgs } = await import("./chunks/benchmark-BJEAAFWG.js");
3474
3498
  const parsed = parseBenchArgs(args);
3475
- if (!parsed.key) {
3499
+ if (!parsed.segments[0]?.key) {
3476
3500
  const { output } = await import("./chunks/output-RJ6JSNY7.js");
3477
3501
  output.error("Missing required argument: <rune>");
3478
3502
  process.exit(1);
@@ -3480,50 +3504,59 @@ function buildProgram() {
3480
3504
  await handler({ ...parsed, plain: !!program3.opts().plain, projectRoot: projectRoot(), configRoot: configRoot() });
3481
3505
  });
3482
3506
  program3.command("list").description("List all registered runes").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (opts) => {
3483
- const { handler } = await import("./chunks/list-OTOMCFLA.js");
3507
+ const { handler } = await import("./chunks/list-WH7KESMV.js");
3484
3508
  await handler({ format: opts.format, plain: !!program3.opts().plain, projectRoot: projectRoot(), configRoot: configRoot() });
3485
3509
  });
3486
3510
  const jobs = program3.command("job").description("Manage background jobs");
3487
- jobs.command("list").description("List background jobs for the current project").option("-g, --global", "list jobs across all projects").action(async (opts) => {
3488
- const { handler } = await import("./chunks/list-5DVVP7HX.js");
3489
- await handler({ projectDir: projectRoot(), global: !!opts.global });
3511
+ jobs.command("list").description("List background jobs for the current project").action(async () => {
3512
+ const { handler } = await import("./chunks/list-4X3JFQGS.js");
3513
+ await handler({ projectDir: projectRoot() });
3490
3514
  });
3491
- jobs.command("kill <id>").description("Send SIGTERM to a background job and remove its record").option("-g, --global", "search for the job across all projects").action(async (id, opts) => {
3492
- const { handler } = await import("./chunks/kill-LWRXZVM5.js");
3493
- await handler({ id, projectDir: projectRoot(), global: !!opts.global });
3515
+ jobs.command("kill <id>").description("Send SIGTERM to a background job and remove its record").action(async (id) => {
3516
+ const { handler } = await import("./chunks/kill-2UG7PHUV.js");
3517
+ await handler({ id, projectDir: projectRoot() });
3494
3518
  });
3495
3519
  const cache = program3.command("cache").description("Manage cache buckets");
3496
- cache.command("list").description("List cache buckets for the current project").option("-g, --global", "list all cache buckets across all projects and plugins").option("-p, --plugin [pluginId]", "filter to plugin-related buckets; pass a value to match a specific plugin").action(async (opts) => {
3497
- const { handler } = await import("./chunks/list-YPI7YDKK.js");
3498
- await handler({ projectDir: projectRoot(), global: !!opts.global, plugin: opts.plugin });
3520
+ cache.command("list").description("List cache buckets for the current project").option("-p, --plugin [pluginId]", "filter to plugin-related buckets; pass a value to match a specific plugin").action(async (opts) => {
3521
+ const { handler } = await import("./chunks/list-A5WVDBWF.js");
3522
+ await handler({ projectDir: projectRoot(), plugin: opts.plugin });
3523
+ });
3524
+ cache.command("clear <id>").description("Remove expired keys from a cache bucket").option("-p, --plugin [pluginId]", "filter to plugin-related buckets").action(async (id, opts) => {
3525
+ const { handler } = await import("./chunks/clear-YBDIPEEH.js");
3526
+ await handler({ id, projectDir: projectRoot(), plugin: opts.plugin });
3527
+ });
3528
+ cache.command("delete <id>").description("Delete a cache bucket directory and deregister it").option("-p, --plugin [pluginId]", "filter to plugin-related buckets").action(async (id, opts) => {
3529
+ const { handler } = await import("./chunks/delete-LNOYM5KG.js");
3530
+ await handler({ id, projectDir: projectRoot(), yes: !!program3.opts().yes, plugin: opts.plugin });
3499
3531
  });
3500
- cache.command("clear <id>").description("Remove expired keys from a cache bucket").option("-g, --global", "resolve the id across all projects").option("-p, --plugin [pluginId]", "filter to plugin-related buckets").action(async (id, opts) => {
3501
- const { handler } = await import("./chunks/clear-Y5POLIMF.js");
3502
- await handler({ id, projectDir: projectRoot(), global: !!opts.global, plugin: opts.plugin });
3532
+ cache.command("unset <id> <key>").description("Remove a single key from a cache bucket").option("-p, --plugin [pluginId]", "filter to plugin-related buckets").action(async (id, key, opts) => {
3533
+ const { handler } = await import("./chunks/unset-YASSMSE5.js");
3534
+ await handler({ id, key, projectDir: projectRoot(), plugin: opts.plugin });
3503
3535
  });
3504
- cache.command("delete <id>").description("Delete a cache bucket directory and deregister it").option("-g, --global", "resolve the id across all projects").option("-p, --plugin [pluginId]", "filter to plugin-related buckets").action(async (id, opts) => {
3505
- const { handler } = await import("./chunks/delete-7CQFYIXS.js");
3506
- await handler({ id, projectDir: projectRoot(), yes: !!program3.opts().yes, global: !!opts.global, plugin: opts.plugin });
3536
+ const schema = program3.command("schema").description("Manage schema cache");
3537
+ schema.command("list").description("List cached schemas for the current project").action(async () => {
3538
+ const { handler } = await import("./chunks/list-PTAWQYWG.js");
3539
+ await handler({ projectDir: projectRoot() });
3507
3540
  });
3508
- cache.command("unset <id> <key>").description("Remove a single key from a cache bucket").option("-g, --global", "resolve the id across all projects").option("-p, --plugin [pluginId]", "filter to plugin-related buckets").action(async (id, key, opts) => {
3509
- const { handler } = await import("./chunks/unset-KQOZYVTE.js");
3510
- await handler({ id, key, projectDir: projectRoot(), global: !!opts.global, plugin: opts.plugin });
3541
+ schema.command("delete <rune-key>").description("Delete cached schema files for a rune key").action(async (runeKey) => {
3542
+ const { handler } = await import("./chunks/delete-E4TEBRPX.js");
3543
+ await handler({ runeKey, projectDir: projectRoot() });
3511
3544
  });
3512
3545
  const sqlite = program3.command("sqlite").description("Manage SQLite databases");
3513
- sqlite.command("list").description("List all registered SQLite databases").option("-g, --global", "List databases from all projects (default: current project only)").option("-p, --plugin [pluginId]", "filter to plugin-related databases; pass a value to match a specific plugin").action(async (opts) => {
3514
- const { handler } = await import("./chunks/list-6WL5LGIZ.js");
3515
- await handler({ projectDir: projectRoot(), global: !!opts.global, plugin: opts.plugin });
3546
+ sqlite.command("list").description("List all registered SQLite databases").option("-p, --plugin [pluginId]", "filter to plugin-related databases; pass a value to match a specific plugin").action(async (opts) => {
3547
+ const { handler } = await import("./chunks/list-U7PAYNAH.js");
3548
+ await handler({ projectDir: projectRoot(), plugin: opts.plugin });
3516
3549
  });
3517
- sqlite.command("delete <id>").description("Delete a SQLite database file and deregister it").option("-g, --global", "Match databases from all projects (default: current project only)").option("-p, --plugin [pluginId]", "filter to plugin-related databases").action(async (id, opts) => {
3518
- const { handler } = await import("./chunks/delete-UB5SXO5I.js");
3519
- await handler({ id, yes: !!program3.opts().yes, projectDir: projectRoot(), global: !!opts.global, plugin: opts.plugin });
3550
+ sqlite.command("delete <id>").description("Delete a SQLite database file and deregister it").option("-p, --plugin [pluginId]", "filter to plugin-related databases").action(async (id, opts) => {
3551
+ const { handler } = await import("./chunks/delete-C4UJ7X5K.js");
3552
+ await handler({ id, yes: !!program3.opts().yes, projectDir: projectRoot(), plugin: opts.plugin });
3520
3553
  });
3521
- sqlite.command("query <id> <sql>").description("Run a SQL query against a registered SQLite database (readonly)").option("-g, --global", "Match databases from all projects (default: current project only)").option("-p, --plugin [pluginId]", "filter to plugin-related databases").action(async (id, sql, opts) => {
3522
- const { handler } = await import("./chunks/query-NY4SCO77.js");
3523
- await handler({ id, sql, projectDir: projectRoot(), global: !!opts.global, plugin: opts.plugin });
3554
+ sqlite.command("query <id> <sql>").description("Run a SQL query against a registered SQLite database (readonly)").option("-p, --plugin [pluginId]", "filter to plugin-related databases").action(async (id, sql, opts) => {
3555
+ const { handler } = await import("./chunks/query-AW7WYILM.js");
3556
+ await handler({ id, sql, projectDir: projectRoot(), plugin: opts.plugin });
3524
3557
  });
3525
3558
  program3.command("init").description("Create .crunes/config.json in the current project").action(async () => {
3526
- const { handler } = await import("./chunks/init-WGKQVAZE.js");
3559
+ const { handler } = await import("./chunks/init-HU5OMHEH.js");
3527
3560
  await handler({ yes: !!program3.opts().yes, projectRoot: projectRoot() });
3528
3561
  });
3529
3562
  program3.command("create [new-rune]").description("Scaffold a new rune and register it in config").addOption(new Option("--format <format>", "rune output format").choices(["tree", "markdown"])).option("--path <path>", "file path for the rune (default: .crunes/runes/<key>.js)").option("--name <name>", "human-readable label shown in crunes list").option("--description <description>", "short description of what context this rune provides").action(async (key, opts) => {
@@ -3532,44 +3565,44 @@ function buildProgram() {
3532
3565
  });
3533
3566
  const plugin = program3.command("plugin").description("Manage rune plugins");
3534
3567
  plugin.command("install <source>").description("Install a plugin from a configured marketplace in the format <marketplace>@<plugin>").action(async (source) => {
3535
- const { handler } = await import("./chunks/install-BCTBOPBS.js");
3536
- await handler({ source, projectRoot: projectRoot(), yes: !!program3.opts().yes });
3568
+ const { handler } = await import("./chunks/install-RRLUOYFO.js");
3569
+ await handler({ source, projectRoot: projectRoot(), configRoot: configRoot(), yes: !!program3.opts().yes });
3537
3570
  });
3538
3571
  plugin.command("uninstall <plugin>").description("Uninstall an installed plugin").action(async (name) => {
3539
- const { handler } = await import("./chunks/uninstall-MX5PLGDI.js");
3540
- await handler({ name, yes: !!program3.opts().yes, projectRoot: projectRoot() });
3572
+ const { handler } = await import("./chunks/uninstall-55YTHZRH.js");
3573
+ await handler({ name, yes: !!program3.opts().yes, projectRoot: projectRoot(), configRoot: configRoot() });
3541
3574
  });
3542
3575
  plugin.command("list").description("List installed plugins").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (opts) => {
3543
- const { handler } = await import("./chunks/list-TTKLNJKI.js");
3576
+ const { handler } = await import("./chunks/list-FLAYJQKN.js");
3544
3577
  await handler({ format: opts.format });
3545
3578
  });
3546
3579
  plugin.command("update [plugin]").description("Update one or all installed plugins").action(async (name) => {
3547
- const { handler } = await import("./chunks/update-IEE54GPY.js");
3548
- await handler({ name, projectRoot: projectRoot() });
3580
+ const { handler } = await import("./chunks/update-G6XO4RIM.js");
3581
+ await handler({ name, projectRoot: projectRoot(), configRoot: configRoot() });
3549
3582
  });
3550
3583
  plugin.command("enable <plugin>").description("Add a plugin to this project's enabled list").action(async (name) => {
3551
- const { handler } = await import("./chunks/enable-IXRVUXJM.js");
3552
- await handler({ name, projectRoot: projectRoot() });
3584
+ const { handler } = await import("./chunks/enable-327OMBPC.js");
3585
+ await handler({ name, projectRoot: projectRoot(), configRoot: configRoot() });
3553
3586
  });
3554
3587
  plugin.command("disable <plugin>").description("Remove a plugin from this project's enabled list").action(async (name) => {
3555
- const { handler } = await import("./chunks/disable-FCBW7WVG.js");
3556
- await handler({ name, projectRoot: projectRoot() });
3588
+ const { handler } = await import("./chunks/disable-TMG2K3BF.js");
3589
+ await handler({ name, projectRoot: projectRoot(), configRoot: configRoot() });
3557
3590
  });
3558
3591
  plugin.command("create [new-plugin]").description("Scaffold a new plugin directory with all required files").option("--description <text>", "short description for plugin.json and marketplace.json").option("--author <name>", "author name (default: git config user.name)").option("--license <spdx>", "SPDX license identifier (default: MIT)").option("--out <path>", "output directory (default: ./<name>)").action(async (name, opts) => {
3559
- const { handler } = await import("./chunks/create-I6BNYZ5Q.js");
3592
+ const { handler } = await import("./chunks/create-ZFFV3Z2P.js");
3560
3593
  await handler({ name, description: opts.description, author: opts.author, license: opts.license, out: opts.out, yes: !!program3.opts().yes, projectRoot: projectRoot() });
3561
3594
  });
3562
3595
  const template = program3.command("template").description("Manage rune templates");
3563
3596
  template.command("list [template-source]").description('List available templates. [template-source] can be "project" (project config only) or a plugin name; omit to list all.').addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (source, opts) => {
3564
- const { handler } = await import("./chunks/list-NGOCMJXE.js");
3565
- await handler({ source, format: opts.format, plain: !!program3.opts().plain, projectRoot: projectRoot() });
3597
+ const { handler } = await import("./chunks/list-CK5X2YN3.js");
3598
+ await handler({ source, format: opts.format, plain: !!program3.opts().plain, projectRoot: projectRoot(), configRoot: configRoot() });
3566
3599
  });
3567
3600
  template.command("apply <template>").description("Copy a template into the project as a new rune and register it in config.").addHelpText(
3568
3601
  "after",
3569
3602
  "\nKey prefixes:\n project:name \u2014 use a template defined in this project's config\n plugin:name \u2014 use a template from a specific installed plugin\n name \u2014 auto-resolve: project config first, then installed plugins"
3570
3603
  ).option("--as <new-rune>", "register the rune under a different key (default: template name)").option("--path <path>", "file path for the rune (default: .crunes/runes/<key>.js)").option("--name <name>", "human-readable label shown in crunes list").option("--description <description>", "short description of what context this rune provides").action(async (ref, opts) => {
3571
- const { handler } = await import("./chunks/apply-OMEVXCHC.js");
3572
- await handler({ ref, key: opts.as, path: opts.path, name: opts.name, description: opts.description, yes: !!program3.opts().yes, projectRoot: projectRoot() });
3604
+ const { handler } = await import("./chunks/apply-YC6JEPUN.js");
3605
+ await handler({ ref, key: opts.as, path: opts.path, name: opts.name, description: opts.description, yes: !!program3.opts().yes, projectRoot: projectRoot(), configRoot: configRoot() });
3573
3606
  });
3574
3607
  template.command("create [new-template]").description("Scaffold a new template file and register it in config").option("--path <path>", "file path for the template (default: .crunes/templates/<name>.js)").option("--name <name>", "display label shown in crunes template list (separate from the template key)").option("--description <description>", "short description of what kind of rune this template produces").action(async (name, opts) => {
3575
3608
  const { handler } = await import("./chunks/create-GPDE2YKL.js");
@@ -3577,27 +3610,27 @@ function buildProgram() {
3577
3610
  });
3578
3611
  const marketplace = program3.command("marketplace").description("Manage plugin marketplace sources");
3579
3612
  marketplace.command("add <url>").description("Add a marketplace source URL").action(async (url) => {
3580
- const { handler } = await import("./chunks/add-OWYVF3IE.js");
3613
+ const { handler } = await import("./chunks/add-CBHWFGCA.js");
3581
3614
  await handler({ url });
3582
3615
  });
3583
3616
  marketplace.command("remove <url>").description("Remove a marketplace source URL").action(async (url) => {
3584
- const { handler } = await import("./chunks/remove-WEAZFZCO.js");
3617
+ const { handler } = await import("./chunks/remove-QUH2D3S5.js");
3585
3618
  await handler({ url });
3586
3619
  });
3587
3620
  marketplace.command("list").description("List configured marketplace sources").action(async () => {
3588
- const { handler } = await import("./chunks/list-ZBYPMUID.js");
3621
+ const { handler } = await import("./chunks/list-7VHJIUDX.js");
3589
3622
  await handler();
3590
3623
  });
3591
3624
  marketplace.command("search <query>").description("Search for plugins across configured marketplace sources").action(async (query) => {
3592
- const { handler } = await import("./chunks/search-XENXL3GC.js");
3625
+ const { handler } = await import("./chunks/search-MSSDGJTF.js");
3593
3626
  await handler({ query });
3594
3627
  });
3595
3628
  marketplace.command("update [url]").description("Refresh cached marketplace data (all sources if no URL given)").action(async (url) => {
3596
- const { handler } = await import("./chunks/update-7XDTVFZ3.js");
3629
+ const { handler } = await import("./chunks/update-EWWDROKW.js");
3597
3630
  await handler({ url });
3598
3631
  });
3599
3632
  marketplace.command("browse").description("List all plugins from all configured marketplace sources").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (opts) => {
3600
- const { handler } = await import("./chunks/browse-COH6IJEX.js");
3633
+ const { handler } = await import("./chunks/browse-JZFU52ET.js");
3601
3634
  await handler({ format: opts.format });
3602
3635
  });
3603
3636
  const completions = program3.command("completions").description("Manage shell tab-completions");
@@ -3628,9 +3661,9 @@ function buildProgram() {
3628
3661
 
3629
3662
  // src/cli/cli.js
3630
3663
  if (process.env.CRUNES_NO_TIMEOUT === "1") {
3631
- const useIdx = process.argv.indexOf("use");
3632
- if (useIdx !== -1 && process.argv[useIdx + 1]) {
3633
- process.title = `crunes: ${process.argv[useIdx + 1]}`;
3664
+ const runIdx = process.argv.indexOf("run");
3665
+ if (runIdx !== -1 && process.argv[runIdx + 1]) {
3666
+ process.title = `crunes: ${process.argv[runIdx + 1]}`;
3634
3667
  }
3635
3668
  }
3636
3669
  var program2 = buildProgram();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkrymit/crunes-cli",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "CLI tool for querying crunes enrichers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,12 @@
15
15
  "test": "vitest run"
16
16
  },
17
17
  "dependencies": {
18
- "isolated-vm": "^6.1.2"
18
+ "chokidar": "^5.0.0",
19
+ "comment-json": "^5.0.0",
20
+ "csv-parse": "^7.0.0",
21
+ "csv-stringify": "^6.8.0",
22
+ "isolated-vm": "^6.1.2",
23
+ "json5": "^2.2.3"
19
24
  },
20
25
  "optionalDependencies": {
21
26
  "better-sqlite3": "^12.10.0"
@@ -23,7 +28,7 @@
23
28
  "devDependencies": {
24
29
  "@clack/prompts": "^1.5.0",
25
30
  "archiver": "^8.0.0",
26
- "chalk": "^5.4.1",
31
+ "chalk": "^5.6.2",
27
32
  "cli-table3": "^0.6.5",
28
33
  "commander": "^15.0.0",
29
34
  "dotenv": "^17.4.2",
@@ -31,9 +36,9 @@
31
36
  "fast-text-encoding": "^1.0.6",
32
37
  "fast-xml-parser": "^5.8.0",
33
38
  "jsonpath-plus": "^10.4.0",
34
- "micromatch": "^4.0.8",
35
39
  "mysql2": "^3.12.0",
36
40
  "pg": "^8.11.0",
41
+ "picomatch": "^4.0.2",
37
42
  "tar": "^7.5.15",
38
43
  "tinyglobby": "^0.2.17",
39
44
  "typedoc": "^0.28.19",