cliprobe 1.7.0 → 1.7.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 (2) hide show
  1. package/README.md +36 -17
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -31,13 +31,18 @@ npx cliprobe -- tsx
31
31
  ```
32
32
 
33
33
  ```
34
- cliprobe 1.4.3: closed-pipe, color, pipe-escapes, stdin, ctrl-c, sigterm, restore, control-chars checks for tsx
34
+ cliprobe 1.7.0: closed-pipe, write-error, color, pipe-escapes, stdin, ctrl-c, sigterm, restore, control-chars checks for tsx
35
35
 
36
36
  closed-pipe
37
37
  FAIL tsx --version crashed when stdout was closed (exit 0 -> 1)
38
38
  Error: write EPIPE (at node_modules/tsx/dist/cli.mjs:53:36962)
39
39
  PASS tsx --help exited quietly
40
40
 
41
+ write-error
42
+ WARN tsx --version crashed with a stack trace when a write to stdout failed (exit 1)
43
+ Error: ENOSPC: no space left on device, write (at node_modules/tsx/dist/cli.mjs:53:36962)
44
+ WARN tsx --help exited 0 though every write to stdout failed (no space left on device), so `> file` on a full disk looks like success
45
+
41
46
  color
42
47
  PASS tsx --version no color in a pipe or in a terminal
43
48
  FAIL tsx --help printed color codes into a pipe
@@ -64,10 +69,10 @@ restore
64
69
  control-chars
65
70
  SKIP tsx no {fixture} in the arguments; add a probe that takes a path, e.g. --probe "ls {fixture}"
66
71
 
67
- 2 failed, 0 warned, 8 passed, 3 skipped
72
+ 2 failed, 2 warned, 8 passed, 3 skipped
68
73
  ```
69
74
 
70
- <sub>tsx 4.23.15, run offline in a container in November 2026.</sub>
75
+ <sub>tsx 4.23.15 on Linux, run offline in a container in December 2026. On macOS, write-error is skipped.</sub>
71
76
 
72
77
  ## Why cliprobe?
73
78
 
@@ -101,7 +106,7 @@ The other checks cover the rest of what goes wrong between a program and the thi
101
106
 
102
107
  ## Installation
103
108
 
104
- Requires Node.js 22.12 or later, on macOS or Linux (including Alpine). Windows isn't supported yet. The terminal checks (color, restore and control-chars) also need the system's `script` command, which macOS has and most Linux distributions install by default. Without it they're skipped, and each skip says so. If it's missing, install the package that has it: `bsdutils` on Debian and Ubuntu, `util-linux-script` on Fedora, `util-linux-misc` on Alpine.
109
+ Requires Node.js 22.12 or later, on macOS or Linux (including Alpine). Windows isn't supported yet. The terminal checks (color, restore and control-chars) also need the system's `script` command, which macOS has and most Linux distributions install by default. Without it they're skipped, and each skip says so. If it's missing, install the package that has it: `bsdutils` on Debian and Ubuntu, `util-linux-script` on Fedora, `util-linux-misc` on Alpine. The write-error check needs Linux's `/dev/full`, so it's skipped on macOS.
105
110
 
106
111
  Run it without installing:
107
112
 
@@ -156,11 +161,13 @@ A probe runs `<command>` with its own args, in place of the args after the comma
156
161
  | `1` | A check failed, or warned with `--strict` |
157
162
  | `2` | Usage error, the command could not run, or the report could not be written (to stdout or the `--output-file`) |
158
163
 
159
- A command that can't run is reported once, before any check runs, with exit `2` and no report: one that isn't on `PATH`, a directory, a file without the execute bit (`chmod +x`), or a script whose `#!` interpreter is missing. A file this system can't execute at all, such as a binary built for another platform, makes every check say could-not-run (`ERROR`), so cliprobe exits `2` there too; on Linux, where `/bin/sh` tries such a file as a script, cliprobe recognizes the shell's complaint. An `--output-file` path that can't be written, such as a directory or a folder without write permission, is also reported before any check runs, with exit `2`. If the file still can't be written at the end, cliprobe prints the human report first, so no result is lost, then the error, and exits `2` even when a check failed: CI fails the step either way. That makes cliprobe usable as a CI gate.
164
+ Any non-zero exit fails a CI step, so cliprobe works as a gate.
165
+
166
+ A command that can't run is reported once, before any check runs, with exit `2` and no report: one that isn't on `PATH`, a directory, a file without the execute bit (`chmod +x`), or a script whose `#!` interpreter is missing. A file this system can't execute at all, such as a binary built for another platform, makes every check say could-not-run (`ERROR`), so cliprobe exits `2` there too; on Linux, where `/bin/sh` tries such a file as a script, cliprobe recognizes the shell's complaint. An `--output-file` path that can't be written, such as a directory or a folder without write permission, is also reported before any check runs, with exit `2`. If the file still can't be written at the end, cliprobe prints the human report first, so no result is lost, then the error, and exits `2` even when a check failed: CI fails the step either way.
160
167
 
161
168
  ## In CI
162
169
 
163
- 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. Add `--probe` for a command that keeps running and one with `{fixture}`, so a single step covers every check. In GitHub Actions, write a Markdown report to the job summary while the log keeps the human report:
170
+ 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. Add `--probe` for a command that keeps running and one with `{fixture}`, so a single step covers every check. Use a Linux runner, where write-error also runs. In GitHub Actions, write a Markdown report to the job summary while the log keeps the human report:
164
171
 
165
172
  ```yaml
166
173
  - name: Check the CLI for terminal-edge bugs
@@ -188,7 +195,7 @@ In JUnit, each check is a test suite and each probe a test case: `FAIL` is a fai
188
195
  {
189
196
  "tool": "cliprobe",
190
197
  "schemaVersion": 1,
191
- "version": "1.0.0",
198
+ "version": "1.7.0",
192
199
  "command": "node",
193
200
  "checks": ["ctrl-c"],
194
201
  "strict": false,
@@ -204,6 +211,7 @@ In JUnit, each check is a test suite and each probe a test case: `FAIL` is a fai
204
211
  "exitedAfterMs": null,
205
212
  "exitCode": null,
206
213
  "signal": "SIGKILL",
214
+ "leftRunning": [],
207
215
  "stderrAfter": ""
208
216
  }
209
217
  }
@@ -219,7 +227,7 @@ From 1.0, cliprobe follows semantic versioning, and these hold for every 1.x rel
219
227
 
220
228
  - **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.
221
229
  - **Names and exit codes.** Check names, verdicts, options and exit codes stay as they are.
222
- - **`--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.
230
+ - **`--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.7.0`) if that matters, or `--skip` the check.
223
231
  - **JSON.** `schemaVersion` stays `1`. Fields are only added, never removed, renamed or given a new type.
224
232
  - **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.
225
233
 
@@ -264,12 +272,12 @@ The check is new in 1.7 and only warns: it never fails before a census of real t
264
272
 
265
273
  cliprobe runs the command up to three times: into a pipe, under a real terminal (a pseudo-terminal through the system's `script` command, 80×24), and under a terminal with `NO_COLOR=1`. Every run gets `TERM=xterm-256color` and no `CI` variable, so a program can't pass just because the terminal type looks colorless, and color libraries that force color in CI don't fail it. Color codes in piped output end up in log files and agent transcripts as `\x1b[31m` noise. Results:
266
274
 
267
- | Verdict | Meaning |
268
- | ------- | ----------------------------------------------------------------------------------------------------------- |
269
- | `PASS` | No color in a pipe; in a terminal, either no color at all or color that `NO_COLOR` turns off |
270
- | `FAIL` | Printed color or style codes (bold counts, a bare reset doesn't) to stdout in a pipe |
271
- | `WARN` | Printed color to stderr in a pipe, or kept printing color under `NO_COLOR` |
272
- | `SKIP` | Printed nothing, waited for input in a terminal, or no `script` command (see [Installation](#installation)) |
275
+ | Verdict | Meaning |
276
+ | ------- | ------------------------------------------------------------------------------------------------------------- |
277
+ | `PASS` | No color in a pipe; in a terminal, either no color at all or color that `NO_COLOR` turns off |
278
+ | `FAIL` | Printed color or style codes (bold counts, a bare reset doesn't) to stdout in a pipe |
279
+ | `WARN` | Printed color to stderr in a pipe, or kept printing color under `NO_COLOR` |
280
+ | `SKIP` | Printed nothing, kept running or waited for input, or no `script` command (see [Installation](#installation)) |
273
281
 
274
282
  Many classic tools (git, BSD `ls` and `grep`) color correctly but don't implement [`NO_COLOR`](https://no-color.org), so they get a `WARN`, never a `FAIL`. Probe a command that prints color in normal use: almost no CLI colors its `--help`.
275
283
 
@@ -338,7 +346,7 @@ Spinners, prompts and full-screen programs switch terminal modes on: they hide t
338
346
  | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
339
347
  | `PASS` | Left no mode switched on, either because it never switched one or because it switched each back off (or reset the terminal), and left the terminal's settings as it found them |
340
348
  | `WARN` | Left one or more on, or switched a setting off and left it off (raw mode); the evidence quotes each sequence that was never undone and its line, and the settings as `stty` flags such as `-icanon -echo` |
341
- | `SKIP` | Still running 3 seconds after Ctrl-C (REPLs quit on a second one), more than 1 MiB of output, or no usable `script` command |
349
+ | `SKIP` | Still running 3 seconds after Ctrl-C (REPLs quit on a second one), `--version` or `--help` waited for input, more than 1 MiB of output, or no usable `script` command |
342
350
 
343
351
  It only warns: a terminal left in the wrong mode is a nuisance you can undo, not a failure of the program's job. Across the top 100 npm CLIs, their watch modes and servers, and popular prompt and spinner libraries (about 300 runs), nothing warned falsely, and one tool really did break the terminal: `taze -I` turns line wrapping off for its progress bars and leaves it off after Ctrl-C.
344
352
 
@@ -460,7 +468,16 @@ Then ask in your own words, for example "check my CLI for pipe and Ctrl-C bugs b
460
468
 
461
469
  ## Safety
462
470
 
463
- cliprobe runs the target in your current directory without a shell, with stdin closed (`/dev/null`; the stdin, ctrl-c and sigterm checks use a pipe that they never write to), a temporary `HOME`, and a minimal environment (no tokens from your shell; see [the probe's environment](#the-probes-environment)). It still executes the program, so only probe programs you trust. By default cliprobe passes only the arguments you give, after the command or with `--probe`, or `--version` and `--help`, or none with `--bare`; only the baseline check, when you name it, adds an unknown flag. The only input it ever sends is Ctrl-C, from the ctrl-c and restore checks, and SIGTERM, from the sigterm check, to probes you write. It kills each run's whole process group on timeout, including under a pseudo-terminal, and when a program exits it kills whatever it left running, in its group or started in another one, in every check. If cliprobe itself is stopped by Ctrl-C, SIGTERM or SIGHUP, it first kills the probe it is running and removes its temporary directories and any half-written report file, then exits by the same signal (130, 143 or 129). It runs on macOS and Linux, including Alpine; the terminal checks need the `script` command (see [Installation](#installation)). Windows isn't supported yet.
471
+ cliprobe executes the program you name, so only probe programs you trust. It limits what a probe can touch and cleans up after it:
472
+
473
+ - **No shell.** The target runs in your current directory, started directly.
474
+ - **A minimal environment.** A temporary `HOME` and no tokens from your shell; see [the probe's environment](#the-probes-environment).
475
+ - **Only your arguments.** cliprobe passes the arguments you give, after the command or with `--probe`, or `--version` and `--help`, or none with `--bare`. Only the baseline check, when you name it, adds an unknown flag.
476
+ - **No input.** stdin is closed (`/dev/null`); the stdin, ctrl-c and sigterm checks use a pipe that they never write to. The only input cliprobe ever sends is Ctrl-C, from the ctrl-c and restore checks, and SIGTERM, from the sigterm check, to probes you write.
477
+ - **Nothing left running.** It kills each run's whole process group on timeout, including under a pseudo-terminal. When a program exits, it kills whatever the program left running, in its group or started in another one, in every check.
478
+ - **Clean when interrupted.** If cliprobe itself is stopped by Ctrl-C, SIGTERM or SIGHUP, it first kills the probe it is running and removes its temporary directories and any half-written report file, then exits by the same signal (130, 143 or 129).
479
+
480
+ It runs on macOS and Linux, including Alpine; the terminal checks need the `script` command (see [Installation](#installation)). Windows isn't supported yet.
464
481
 
465
482
  ### The probe's environment
466
483
 
@@ -484,7 +501,9 @@ The runs under a terminal are color's second and third, restore's, and control-c
484
501
 
485
502
  **Why were ctrl-c, sigterm and control-chars skipped?** They need probes that a plain `--version` and `--help` run doesn't have: ctrl-c and sigterm need a command that keeps running, such as a server or a watcher, and control-chars needs one that prints file names from `{fixture}`. Add them with `--probe`, so one run covers every check: `npx cliprobe --probe "serve --port 0" --probe "list {fixture}" -- my-cli`. If the reason adds that the probe exited with a failure code, it never ran as intended: check its arguments, and with `-- node ./cli.js`, name the script in the probe (`--probe "./cli.js serve"`).
486
503
 
487
- **My program works when I run it, so why does a check fail?** cliprobe sets up conditions that are rare by hand: stdout closed before the program starts, output into a pipe, stdin that nobody writes to, a minimal environment. Reproduce the failure the way the check's section shows, for example `my-cli --help | head -n 1` for closed-pipe or `my-cli --help | cat -v` for color, and read the evidence in `--json`. If you still believe the verdict is wrong, [open a wrong verdict issue](https://github.com/KhaledSaeed18/cliprobe/issues/new?template=wrong_verdict.yml).
504
+ **Why was write-error skipped?** It needs `/dev/full`, which only Linux has, so on macOS every probe is skipped. Run cliprobe in CI on a Linux runner or in a container to get its verdict. It is also skipped for a probe that writes nothing to stdout.
505
+
506
+ **My program works when I run it, so why does a check fail?** cliprobe sets up conditions that are rare by hand: stdout closed before the program starts, a full disk, output into a pipe, stdin that nobody writes to, a minimal environment. Reproduce the failure the way the check's section shows, for example `my-cli --help | head -n 1` for closed-pipe or `my-cli --help | cat -v` for color, and read the evidence in `--json`. If you still believe the verdict is wrong, [open a wrong verdict issue](https://github.com/KhaledSaeed18/cliprobe/issues/new?template=wrong_verdict.yml).
488
507
 
489
508
  **Why does my program behave differently under cliprobe?** It runs without your shell's variables or your home directory, with `TERM=dumb` and `CI=1` in most checks: [the probe's environment](#the-probes-environment) lists every variable. A program that needs a token or a config file from your home directory sees neither, as on a fresh CI runner.
490
509
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cliprobe",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Black-box test any command-line program for terminal-edge bugs: crashes on a closed pipe (| head), output lost on a full disk while exiting 0, 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": {