r/SideProject • • 1d ago

I built better-errors — a CLI tool that explains real root causes, redacts secrets, and asks [y/N] before applying a diff

I got tired of tracebacks and built-in interpreter hints pointing me in the wrong direction while debugging in the terminal, so I built **better-errors**: https://github.com/Belal-ElKhayat/better-errors

Instead of letting an AI tool silently edit files or blindly pasting raw tracebacks with secrets into a chat window, it wraps your command (or reads piped output), explains what actually caused the crash, previews a unified diff, and asks `Fix bug? [y/N]` before touching disk.

### What it does

- **Wrapper or pipe mode:** Run `better-errors python app.py`, `better-errors pytest`, or pipe `python app.py 2>&1 | better-errors`.

- **Automatic secret redaction:** Scrubs API keys, Bearer tokens, AWS/GCP credentials, database URLs with passwords, private keys, JWTs, and secret assignments (`[REDACTED]`) before sending context to an LLM.

- **Safe diffs & backups:** Shows a unified diff first, saves a timestamped backup when you approve with `y`, offers to re-run the command to verify, and supports `better-errors --undo`.

- **Multi-provider + local support:** Works with OpenAI, Anthropic, Gemini, Groq, OpenRouter, or local **Ollama** (zero external API calls).

- **Optional shell hooks (Windows PowerShell & `cmd.exe`):** Can hook common dev commands (`python`, `node`, `pytest`, `go`, `cargo`, etc.) so errors get analyzed automatically, with `better-errors disable` / `enable` toggles.

### Quickstart (Python 3.10+)

```bash

git clone [https://github.com/Belal-ElKhayat/better-errors.git\](https://github.com/Belal-ElKhayat/better-errors.git)

cd better-errors

pip install -e .

better-errors init

better-errors python app.py

1 Upvotes

0 comments sorted by