DEV Community

Arthur031221
Arthur031221

Posted on

Squelchy: a small live wrapper for noisy commands

Squelchy running in a terminal

I built Squelchy to keep noisy commands from taking over the terminal. It shows a small live view while a process runs, then prints a bounded report with the real exit code and a command to recover the raw output.

What it keeps

Squelchy starts a program with its argv directly, without passing arguments through a shell. Standard input stays attached to the current terminal. It saves standard output and standard error byte for byte in separate files. A combined file records the chunk arrival order the wrapper observes. Concurrent streams have no guaranteed cross-stream chronology.

The preview parser uses a bounded line buffer and small tail and error rings. It decodes split UTF-8 for display, removes terminal escape sequences, and clips previews. The log files stay unchanged. The line metric counts LF, CRLF, and standalone CR records once each. An unterminated final fragment appears in the tail and counts as one record.

A measured fixture

npm run bench runs a deterministic process that writes exactly 5,000 LF records, ends with an error, writes to stderr, and exits 7. The benchmark checks that the final-only report has at most 12 lines, the exit is 7, and both recovered stream files match the expected bytes. In my local run, the final report had 10 lines, a 99.8% reduction, with 98,901 saved bytes. The result is recorded in benchmarks/result.json. This measures report size, not tokens or traffic.

I use Squelchy in shell commands, CI steps, and coding-agent workflows where a short result and recoverable log are useful. Its scope differs from RTK's command-specific agent filters, Context-mode's coding-agent context management, and chronic's behavior of showing output only when a command fails.

Squelchy doesn't provide a PTY, so interactive full-screen tools aren't supported. Windows uses the platform's normal permissions and direct-child interruption behavior. Squelchy isn't published to npm. Install from GitHub or try the demo with npm exec --yes --package=github:Arthur031221/squelchy -- squelchy demo.

Source, tests, and the benchmark command: https://github.com/Arthur031221/squelchy

Top comments (0)