color-eyre for beautiful error reports with backtraces

Marcus Chen Jan 2026
1 tab
use color_eyre::Result;

fn might_fail() -> Result<()> {
    Err(color_eyre::eyre::eyre!("Something went wrong"))
}

fn main() -> Result<()> {
    color_eyre::install()?;
    might_fail()?;
    Ok(())
}
1 file · rust Explain with highlit

color-eyre enhances eyre (an anyhow alternative) with colored, human-readable error messages and backtraces. It automatically captures panic backtraces and suggestion hints. I use it in CLI tools where error UX matters. The setup is minimal: color_eyre::install()? in main. Errors print with context, source chain, and location. The output is much friendlier than default Rust errors, making debugging faster. For libraries, stick with thiserror or anyhow; for binaries where end users see errors, color-eyre is a great UX improvement. It's a small dependency that makes your CLI feel professional.