cliprobe 1.0.0 → 1.1.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/README.md CHANGED
@@ -27,51 +27,53 @@
27
27
  ---
28
28
 
29
29
  ```sh
30
- npx cliprobe -- esbuild
30
+ npx cliprobe -- tsx
31
31
  ```
32
32
 
33
33
  ```
34
- cliprobe 1.0.0: closed-pipe, color, pipe-escapes, stdin, ctrl-c, sigterm, restore, control-chars checks for esbuild
34
+ cliprobe 1.1.0: closed-pipe, color, pipe-escapes, stdin, ctrl-c, sigterm, restore, control-chars checks for tsx
35
35
 
36
36
  closed-pipe
37
- FAIL esbuild --version crashed when stdout was closed (exit 0 -> 1)
38
- Error: Command failed: .../esbuild --version (at node_modules/esbuild/bin/esbuild:222:28)
39
- FAIL esbuild --help crashed when stdout was closed (exit 0 -> 1)
40
- Error: Command failed: .../esbuild --help (at node_modules/esbuild/bin/esbuild:222:28)
37
+ FAIL tsx --version crashed when stdout was closed (exit 0 -> 1)
38
+ Error: write EPIPE (at node_modules/tsx/dist/cli.mjs:53:36962)
39
+ PASS tsx --help exited quietly
41
40
 
42
41
  color
43
- PASS esbuild --version no color in a pipe or in a terminal
44
- PASS esbuild --help colors only in a terminal, and NO_COLOR turns it off
42
+ PASS tsx --version no color in a pipe or in a terminal
43
+ FAIL tsx --help printed color codes into a pipe
44
+ stdout line 5: \x1b[1mUsage:\x1b[22m
45
45
 
46
46
  pipe-escapes
47
- PASS esbuild --version no cursor, erase, hyperlink, title or redraw codes in a pipe
48
- PASS esbuild --help no cursor, erase, hyperlink, title or redraw codes in a pipe
47
+ PASS tsx --version no cursor, erase, hyperlink, title or redraw codes in a pipe
48
+ PASS tsx --help no cursor, erase, hyperlink, title or redraw codes in a pipe
49
49
 
50
50
  stdin
51
- PASS esbuild --version finished without waiting for stdin
52
- PASS esbuild --help finished without waiting for stdin
51
+ PASS tsx --version finished without waiting for stdin
52
+ PASS tsx --help finished without waiting for stdin
53
53
 
54
54
  ctrl-c
55
- SKIP esbuild needs probe args that keep it running, such as a watch or serve command, or --bare
55
+ SKIP tsx needs probe args that keep it running, such as a watch or serve command, or --bare
56
56
 
57
57
  sigterm
58
- SKIP esbuild needs probe args that keep it running, such as a watch or serve command, or --bare
58
+ SKIP tsx needs probe args that keep it running, such as a watch or serve command, or --bare
59
59
 
60
60
  restore
61
- PASS esbuild --version left no terminal mode switched on when it exited
62
- PASS esbuild --help left no terminal mode switched on when it exited
61
+ PASS tsx --version left no terminal mode switched on when it exited
62
+ PASS tsx --help left no terminal mode switched on when it exited
63
63
 
64
64
  control-chars
65
- SKIP esbuild no {fixture} in the arguments; put it where the command takes a path, e.g. ls {fixture}
65
+ SKIP tsx no {fixture} in the arguments; put it where the command takes a path, e.g. ls {fixture}
66
66
 
67
67
  2 failed, 0 warned, 8 passed, 3 skipped
68
68
  ```
69
69
 
70
+ <sub>tsx 4.23.15, run offline in a container in November 2026.</sub>
71
+
70
72
  ## Why cliprobe?
71
73
 
72
74
  When a program's output goes into a reader that stops early (`| head`, `grep -q`, a closed agent pipe), its next write to stdout fails. A well-behaved program exits quietly. Many Node.js CLIs instead crash with `Error: write EPIPE`, a stack trace, and exit code 1. That breaks scripts running under `set -o pipefail` and confuses agents that read stderr.
73
75
 
74
- In a census of the 100 most-downloaded npm packages that ship a command (119 commands, run offline in a throwaway container), **9 crashed this way every time**: esbuild, browserslist, update-browserslist-db, autoprefixer, husky, tsconfck, ts-jest, rolldown, and tsx on `--version`. The best-known existing CLI auditor rated the first 8 as passing its SIGPIPE check. The same census found two commands that print color codes into a pipe (`giget --help`, `tsx --help`), five whose `--help` or `--version` waits for stdin (he, cssesc, ansi-html, webpack and webpack-dev-server), and no false failures: every `FAIL` reproduced by hand. (A census of `--help` and `--version` can't exercise ctrl-c, sigterm or control-chars, which need a command that keeps running or takes a path; their fixtures and real-tool tests are in `test/`.)
76
+ In a census of the 100 most-downloaded npm packages that ship a command (119 commands, run offline in a throwaway container), **9 crashed this way every time**: esbuild, browserslist, update-browserslist-db, autoprefixer, husky, tsconfck, ts-jest, rolldown, and tsx on `--version`. Since then esbuild and browserslist have fixed it; the other seven still crashed when re-checked at their November 2026 versions. The best-known existing CLI auditor rated the first 8 as passing its SIGPIPE check. The same census found two commands that print color codes into a pipe (`giget --help`, `tsx --help`), five whose `--help` or `--version` waits for stdin (he, cssesc, ansi-html, webpack and webpack-dev-server), and no false failures: every `FAIL` reproduced by hand. (A census of `--help` and `--version` can't exercise ctrl-c, sigterm or control-chars, which need a command that keeps running or takes a path; their fixtures and real-tool tests are in `test/`.)
75
77
 
76
78
  The other checks cover the rest of what goes wrong between a program and the thing reading it: color codes leaking into logs and agent transcripts, Ctrl-C that is ignored or ends in a stack trace, child processes left running after `kill` or `docker stop`, a terminal left with a hidden cursor or no line wrapping after Ctrl-C, and file names that can send escape sequences to your terminal.
77
79
 
@@ -120,12 +122,15 @@ npx cliprobe --format junit -o report.xml -- <command> # JUnit file for CI; hu
120
122
  npx cliprobe -- ls {fixture} # {fixture}: a directory of hostile file names
121
123
  npx cliprobe --bare -- htop # the command alone: a REPL, a full-screen program, a server
122
124
  npx cliprobe --check startup,baseline -- node ./dist/cli.js # info checks, only when named
125
+ npx cliprobe --strict --skip restore -- node ./dist/cli.js server # warnings fail too, except restore's
123
126
  ```
124
127
 
125
128
  | Option | Meaning |
126
129
  | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
127
130
  | `--bare` | Probe the command with no arguments instead of `--version` and `--help`, as a probe you wrote |
128
131
  | `--check <name>` | Run only this check; repeat it or use commas for several |
132
+ | `--skip <name>` | Leave this check out; repeat it or use commas for several |
133
+ | `--strict` | Exit 1 on a warning too, not only on a failure |
129
134
  | `--format <name>` | Output format: `human` (default), `json`, `markdown` (a GitHub job summary or PR comment) or `junit` (XML for CI test reports) |
130
135
  | `--json` | Same as `--format json` |
131
136
  | `-o`, `--output-file <path>` | Write the `--format` report to a file (atomically, creating parent folders); the human report still prints |
@@ -138,14 +143,14 @@ npx cliprobe --check startup,baseline -- node ./dist/cli.js # info checks, onl
138
143
  | Code | Meaning |
139
144
  | ---- | ----------------------------------------- |
140
145
  | `0` | No check failed |
141
- | `1` | A check failed |
146
+ | `1` | A check failed, or warned with `--strict` |
142
147
  | `2` | Usage error, or the command could not run |
143
148
 
144
149
  A command that isn't on `PATH` is reported once, before any check runs, with exit `2` and no report. That makes cliprobe usable as a CI gate.
145
150
 
146
151
  ## In CI
147
152
 
148
- A failed check exits 1, so the step fails. In GitHub Actions, write a Markdown report to the job summary while the log keeps the human report:
153
+ A failed check exits 1, so the step fails. Warnings don't fail it unless you add `--strict`; with `--strict`, `--skip` leaves out a check whose warning you accept. In GitHub Actions, write a Markdown report to the job summary while the log keeps the human report:
149
154
 
150
155
  ```yaml
151
156
  - name: Check the CLI for terminal-edge bugs
@@ -176,6 +181,7 @@ In JUnit, each check is a test suite and each probe a test case: `FAIL` is a fai
176
181
  "version": "1.0.0",
177
182
  "command": "node",
178
183
  "checks": ["ctrl-c"],
184
+ "strict": false,
179
185
  "summary": { "pass": 0, "fail": 1, "warn": 0, "skip": 0, "error": 0, "info": 0 },
180
186
  "results": [
181
187
  {
@@ -195,7 +201,7 @@ In JUnit, each check is a test suite and each probe a test case: `FAIL` is a fai
195
201
  }
196
202
  ```
197
203
 
198
- Every result has the same five fields: `check`, `invocation` (the command and arguments that ran), `verdict` (`pass`, `fail`, `warn`, `skip`, `error` for could-not-run, or `info`), `reason` (a sentence for a person) and `details`, plus `evidence` when there is a line to quote. `details` holds the check's own measurements, such as exit codes, timings, the terminal modes left on or the processes left running; the schema describes each check's. Text from the program under test is escaped: control characters, line separators and bidi overrides appear as `\u` escapes, so the report can't drive a terminal when printed.
204
+ `strict` says whether `--strict` was given (added in 1.1). Every result has the same five fields: `check`, `invocation` (the command and arguments that ran), `verdict` (`pass`, `fail`, `warn`, `skip`, `error` for could-not-run, or `info`), `reason` (a sentence for a person) and `details`, plus `evidence` when there is a line to quote. `details` holds the check's own measurements, such as exit codes, timings, the terminal modes left on or the processes left running; the schema describes each check's. Text from the program under test is escaped: control characters, line separators and bidi overrides appear as `\u` escapes, so the report can't drive a terminal when printed.
199
205
 
200
206
  ## Stability
201
207
 
@@ -203,6 +209,7 @@ From 1.0, cliprobe follows semantic versioning, and these hold for every 1.x rel
203
209
 
204
210
  - **No new failures.** A minor release never makes a passing or warning program fail. New checks, and new things an existing check notices, only warn until the next major release. So `cliprobe@1` in CI turns red only when your program changes.
205
211
  - **Names and exit codes.** Check names, verdicts, options and exit codes stay as they are.
212
+ - **`--strict` opts out of the first promise.** It fails on warnings, so a new warning in a minor release can fail your build. Pin an exact version (`cliprobe@1.1.0`) if that matters, or `--skip` the check.
206
213
  - **JSON.** `schemaVersion` stays `1`. Fields are only added, never removed, renamed or given a new type.
207
214
  - **Not covered.** The wording of `reason` and `evidence`, and the human and Markdown output, are for people and may change. Match on `check` and `verdict`, not on text.
208
215
 
package/dist/cli.js CHANGED
@@ -1787,19 +1787,15 @@ const CHECKS = [
1787
1787
  baselineCheck
1788
1788
  ];
1789
1789
  /**
1790
- * Picks checks by name, keeping registry order. No names selects every check of
1791
- * kind "check": info checks only run when named, because they never fail and
1792
- * baseline sends a flag the user did not ask for.
1790
+ * Picks checks by name, keeping registry order, then leaves out those in `skip`.
1791
+ * No names selects every check of kind "check": info checks only run when named,
1792
+ * because they never fail and baseline sends a flag the user did not ask for.
1793
1793
  */
1794
- function selectChecks(names) {
1795
- if (names.length === 0) return {
1796
- checks: CHECKS.filter((c) => c.kind === "check"),
1797
- unknown: []
1798
- };
1794
+ function selectChecks(names, skip = []) {
1799
1795
  const known = new Set(CHECKS.map((c) => c.name));
1800
1796
  return {
1801
- checks: CHECKS.filter((c) => names.includes(c.name)),
1802
- unknown: [...new Set(names.filter((n) => !known.has(n)))]
1797
+ checks: (names.length === 0 ? CHECKS.filter((c) => c.kind === "check") : CHECKS.filter((c) => names.includes(c.name))).filter((c) => !skip.includes(c.name)),
1798
+ unknown: [...new Set([...names, ...skip].filter((n) => !known.has(n)))]
1803
1799
  };
1804
1800
  }
1805
1801
  // src/core/safe.ts
@@ -1848,11 +1844,15 @@ function countVerdicts(results) {
1848
1844
  for (const r of results) counts[r.verdict]++;
1849
1845
  return counts;
1850
1846
  }
1851
- /** "2 failed, 0 warned, 2 passed, 2 skipped", plus info and could-not-run when present. */
1852
- function summaryLine(c) {
1847
+ /**
1848
+ * "2 failed, 0 warned, 2 passed, 2 skipped", plus info and could-not-run when
1849
+ * present, and a note when --strict makes warnings fail.
1850
+ */
1851
+ function summaryLine(c, strict = false) {
1853
1852
  const info = c.info ? `, ${c.info} info` : "";
1854
1853
  const errors = c.error ? `, ${c.error} could not run` : "";
1855
- return `${c.fail} failed, ${c.warn} warned, ${c.pass} passed, ${c.skip} skipped${info}${errors}`;
1854
+ const mode = strict ? " (--strict: warnings fail)" : "";
1855
+ return `${c.fail} failed, ${c.warn} warned, ${c.pass} passed, ${c.skip} skipped${info}${errors}${mode}`;
1856
1856
  }
1857
1857
  // src/report/human.ts
1858
1858
  const COLORS = {
@@ -1863,7 +1863,7 @@ const COLORS = {
1863
1863
  error: 35,
1864
1864
  info: 36
1865
1865
  };
1866
- function formatHuman({ version, command, checks, results }, { color }) {
1866
+ function formatHuman({ version, command, checks, strict, results }, { color }) {
1867
1867
  const paint = (verdict) => {
1868
1868
  const label = verdict.toUpperCase().padEnd(5);
1869
1869
  return color ? `\x1b[${COLORS[verdict]}m${label}\x1b[0m` : label;
@@ -1879,20 +1879,21 @@ function formatHuman({ version, command, checks, results }, { color }) {
1879
1879
  if (r.evidence) lines.push(` ${" ".repeat(5)} ${" ".repeat(width)} ${safe(r.evidence).slice(0, 200)}`);
1880
1880
  }
1881
1881
  }
1882
- lines.push("", summaryLine(countVerdicts(results)));
1882
+ lines.push("", summaryLine(countVerdicts(results), strict));
1883
1883
  return lines.join("\n") + "\n";
1884
1884
  }
1885
1885
  /**
1886
1886
  * The report as JSON. Each result keeps the fields every check shares at the top
1887
1887
  * and moves the check's own measurements into `details`.
1888
1888
  */
1889
- function formatJson({ version, command, checks, results }) {
1889
+ function formatJson({ version, command, checks, strict, results }) {
1890
1890
  return safeJson({
1891
1891
  tool: "cliprobe",
1892
1892
  schemaVersion: 1,
1893
1893
  version,
1894
1894
  command,
1895
1895
  checks,
1896
+ strict,
1896
1897
  summary: countVerdicts(results),
1897
1898
  results: results.map(({ check, invocation, verdict, reason, evidence, ...details }) => ({
1898
1899
  check,
@@ -1920,37 +1921,35 @@ const XML_ESCAPES = {
1920
1921
  function xml(text) {
1921
1922
  return safe(text).replace(/[&<>"']/g, (c) => XML_ESCAPES[c] ?? c);
1922
1923
  }
1923
- /** JUnit's count attributes for a suite or the whole run. */
1924
- function totals(results) {
1924
+ /** JUnit's count attributes for a suite or the whole run; with --strict, warnings are failures. */
1925
+ function totals(results, strict) {
1925
1926
  const c = countVerdicts(results);
1926
- return `tests="${results.length}" failures="${c.fail}" errors="${c.error}" skipped="${c.skip}"`;
1927
+ const failures = c.fail + (strict ? c.warn : 0);
1928
+ return `tests="${results.length}" failures="${failures}" errors="${c.error}" skipped="${c.skip}"`;
1927
1929
  }
1928
- function testcase(r) {
1930
+ function testcase(r, strict) {
1929
1931
  const open = ` <testcase classname="cliprobe.${xml(r.check)}" name="${xml(shellJoin(r.invocation))}"`;
1930
1932
  const message = `message="${xml(r.reason)}"`;
1931
1933
  const body = r.evidence ? xml(r.evidence) : "";
1932
- switch (r.verdict) {
1933
- case "fail": return `${open}>\n <failure ${message} type="fail">${body}</failure>\n </testcase>`;
1934
- case "error": return `${open}>\n <error ${message} type="error">${body}</error>\n </testcase>`;
1935
- case "skip": return `${open}>\n <skipped ${message}/>\n </testcase>`;
1936
- case "pass":
1937
- case "warn":
1938
- case "info": return `${open}>\n <system-out>${`${r.verdict.toUpperCase()}: ${xml(r.reason)}${r.evidence ? `\n${body}` : ""}`}</system-out>\n </testcase>`;
1939
- }
1934
+ const failure = (type) => `${open}>\n <failure ${message} type="${type}">${body}</failure>\n </testcase>`;
1935
+ if (r.verdict === "fail" || strict && r.verdict === "warn") return failure(r.verdict);
1936
+ if (r.verdict === "error") return `${open}>\n <error ${message} type="error">${body}</error>\n </testcase>`;
1937
+ if (r.verdict === "skip") return `${open}>\n <skipped ${message}/>\n </testcase>`;
1938
+ return `${open}>\n <system-out>${`${r.verdict.toUpperCase()}: ${xml(r.reason)}${r.evidence ? `\n${body}` : ""}`}</system-out>\n </testcase>`;
1940
1939
  }
1941
1940
  /** JUnit XML: one testsuite per check, one testcase per result. */
1942
- function formatJunit({ version, command, checks, results }) {
1941
+ function formatJunit({ version, command, checks, strict, results }) {
1943
1942
  const suites = checks.map((check) => {
1944
1943
  const own = results.filter((r) => r.check === check);
1945
1944
  return [
1946
- ` <testsuite name="${xml(check)}" ${totals(own)}>`,
1947
- ...own.map(testcase),
1945
+ ` <testsuite name="${xml(check)}" ${totals(own, strict)}>`,
1946
+ ...own.map((r) => testcase(r, strict)),
1948
1947
  " </testsuite>"
1949
1948
  ].join("\n");
1950
1949
  });
1951
1950
  return [
1952
1951
  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
1953
- `<testsuites name="cliprobe ${xml(version)}: ${xml(command)}" ${totals(results)}>`,
1952
+ `<testsuites name="cliprobe ${xml(version)}: ${xml(command)}" ${totals(results, strict)}>`,
1954
1953
  ...suites,
1955
1954
  "</testsuites>",
1956
1955
  ""
@@ -1977,8 +1976,8 @@ function code(text, { inTable }) {
1977
1976
  function prose(text) {
1978
1977
  return safe(text).replace(/[\\`*_[\]<>|~&]/g, (c) => `\\${c}`);
1979
1978
  }
1980
- function row(r) {
1981
- const verdict = r.verdict === "fail" || r.verdict === "error" ? `**${r.verdict.toUpperCase()}**` : r.verdict.toUpperCase();
1979
+ function row(r, strict) {
1980
+ const verdict = r.verdict === "fail" || r.verdict === "error" || strict && r.verdict === "warn" ? `**${r.verdict.toUpperCase()}**` : r.verdict.toUpperCase();
1982
1981
  const evidence = r.evidence ? `<br>${code(r.evidence.slice(0, 300), { inTable: true })}` : "";
1983
1982
  return `| ${[
1984
1983
  prose(r.check),
@@ -1988,15 +1987,15 @@ function row(r) {
1988
1987
  ].join(" | ")} |`;
1989
1988
  }
1990
1989
  /** GitHub-flavored Markdown, for a job summary ($GITHUB_STEP_SUMMARY) or a PR comment. */
1991
- function formatMarkdown({ version, command, results }) {
1990
+ function formatMarkdown({ version, command, strict, results }) {
1992
1991
  return [
1993
1992
  `## cliprobe ${version}: ${code(command, { inTable: false })}`,
1994
1993
  "",
1995
- summaryLine(countVerdicts(results)),
1994
+ summaryLine(countVerdicts(results), strict),
1996
1995
  "",
1997
1996
  "| Check | Verdict | Invocation | Result |",
1998
1997
  "| --- | --- | --- | --- |",
1999
- ...results.map(row),
1998
+ ...results.map((r) => row(r, strict)),
2000
1999
  ""
2001
2000
  ].join("\n");
2002
2001
  }
@@ -2057,6 +2056,8 @@ function parseArgs(argv) {
2057
2056
  help: false,
2058
2057
  version: false,
2059
2058
  checks: [],
2059
+ skip: [],
2060
+ strict: false,
2060
2061
  command: void 0,
2061
2062
  args: []
2062
2063
  };
@@ -2068,6 +2069,7 @@ function parseArgs(argv) {
2068
2069
  }
2069
2070
  if (a === "--json") opts.format = "json";
2070
2071
  else if (a === "--bare") opts.bare = true;
2072
+ else if (a === "--strict") opts.strict = true;
2071
2073
  else if (a === "-o" || a === "--output-file" || a.startsWith("--output-file=")) {
2072
2074
  const value = a.includes("=") ? a.slice(a.indexOf("=") + 1) : argv[++i];
2073
2075
  if (!value) throw new UsageError(`${a.split("=")[0] ?? a} needs a file path`);
@@ -2082,10 +2084,11 @@ function parseArgs(argv) {
2082
2084
  const value = a.includes("=") ? a.slice(a.indexOf("=") + 1) : argv[++i];
2083
2085
  opts.timeout = Number(value);
2084
2086
  if (!Number.isInteger(opts.timeout) || opts.timeout <= 0) throw new UsageError(`--timeout needs a positive whole number of milliseconds, got "${String(value)}"`);
2085
- } else if (a === "--check" || a.startsWith("--check=")) {
2087
+ } else if (/^--(check|skip)(=|$)/.test(a)) {
2088
+ const flag = a.split("=")[0] ?? a;
2086
2089
  const names = ((a.includes("=") ? a.slice(a.indexOf("=") + 1) : argv[++i]) ?? "").split(",").map((n) => n.trim()).filter(Boolean);
2087
- if (names.length === 0) throw new UsageError("--check needs a check name");
2088
- opts.checks.push(...names);
2090
+ if (names.length === 0) throw new UsageError(`${flag} needs a check name`);
2091
+ (flag === "--skip" ? opts.skip : opts.checks).push(...names);
2089
2092
  } else if (a.startsWith("-")) throw new UsageError(`unknown option "${a}"`);
2090
2093
  else {
2091
2094
  [opts.command, ...opts.args] = argv.slice(i);
@@ -2156,6 +2159,8 @@ Options:
2156
2159
  --bare Probe the command with no arguments (a REPL, a full-screen
2157
2160
  program, a server) instead of --version and --help
2158
2161
  --check <name> Run only this check; repeat it or use commas for several
2162
+ --skip <name> Leave this check out; repeat it or use commas for several
2163
+ --strict Exit 1 on a warning too, not only on a failure
2159
2164
  --format <name> Output format: human (default), json, markdown (a CI job
2160
2165
  summary or PR comment) or junit (XML for CI test reports)
2161
2166
  --json Same as --format json
@@ -2168,14 +2173,18 @@ Options:
2168
2173
  -h, --help Show this help
2169
2174
  -v, --version Show the version
2170
2175
 
2171
- Exit codes: 0 no failures, 1 a check failed, 2 usage error or could not run.
2176
+ Exit codes: 0 no failures, 1 a check failed (or warned, with --strict), 2 usage
2177
+ error or could not run.
2172
2178
  Runs the target in the current directory without a shell, with stdin closed
2173
2179
  (the stdin, ctrl-c and sigterm checks use a pipe they never write to), a
2174
2180
  temporary HOME and a minimal environment. Only run programs you trust.`;
2175
2181
  // src/cli/program.ts
2176
- /** 0 no failures, 1 a check failed, 2 nothing could be judged because something could not run. */
2177
- function exitCodeFor(results) {
2178
- if (results.some((r) => r.verdict === "fail")) return 1;
2182
+ /**
2183
+ * 0 no failures, 1 a check failed (or, with `strict`, warned), 2 nothing could be
2184
+ * judged because something could not run.
2185
+ */
2186
+ function exitCodeFor(results, strict = false) {
2187
+ if (results.some((r) => r.verdict === "fail" || strict && r.verdict === "warn")) return 1;
2179
2188
  if (!results.some((r) => r.verdict !== "error" && r.verdict !== "skip") && results.some((r) => r.verdict === "error")) return 2;
2180
2189
  return 0;
2181
2190
  }
@@ -2199,12 +2208,16 @@ async function run(argv, io) {
2199
2208
  out(VERSION + "\n");
2200
2209
  return 0;
2201
2210
  }
2202
- const { checks, unknown } = selectChecks(opts.checks);
2211
+ const { checks, unknown } = selectChecks(opts.checks, opts.skip);
2203
2212
  if (unknown.length) {
2204
2213
  const available = CHECKS.map((c) => c.name).join(", ");
2205
2214
  err(`cliprobe: unknown check ${unknown.map((n) => `"${n}"`).join(", ")} (available: ${available})\n`);
2206
2215
  return 2;
2207
2216
  }
2217
+ if (checks.length === 0) {
2218
+ err("cliprobe: --skip leaves no check to run\n");
2219
+ return 2;
2220
+ }
2208
2221
  if (!opts.command) {
2209
2222
  err("cliprobe: no command given\nUsage: cliprobe [options] -- <command> [args...]\n");
2210
2223
  return 2;
@@ -2239,6 +2252,7 @@ async function run(argv, io) {
2239
2252
  version: VERSION,
2240
2253
  command: opts.command,
2241
2254
  checks: checks.map((c) => c.name),
2255
+ strict: opts.strict,
2242
2256
  results: fixture ? collapseResults(results, fixture) : results
2243
2257
  };
2244
2258
  const { color } = io;
@@ -2252,7 +2266,7 @@ async function run(argv, io) {
2252
2266
  }
2253
2267
  out(FORMATS.human(report, { color }));
2254
2268
  } else out(FORMATS[opts.format](report, { color }));
2255
- return exitCodeFor(results);
2269
+ return exitCodeFor(results, opts.strict);
2256
2270
  }
2257
2271
  // src/cli/main.ts
2258
2272
  process.stdout.on("error", (error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cliprobe",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Black-box test any command-line program for terminal-edge bugs: crashes on a closed pipe (| head), color and control codes leaking into pipes, hangs waiting on stdin, broken Ctrl-C handling, child processes left running after SIGTERM, a terminal left broken after Ctrl-C, and control characters from file names reaching your terminal.",
5
5
  "type": "module",
6
6
  "bin": {
package/schema.json CHANGED
@@ -27,6 +27,10 @@
27
27
  },
28
28
  "description": "The checks that ran, in order."
29
29
  },
30
+ "strict": {
31
+ "type": "boolean",
32
+ "description": "Whether --strict was given, so warnings fail too (exit code 1). Added in 1.1; absent from earlier reports."
33
+ },
30
34
  "summary": {
31
35
  "type": "object",
32
36
  "description": "How many results have each verdict.",