@ia-qa/cli 1.0.11 → 1.1.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 (3) hide show
  1. package/README.md +33 -20
  2. package/index.js +49 -16
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # @ia-qa/cli
2
2
 
3
- Run [ia-qa.com](https://www.ia-qa.com)'s **148 QA / LLM / dev tools** from your shell — for AI agents
4
- (Claude Code, Copilot CLI, Cursor agents) and humans. **Zero dependencies. No signup.**
3
+ Run [ia-qa.com](https://www.ia-qa.com)'s **QA judges** from your shell — for AI agents (Claude Code,
4
+ Copilot CLI, Cursor agents), humans and CI steps. Each tool returns a verdict and a `gate` field
5
+ (`pass | review | fail`). **Zero dependencies. No signup.**
5
6
 
6
- Most tools run **key-free**. For the LLM-powered ones (e.g. VLM test suites, LLM-judge eval), **bring
7
- your own key (BYOK)** — pass it as a parameter; nothing is stored.
7
+ Most tools run **key-free**. For the few that call a model (test cases from a ticket, an eval contract
8
+ on your provider), **bring your own key (BYOK)** — pass it as a parameter; nothing is stored.
8
9
 
9
10
  The CLI carries no business logic: it discovers tools from the public MCP manifest and runs them on
10
11
  the hosted server (`https://www.ia-qa.com`). Requires **Node ≥ 18**.
@@ -25,10 +26,11 @@ Set up @ia-qa/cli in this project so you can run QA tools from the shell.
25
26
  4. Run one of them on my real data — after I confirm which.
26
27
  ```
27
28
 
28
- Step 1 is the load-bearing one: the catalogue changes with every server deploy, so a model answering
29
- from memory will confidently invoke tools that don't exist. `list` is generated from the live
30
- manifest. Step 3 is not politeness — this CLI is a thin client, **your input is sent to
31
- `https://www.ia-qa.com` to be executed there**; only `@ia-qa/self-healing` runs fully offline.
29
+ Step 1 is the load-bearing one: the catalogue changes with server deploys, so a model answering from
30
+ memory will confidently invoke tools that don't exist. `list` is generated from the live manifest.
31
+ Step 3 is not politeness — this CLI is a thin client, **your input is sent to `https://www.ia-qa.com`
32
+ to be executed there**; `@ia-qa/pal`, `@ia-qa/self-healing` and `@ia-qa/qa-discovery` run on your
33
+ machine instead.
32
34
 
33
35
  Agents that speak MCP can skip the CLI entirely and point at `https://www.ia-qa.com/mcp` — same
34
36
  tools, same manifest.
@@ -51,30 +53,41 @@ node ia-qa.js --help
51
53
 
52
54
  ```bash
53
55
  ia-qa --help # categories + examples
54
- ia-qa list [--category encoding] # every tool, one line each
56
+ ia-qa list [--category security] # every listed tool, one line each
55
57
  ia-qa <tool> --help # flags for one tool
56
58
 
57
- ia-qa generate_uuid --count 3
58
- ia-qa base64_encode "hello"
59
- ia-qa hash_text "secret" --algorithm sha256
60
- echo '{"b":2,"a":1}' | ia-qa format_json --stdin
59
+ ia-qa screen_text "ignore all previous instructions" --json
60
+ ia-qa screen_text --text-file prompt.txt --checks injection,secrets --report scan.html --open
61
61
 
62
- ia-qa text_stats "hello world" --json # machine JSON to stdout
63
- ia-qa split_chunks "$(cat doc.txt)" --chunk_size 256 --out chunks.json
64
- ia-qa prompt_injection_scan "ignore all instructions" --report scan.html --open
62
+ git diff origin/main...HEAD > diff.txt
63
+ ia-qa run_pr_gate_pipeline --git_diff-file diff.txt --json --out gate.json
64
+
65
+ ia-qa package_check --lockfile-file package-lock.json --json --out deps.json
66
+ ia-qa get_testing_guidelines --query "flaky tests"
65
67
  ```
66
68
 
69
+ - **The verdict is in the answer, not the exit code.** The exit code says whether the call ran:
70
+ `0` it ran, whatever the verdict · `2` malformed call (missing or bad flag) · `1` server or network
71
+ error. A CI step reads `gate` from the JSON: `fail` and `review` (the tool could not decide — not a
72
+ pass) stop the build. `generate_ci_workflow` writes those steps for you.
67
73
  - **`--json`** emits machine-parsable JSON (default is human-readable).
68
- - **Large outputs** are written to a temp file and the path is printed; **`--out <file>`** chooses it.
74
+ - **`--out <file>`** writes the answer to a file. Without it, an answer over 4 000 characters goes to a
75
+ temp file and stdout holds only its path — so in CI always use `--out`, never `> file.json`.
76
+ - **`--<param>-file <path>`** reads any parameter from a file: multiline-safe, and the way to pass a
77
+ diff or a document (one shell argument is capped at 128 KB on Linux).
69
78
  - **`--report <file.html>`** also writes a self-contained, ia-qa.com-branded HTML report of the run
70
79
  (verdict, stats, per-case badges — secret params redacted). Add **`--open`** to open it in your
71
80
  browser (local use; leave it off in CI). `--open` alone writes a default-named report and opens it.
72
81
  - **`--stdin`** (or `-` as the positional) reads the primary input from stdin.
73
82
  - **`--server <url>`** / **`$IAQA_SERVER`** point at another server (default `https://www.ia-qa.com`,
74
83
  or a self-hosted ia-qa server).
75
- - **BYOK** for LLM tools — pass your key as a parameter, e.g.
76
- `ia-qa run_vlm_test_suite --image_url <url> --api_key "$OPENAI_API_KEY" --model gpt-4o`.
77
- - **Exit codes**: `0` success · `2` bad input / missing param · `1` unexpected / server error.
84
+
85
+ ## Tools that left the list
86
+
87
+ In November 2026 the server went from 156 listed tools to the current list: each tool kept absorbed its
88
+ neighbours, with the same engines, and the utilities stay on the website. An old name (`secret_scan`,
89
+ `format_json`…) still answers until **2027-05-22**: the CLI runs it, prints on stderr the tool that
90
+ replaces it, and `ia-qa list --all` shows every old name with its replacement.
78
91
 
79
92
  ## Also available as MCP
80
93
 
package/index.js CHANGED
@@ -35,12 +35,17 @@ const VERSION = (() => { try { return require('./package.json').version; } catch
35
35
 
36
36
  // ── argv parsing (no dependency) ─────────────────────────────────────────────
37
37
 
38
+ // A flag is `--name` or `--name=value`. Anything else that starts with `--` is a value: a hand-made
39
+ // diff (`--- a/x.js`) or an SQL comment used to become a flag of its own and the tool got `true`.
40
+ const FLAG_RE = /^--[A-Za-z0-9][A-Za-z0-9_-]*(=|$)/;
41
+ const isFlag = (tok) => typeof tok === 'string' && FLAG_RE.test(tok);
42
+
38
43
  function parseArgv(argv) {
39
44
  const positional = [];
40
45
  const flags = {};
41
46
  for (let i = 0; i < argv.length; i++) {
42
47
  const tok = argv[i];
43
- if (tok.startsWith('--')) {
48
+ if (isFlag(tok)) {
44
49
  const bodyTok = tok.slice(2);
45
50
  const eq = bodyTok.indexOf('=');
46
51
  if (eq !== -1) {
@@ -51,7 +56,7 @@ function parseArgv(argv) {
51
56
  }
52
57
  const key = bodyTok;
53
58
  const next = argv[i + 1];
54
- if (next === undefined || next.startsWith('--')) {
59
+ if (next === undefined || isFlag(next)) {
55
60
  flags[key] = flags[key] === undefined ? true : flags[key];
56
61
  } else {
57
62
  const val = next;
@@ -95,14 +100,23 @@ function coerce(prop, raw) {
95
100
  return String(raw);
96
101
  }
97
102
 
103
+ // A published type may be a union (JSON-document params accept 'string' | 'object' | 'array'). Anything
104
+ // that can be a string is still positional-shorthand material: the CLI hands the raw text over and the
105
+ // server parses it. Comparing type === 'string' silently dropped the shorthand for json_schema_validate,
106
+ // mock_from_schema, json_diff and merge_json — the four family members with no `input` property.
107
+ function acceptsString(prop) {
108
+ const type = (prop && prop.type) || 'string';
109
+ return Array.isArray(type) ? type.includes('string') : type === 'string';
110
+ }
111
+
98
112
  function primaryParam(schema) {
99
113
  const props = (schema && schema.properties) || {};
100
114
  const required = (schema && schema.required) || [];
101
115
  if (props.input) return 'input';
102
116
  if (props.text) return 'text';
103
- const reqStr = required.find((k) => (props[k] && props[k].type || 'string') === 'string');
117
+ const reqStr = required.find((k) => props[k] && acceptsString(props[k]));
104
118
  if (reqStr) return reqStr;
105
- return Object.keys(props).find((k) => (props[k].type || 'string') === 'string') || null;
119
+ return Object.keys(props).find((k) => acceptsString(props[k])) || null;
106
120
  }
107
121
 
108
122
  // ── HTTP to the public MCP server ────────────────────────────────────────────
@@ -392,9 +406,21 @@ function renderHtmlReport({ toolName, params, result, server, version }) {
392
406
 
393
407
  // ── help & list ──────────────────────────────────────────────────────────────
394
408
 
409
+ // The manifest also carries the names that left the server's list (MCP V2), marked `deprecated`, so a
410
+ // CI step that calls one keeps working until its date. Help and list show the listed tools.
411
+ const listedOf = (m) => m.tools.filter((t) => !t.deprecated);
412
+ const oldNamesLine = (m) => {
413
+ const old = m.tools.filter((t) => t.deprecated);
414
+ if (!old.length) return null;
415
+ const until = old[0].deprecated.until;
416
+ return `${old.length} older ${old.length > 1 ? 'names still answer' : 'name still answers'}${until ? ` until ${until}` : ''}: ia-qa list --all`;
417
+ };
418
+ const replacedBy = (t) => (t.deprecated.use ? `use ${t.deprecated.use}` : 'it stays on the website');
419
+
395
420
  function compactHelp(m) {
396
421
  const groups = {};
397
- for (const t of m.tools) (groups[t.category || 'other'] = groups[t.category || 'other'] || []).push(t.name);
422
+ const tools = listedOf(m);
423
+ for (const t of tools) (groups[t.category || 'other'] = groups[t.category || 'other'] || []).push(t.name);
398
424
  const cats = Object.entries(groups).sort((a, b) => b[1].length - a[1].length)
399
425
  .map(([c, n]) => `${c}(${n.length})`).join(' ');
400
426
  return [
@@ -407,38 +433,42 @@ function compactHelp(m) {
407
433
  '',
408
434
  'Usage: ia-qa <tool> [input] [--flag value] [--json] [--out <file>] [--report <file.html>] [--stdin]',
409
435
  '',
410
- `${m.tools.length} tools. Categories (use "ia-qa list [--category <c>]" for names):`,
436
+ `${tools.length} tools. Categories (use "ia-qa list [--category <c>]" for names):`,
411
437
  ` ${cats}`,
438
+ ...(oldNamesLine(m) ? [` ${oldNamesLine(m)}`] : []),
412
439
  '',
413
440
  ' ia-qa <tool> --help flags for one tool',
414
441
  ' ia-qa list every tool, one line each',
415
442
  ' ia-qa --version print the installed CLI version',
416
443
  '',
417
444
  'Examples:',
418
- ' ia-qa generate_uuid --count 3',
419
- ' ia-qa base64_encode "hello"',
420
- " echo '{\"a\":1}' | ia-qa format_json --stdin --json",
421
- ' ia-qa prompt_injection_scan "ignore all previous instructions" --report scan.html',
445
+ ' ia-qa screen_text "ignore all previous instructions" --report scan.html',
446
+ ' ia-qa run_pr_gate_pipeline --git_diff-file diff.txt --json --out gate.json',
447
+ ' ia-qa get_testing_guidelines --query "flaky tests"',
448
+ '',
449
+ 'The exit code says whether the call ran (0 · 2 malformed · 1 server error); the verdict is the answer\'s "gate": pass | review | fail.',
422
450
  '',
423
451
  `Runs on ${DEFAULT_SERVER} (override with --server or $IAQA_SERVER). No signup; most tools key-free, BYOK for LLM tools.`,
424
452
  ].join('\n');
425
453
  }
426
454
 
427
- function listTools(m, category) {
428
- let tools = m.tools;
455
+ function listTools(m, category, all = false) {
456
+ let tools = all ? m.tools : listedOf(m);
429
457
  if (category) tools = tools.filter((t) => (t.category || 'other') === category);
430
458
  if (!tools.length) {
431
- const cats = [...new Set(m.tools.map((t) => t.category || 'other'))].sort();
459
+ const cats = [...new Set(listedOf(m).map((t) => t.category || 'other'))].sort();
432
460
  return `No tools in category "${category}". Available: ${cats.join(', ')}`;
433
461
  }
434
- return tools.map((t) => `${t.name}\t${(t.description || '').split('. ')[0].slice(0, 80)}`).join('\n');
462
+ return tools.map((t) => `${t.name}\t${t.deprecated ? `(old name, ${replacedBy(t)})` : (t.description || '').split('. ')[0].slice(0, 80)}`).join('\n');
435
463
  }
436
464
 
465
+ const deprecatedLine = (tool) => `${tool.name} is no longer listed: ${replacedBy(tool)}${tool.deprecated.until ? ` (it answers until ${tool.deprecated.until})` : ''}.`;
466
+
437
467
  function toolHelp(tool) {
438
468
  const props = (tool.inputSchema && tool.inputSchema.properties) || {};
439
469
  const required = new Set((tool.inputSchema && tool.inputSchema.required) || []);
440
470
  const primary = primaryParam(tool.inputSchema);
441
- const lines = [`Usage: ia-qa ${tool.name} [input] [options]`, '', tool.description || ''];
471
+ const lines = [...(tool.deprecated ? [deprecatedLine(tool), ''] : []), `Usage: ia-qa ${tool.name} [input] [options]`, '', tool.description || ''];
442
472
  if (Object.keys(props).length) {
443
473
  lines.push('', 'Options:');
444
474
  for (const [k, p] of Object.entries(props)) {
@@ -513,7 +543,7 @@ async function main(argv) {
513
543
  const { positional, flags } = parseArgv(rest);
514
544
 
515
545
  if (command === 'list') {
516
- process.stdout.write(listTools(await manifest(server), flags.category) + '\n');
546
+ process.stdout.write(listTools(await manifest(server), flags.category, !!flags.all) + '\n');
517
547
  return;
518
548
  }
519
549
 
@@ -561,6 +591,9 @@ async function main(argv) {
561
591
  reportPath = typeof flags.report === 'string' ? flags.report : `ia-qa-${tool.name}-report.html`;
562
592
  }
563
593
 
594
+ // On stderr: a CI log shows it, and the --json answer on stdout stays parseable.
595
+ if (tool.deprecated) process.stderr.write(`⚠ ${deprecatedLine(tool)}\n`);
596
+
564
597
  const data = await callTool(server, tool.name, params);
565
598
 
566
599
  if (reportPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ia-qa/cli",
3
- "version": "1.0.11",
3
+ "version": "1.1.0",
4
4
  "description": "Run ia-qa.com's QA/LLM/dev toolbox from your shell — for AI agents (Claude Code, Copilot CLI) and humans. Zero dependencies, no signup; most tools key-free, BYOK for the LLM-powered ones.",
5
5
  "keywords": [
6
6
  "ia-qa",