原始内容
tidy-bash
Tidy bash output for pi — splits multi-command chains into readable lines with clean status summaries.
What it does
Before (default pi) — bash output is one blob:
$ cd src && grep -r "TODO" . && npm test
... all output mixed together ...
exit code: 0
After (with tidy-bash) — each command gets its own line, result is a scannable summary:
$ cd src
&& grep -r "TODO" .
&& npm test
ok · 42 lines ← collapsed by default (Ctrl+O to expand)
When a command fails:
$ npm install
&& npm run build
exit 1 · 25 lines ← red, stands out immediately
Features
- Command-chain splitting —
&&,;,||,|separated commands each get their own labeled line - Quote-aware — strings like
echo "foo && bar"stay intact, no false splits - Clean status line —
ok(green) orexit N(red) + line count at a glance - Collapsible output — press
Ctrl+Oto expand and see full output - Zero behavior change — delegates to the built-in bash tool, same execution for the model
- ~80 lines, zero dependencies — just imports from pi's bundled packages
Install
pi install npm:@oresk/tidy-bash
Or load locally:
pi -e ./src/tidy-bash.ts
Requires
- pi >= 0.79.0
License
MIT