@evalguardai/cli 1.4.0 → 1.5.0

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.cjs +47 -49
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -123671,9 +123671,9 @@ var fs3, path3, os2, DB_DIR, DB_FILE;
123671
123671
  var init_store2 = __esm({
123672
123672
  "src/commands/store.ts"() {
123673
123673
  "use strict";
123674
- fs3 = __toESM(require("fs"), 1);
123675
- path3 = __toESM(require("path"), 1);
123676
- os2 = __toESM(require("os"), 1);
123674
+ fs3 = __toESM(require("fs"));
123675
+ path3 = __toESM(require("path"));
123676
+ os2 = __toESM(require("os"));
123677
123677
  DB_DIR = path3.join(os2.homedir(), ".evalguard");
123678
123678
  DB_FILE = path3.join(DB_DIR, "results.json");
123679
123679
  }
@@ -125112,15 +125112,15 @@ function ora(options) {
125112
125112
  }
125113
125113
 
125114
125114
  // src/index.ts
125115
- var fs19 = __toESM(require("fs"), 1);
125116
- var path18 = __toESM(require("path"), 1);
125117
- var os7 = __toESM(require("os"), 1);
125115
+ var fs19 = __toESM(require("fs"));
125116
+ var path18 = __toESM(require("path"));
125117
+ var os7 = __toESM(require("os"));
125118
125118
  var import_module = require("module");
125119
125119
 
125120
125120
  // src/commands/init.ts
125121
- var fs = __toESM(require("fs"), 1);
125122
- var path = __toESM(require("path"), 1);
125123
- var readline = __toESM(require("readline"), 1);
125121
+ var fs = __toESM(require("fs"));
125122
+ var path = __toESM(require("path"));
125123
+ var readline = __toESM(require("readline"));
125124
125124
  var TEMPLATES = {
125125
125125
  "hello-world": {
125126
125126
  description: "Simple hello-world evaluation with basic assertions",
@@ -125590,9 +125590,8 @@ function scaffoldTemplate(configPath, templateName, template, isLocal) {
125590
125590
  }
125591
125591
 
125592
125592
  // src/commands/eval-local.ts
125593
- var fs4 = __toESM(require("fs"), 1);
125594
- var path4 = __toESM(require("path"), 1);
125595
- var import_meta = {};
125593
+ var fs4 = __toESM(require("fs"));
125594
+ var path4 = __toESM(require("path"));
125596
125595
  function registerEvalLocal(program3) {
125597
125596
  program3.command("eval:local").description("Run evaluation locally (no API key needed)").argument("[file]", "Path to eval config JSON/YAML file (default: evalguard.yaml)").option("--model <model>", "Override model").option("--provider <provider>", "Override provider (openai, anthropic, etc.)").option("--output <format>", "Output format: json, csv, html, or file path").option("--verbose", "Show detailed output per test case", false).action(async (fileArg, opts) => {
125598
125597
  const core = await Promise.resolve().then(() => (init_src(), src_exports));
@@ -125622,7 +125621,7 @@ function registerEvalLocal(program3) {
125622
125621
  if (filePath.endsWith(".yaml") || filePath.endsWith(".yml")) {
125623
125622
  try {
125624
125623
  const { createRequire: createRequire2 } = await import("module");
125625
- const jsYaml = createRequire2(import_meta.url || __filename)("yaml");
125624
+ const jsYaml = createRequire2(__filename || __filename)("yaml");
125626
125625
  const parsed = jsYaml.parse(raw);
125627
125626
  config = {
125628
125627
  name: parsed.description || parsed.name || path4.basename(filePath, path4.extname(filePath)),
@@ -125905,8 +125904,8 @@ function writeOutput(output, data, formatJSON3, formatCSV2, formatHTML2) {
125905
125904
  }
125906
125905
 
125907
125906
  // src/commands/scan-local.ts
125908
- var fs5 = __toESM(require("fs"), 1);
125909
- var path5 = __toESM(require("path"), 1);
125907
+ var fs5 = __toESM(require("fs"));
125908
+ var path5 = __toESM(require("path"));
125910
125909
  function registerScanLocal(program3) {
125911
125910
  program3.command("scan:local").description("Run red team security scan locally (no API key needed)").argument("<file>", "Path to scan config JSON file").option("--model <model>", "Override model").option("--provider <provider>", "Override provider").option("--output <format>", "Output format: json or file path").option("--verbose", "Show each finding", false).action(async (file, opts) => {
125912
125911
  const core = await Promise.resolve().then(() => (init_src(), src_exports));
@@ -126021,8 +126020,8 @@ function resolveApiKey2(provider) {
126021
126020
  }
126022
126021
 
126023
126022
  // src/commands/generate.ts
126024
- var fs6 = __toESM(require("fs"), 1);
126025
- var path6 = __toESM(require("path"), 1);
126023
+ var fs6 = __toESM(require("fs"));
126024
+ var path6 = __toESM(require("path"));
126026
126025
  function registerGenerate(program3) {
126027
126026
  const gen2 = program3.command("generate").description("Generate synthetic test data");
126028
126027
  gen2.command("tests").description("Generate test cases from a description").argument("<description>", "What to test (e.g., 'customer support chatbot')").option("-n, --count <n>", "Number of test cases", "10").option("--model <model>", "LLM model for generation", "gpt-4o").option("--provider <provider>", "Provider name", "openai").option("--strategies <list>", "Evolution strategies (comma-separated)", "").option("--output <file>", "Output file path", "generated-tests.json").action(async (description, opts) => {
@@ -126169,8 +126168,8 @@ async function makeCallLLM(providerName, model, createProvider2) {
126169
126168
  }
126170
126169
 
126171
126170
  // src/commands/validate.ts
126172
- var fs7 = __toESM(require("fs"), 1);
126173
- var path7 = __toESM(require("path"), 1);
126171
+ var fs7 = __toESM(require("fs"));
126172
+ var path7 = __toESM(require("path"));
126174
126173
  function registerValidate(program3) {
126175
126174
  program3.command("validate").description("Validate an eval or scan config file").argument("<file>", "Path to config JSON file").action(async (file) => {
126176
126175
  const { BUILT_IN_SCORERS: BUILT_IN_SCORERS2, ATTACK_TYPES: ATTACK_TYPES2, ALL_PLUGINS: ALL_PLUGINS2, ALL_STRATEGIES: ALL_STRATEGIES2, ALL_GRADERS: ALL_GRADERS2 } = await Promise.resolve().then(() => (init_src(), src_exports));
@@ -126321,8 +126320,8 @@ function validateScanConfig(config, errors, warnings, ATTACK_TYPES2, ALL_PLUGINS
126321
126320
  }
126322
126321
 
126323
126322
  // src/commands/compare.ts
126324
- var fs8 = __toESM(require("fs"), 1);
126325
- var path8 = __toESM(require("path"), 1);
126323
+ var fs8 = __toESM(require("fs"));
126324
+ var path8 = __toESM(require("path"));
126326
126325
  function registerCompare(program3) {
126327
126326
  program3.command("compare").description("Compare two evaluation result files").argument("<file1>", "First result file (baseline)").argument("<file2>", "Second result file (candidate)").option("--threshold <n>", "Minimum score improvement to highlight", "0.05").action((file1, file2, opts) => {
126328
126327
  const threshold = parseFloat(opts.threshold);
@@ -126545,8 +126544,8 @@ function registerList(program3) {
126545
126544
  }
126546
126545
 
126547
126546
  // src/commands/firewall.ts
126548
- var fs9 = __toESM(require("fs"), 1);
126549
- var path9 = __toESM(require("path"), 1);
126547
+ var fs9 = __toESM(require("fs"));
126548
+ var path9 = __toESM(require("path"));
126550
126549
  function registerFirewall(program3) {
126551
126550
  program3.command("firewall").description("Test input against LLM firewall rules").argument("<input>", "Input text to check (or - for stdin, @file for file)").option("--rules <file>", "Custom firewall rules JSON file").option("--json", "Output as JSON", false).action(async (input, opts) => {
126552
126551
  const { checkFirewall: checkFirewall2, DEFAULT_FIREWALL_RULES: DEFAULT_FIREWALL_RULES2 } = await Promise.resolve().then(() => (init_src(), src_exports));
@@ -126592,8 +126591,8 @@ function registerFirewall(program3) {
126592
126591
  }
126593
126592
 
126594
126593
  // src/commands/watch.ts
126595
- var fs10 = __toESM(require("fs"), 1);
126596
- var path10 = __toESM(require("path"), 1);
126594
+ var fs10 = __toESM(require("fs"));
126595
+ var path10 = __toESM(require("path"));
126597
126596
  function registerWatch(program3) {
126598
126597
  program3.command("watch").description("Watch eval config and re-run on changes").argument("<file>", "Path to eval config JSON file").option("--model <model>", "Override model").option("--provider <provider>", "Override provider").option("--debounce <ms>", "Debounce interval in ms", "1000").action(async (file, opts) => {
126599
126598
  const filePath = path10.resolve(file);
@@ -126670,9 +126669,9 @@ function registerWatch(program3) {
126670
126669
  }
126671
126670
 
126672
126671
  // src/commands/gate.ts
126673
- var import_yaml3 = __toESM(require_dist(), 1);
126674
- var fs11 = __toESM(require("fs"), 1);
126675
- var path11 = __toESM(require("path"), 1);
126672
+ var import_yaml3 = __toESM(require_dist());
126673
+ var fs11 = __toESM(require("fs"));
126674
+ var path11 = __toESM(require("path"));
126676
126675
  function registerGate(program3) {
126677
126676
  program3.command("gate").description("CI/CD quality gate \u2014 block deploy if eval score is below threshold").option("-t, --threshold <number>", "Minimum pass rate (0.0-1.0) to allow deploy", "0.9").option("-c, --config <file>", "Path to eval config JSON/YAML file").option("-m, --model <model>", "Model to evaluate (default: gpt-4o-mini)", "gpt-4o-mini").option("-p, --provider <provider>", "Provider override").option("-s, --suite <name>", "Built-in test suite: faithfulness, safety, hallucination, general").option("--strict", "Fail on any single test failure (ignore threshold)", false).option("--json", "Output results as JSON for CI parsing", false).action(async (opts) => {
126678
126677
  const core = await Promise.resolve().then(() => (init_src(), src_exports));
@@ -126933,9 +126932,9 @@ function registerHistory(program3) {
126933
126932
  }
126934
126933
 
126935
126934
  // src/commands/compliance-check.ts
126936
- var fs12 = __toESM(require("fs"), 1);
126937
- var path12 = __toESM(require("path"), 1);
126938
- var os3 = __toESM(require("os"), 1);
126935
+ var fs12 = __toESM(require("fs"));
126936
+ var path12 = __toESM(require("path"));
126937
+ var os3 = __toESM(require("os"));
126939
126938
  var SUPPORTED_FRAMEWORKS = [
126940
126939
  "eu-ai-act",
126941
126940
  "hipaa",
@@ -127371,8 +127370,8 @@ function registerComplianceCheck(program3) {
127371
127370
  }
127372
127371
 
127373
127372
  // src/commands/import-promptfoo.ts
127374
- var fs13 = __toESM(require("fs"), 1);
127375
- var path13 = __toESM(require("path"), 1);
127373
+ var fs13 = __toESM(require("fs"));
127374
+ var path13 = __toESM(require("path"));
127376
127375
  var ASSERTION_MAP = {
127377
127376
  contains: "contains",
127378
127377
  "not-contains": "not-contains",
@@ -127449,7 +127448,7 @@ async function loadYaml(filePath) {
127449
127448
  return JSON.parse(content);
127450
127449
  } catch {
127451
127450
  try {
127452
- const yamlMod = await Promise.resolve().then(() => __toESM(require_dist(), 1));
127451
+ const yamlMod = await Promise.resolve().then(() => __toESM(require_dist()));
127453
127452
  const parse3 = yamlMod.parse ?? yamlMod.default?.parse;
127454
127453
  if (parse3) return parse3(content);
127455
127454
  } catch {
@@ -127611,7 +127610,7 @@ function registerShare(program3) {
127611
127610
  }
127612
127611
 
127613
127612
  // src/commands/export.ts
127614
- var fs14 = __toESM(require("fs"), 1);
127613
+ var fs14 = __toESM(require("fs"));
127615
127614
  init_store2();
127616
127615
  function toCSV(run) {
127617
127616
  const header = "id,type,name,model,provider,timestamp,passRate,score,maxScore,passed,failed,total,latencyMs";
@@ -127827,9 +127826,9 @@ function registerRetry(program3) {
127827
127826
  }
127828
127827
 
127829
127828
  // src/commands/debug.ts
127830
- var fs15 = __toESM(require("fs"), 1);
127831
- var path14 = __toESM(require("path"), 1);
127832
- var os4 = __toESM(require("os"), 1);
127829
+ var fs15 = __toESM(require("fs"));
127830
+ var path14 = __toESM(require("path"));
127831
+ var os4 = __toESM(require("os"));
127833
127832
  var CONFIG_DIR = path14.join(os4.homedir(), ".evalguard");
127834
127833
  var CONFIG_FILE = path14.join(CONFIG_DIR, "config.json");
127835
127834
  var PROVIDER_ENV_VARS = {
@@ -127953,9 +127952,9 @@ function registerDebug(program3) {
127953
127952
  }
127954
127953
 
127955
127954
  // src/commands/logs.ts
127956
- var fs16 = __toESM(require("fs"), 1);
127957
- var path15 = __toESM(require("path"), 1);
127958
- var os5 = __toESM(require("os"), 1);
127955
+ var fs16 = __toESM(require("fs"));
127956
+ var path15 = __toESM(require("path"));
127957
+ var os5 = __toESM(require("os"));
127959
127958
  var LOG_DIR = path15.join(os5.homedir(), ".evalguard", "logs");
127960
127959
  function getLogFiles(type) {
127961
127960
  if (!fs16.existsSync(LOG_DIR)) return [];
@@ -128085,10 +128084,10 @@ function registerLogs(program3) {
128085
128084
  }
128086
128085
 
128087
128086
  // src/commands/delete.ts
128088
- var fs17 = __toESM(require("fs"), 1);
128089
- var path16 = __toESM(require("path"), 1);
128090
- var os6 = __toESM(require("os"), 1);
128091
- var readline2 = __toESM(require("readline"), 1);
128087
+ var fs17 = __toESM(require("fs"));
128088
+ var path16 = __toESM(require("path"));
128089
+ var os6 = __toESM(require("os"));
128090
+ var readline2 = __toESM(require("readline"));
128092
128091
  var DB_DIR2 = path16.join(os6.homedir(), ".evalguard");
128093
128092
  var DB_FILE2 = path16.join(DB_DIR2, "results.json");
128094
128093
  function loadDb2() {
@@ -128178,8 +128177,8 @@ function registerDelete(program3) {
128178
128177
  }
128179
128178
 
128180
128179
  // src/commands/model-scan.ts
128181
- var fs18 = __toESM(require("fs"), 1);
128182
- var path17 = __toESM(require("path"), 1);
128180
+ var fs18 = __toESM(require("fs"));
128181
+ var path17 = __toESM(require("path"));
128183
128182
  var DANGEROUS_PICKLE_OPS = [
128184
128183
  { bytes: Buffer.from([82]), name: "REDUCE", severity: "critical", desc: "Calls arbitrary callable with args" },
128185
128184
  { bytes: Buffer.from([129]), name: "NEWOBJ", severity: "high", desc: "Creates new object instance" },
@@ -128423,8 +128422,7 @@ function registerModelScan(program3) {
128423
128422
  }
128424
128423
 
128425
128424
  // src/index.ts
128426
- var import_meta2 = {};
128427
- var require2 = (0, import_module.createRequire)(import_meta2.url);
128425
+ var require2 = (0, import_module.createRequire)(__filename);
128428
128426
  var pkg = require2("../package.json");
128429
128427
  var CONFIG_DIR2 = path18.join(os7.homedir(), ".evalguard");
128430
128428
  var CONFIG_FILE2 = path18.join(CONFIG_DIR2, "config.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evalguardai/cli",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "EvalGuard CLI - Run LLM evaluations and security scans from the command line",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.cjs",