# tidy-bash

Tidy bash output for [pi](https://pi.dev) — 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) or `exit N` (red) + line count at a glance
- **Collapsible output** — press `Ctrl+O` to 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

```bash
pi install npm:@oresk/tidy-bash
```

Or load locally:

```bash
pi -e ./src/tidy-bash.ts
```

## Requires

- pi >= 0.79.0

## License

MIT
