Skip to content

Latest commit

 

History

History
86 lines (52 loc) · 2.08 KB

File metadata and controls

86 lines (52 loc) · 2.08 KB

why

Build Status License Repo-Stars Repo-Forks

Plain English explanations for compiler errors and CLI failures.

Stop staring at cryptic error messages. Just type why.

Demo

Screenshot_20260324_215001

What it does

why reads the last error from your terminal and explains it in plain English, what went wrong, why it happened, and how to fix it. No more context-switching to Google or Stack Overflow.

Installation

cargo install --git https://github.com/alexdev-tb/why

Usage

Run why after a failed command to get an explanation of the error:

why

Look up a specific error code directly:

why ErrorCode

Browse all supported error codes:

why --list

Set up the shell hook for automatic error capture:

why --setup

Shell Hook Setup

The shell hook captures the output of failed commands automatically so why can read them. Run why --setup for automatic setup, or add the hook manually:

Bash

Add to your ~/.bashrc:

eval "$(why --hook bash)"

Zsh

Add to your ~/.zshrc:

eval "$(why --hook zsh)"

Then restart your shell or run source ~/.bashrc (or ~/.zshrc).

Contributing

Contributions are encouraged! Adding a new error explanation is as simple as copying a YAML template and writing a few sentences of plain English.

See CONTRIBUTING.md for the full guide.

License

Apache 2.0