cliprobe 1.2.1 → 1.3.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.
- package/README.md +29 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,7 +93,9 @@ The other checks cover the rest of what goes wrong between a program and the thi
|
|
|
93
93
|
- [Stability](#stability)
|
|
94
94
|
- [Checks](#checks): [closed-pipe](#closed-pipe), [color](#color), [pipe-escapes](#pipe-escapes), [stdin](#stdin), [ctrl-c](#ctrl-c), [sigterm](#sigterm), [restore](#restore), [control-chars](#control-chars), [info checks](#info-checks)
|
|
95
95
|
- [Fixing a failure in a Node.js CLI](#fixing-a-failure-in-a-nodejs-cli)
|
|
96
|
+
- [Agent skill](#agent-skill)
|
|
96
97
|
- [Safety](#safety)
|
|
98
|
+
- [FAQ](#faq)
|
|
97
99
|
- [Contributing](#contributing)
|
|
98
100
|
- [License](#license)
|
|
99
101
|
|
|
@@ -417,15 +419,41 @@ const shown = name.replace(
|
|
|
417
419
|
|
|
418
420
|
Also escape U+2028, U+2029 and the bidi controls (U+202A to U+202E, U+2066 to U+2069) if names may come from untrusted sources.
|
|
419
421
|
|
|
422
|
+
## Agent skill
|
|
423
|
+
|
|
424
|
+
An official [Agent Skill](https://agentskills.io) lets coding agents such as Claude Code, Codex, Gemini CLI and OpenCode use cliprobe on the CLIs they build or review: run every check with the right probes, report each failure with its evidence, propose the fix, and add a CI step. The agents run cliprobe and read its JSON report instead of guessing.
|
|
425
|
+
|
|
426
|
+
```sh
|
|
427
|
+
npx skills add KhaledSaeed18/cliprobe --skill cliprobe
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Then ask in your own words, for example "check my CLI for pipe and Ctrl-C bugs before I publish it". See [skills/README.md](https://github.com/KhaledSaeed18/cliprobe/blob/main/skills/README.md) for other ways to install it and the evals.
|
|
431
|
+
|
|
420
432
|
## Safety
|
|
421
433
|
|
|
422
434
|
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). 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 kills whatever a program leaves running in its group when it exits under the sigterm check. It runs on macOS and Linux, including Alpine; the terminal checks need the `script` command, which Alpine ships in `util-linux-misc`. Windows isn't supported yet.
|
|
423
435
|
|
|
436
|
+
## FAQ
|
|
437
|
+
|
|
438
|
+
**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`.
|
|
439
|
+
|
|
440
|
+
**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).
|
|
441
|
+
|
|
442
|
+
**Why does my program behave differently under cliprobe?** It runs without your shell's variables or your home directory: the environment has only `PATH`, `LANG`, `TERM`, `CI` and a temporary `HOME` and `TMPDIR`. A program that needs a token or a config file from your home directory sees neither, as on a fresh CI runner.
|
|
443
|
+
|
|
444
|
+
**Does a pass mean my CLI has no terminal bugs?** No. Each check tests one behavior, on the probes that ran; a subcommand that wasn't probed wasn't checked. cliprobe reports evidence, not a score, so add a `--probe` for each command your users pipe or interrupt.
|
|
445
|
+
|
|
446
|
+
**Does it only work for Node.js programs?** No. It tests any command as a black box, whatever it is written in. Only the [fixes](#fixing-a-failure-in-a-nodejs-cli) are specific to Node.js.
|
|
447
|
+
|
|
448
|
+
**Is it safe to probe any program?** cliprobe runs the program with your privileges, so probing it is like running it. Probe untrusted programs inside a disposable container with networking off, for example `docker run --rm --network none`.
|
|
449
|
+
|
|
450
|
+
**Does it run on Windows?** Not yet. It runs on macOS and Linux, including Alpine. It may work under WSL, but that isn't tested.
|
|
451
|
+
|
|
424
452
|
## Contributing
|
|
425
453
|
|
|
426
454
|
Bug reports and pull requests are welcome. The most useful report is a verdict you believe is wrong: open a [wrong verdict issue](https://github.com/KhaledSaeed18/cliprobe/issues/new?template=wrong_verdict.yml) with the program, its version and the `--format json` report. For a bug in cliprobe itself, an idea for a new check or a gap in these docs, [choose an issue form](https://github.com/KhaledSaeed18/cliprobe/issues/new/choose).
|
|
427
455
|
|
|
428
|
-
Development needs macOS or Linux, Node.js 22.
|
|
456
|
+
Development needs macOS or Linux, Node.js 22.18 or later and pnpm (the version is pinned in `package.json`):
|
|
429
457
|
|
|
430
458
|
```sh
|
|
431
459
|
pnpm install
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cliprobe",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
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": {
|