DEV Community

Cover image for I built a Rust CLI that analyzes your errors and tells you exactly how to fix them
arnel
arnel

Posted on

I built a Rust CLI that analyzes your errors and tells you exactly how to fix them

I built a Rust CLI that analyzes your errors and tells you how to fix them

Every developer knows the feeling. You run a command, get a cryptic error, and spend the next 20 minutes on Google trying to figure out what went wrong.

I got tired of it. So I built bugsight.


What is bugsight?

bugsight is a fast CLI tool written in Rust that analyzes errors, stack traces and logs — and tells you exactly how to fix them, directly in your terminal.

cargo build 2>&1 | bugsight
Enter fullscreen mode Exit fullscreen mode

That's it. Pipe any command output and bugsight does the rest.


How it works

bugsight has two layers:

1. Local parsers (instant, offline)
Built-in pattern matching for the most common errors across 7 languages and tools. Zero latency, no API call needed.

2. AI fallback (Groq)
If no parser matches, bugsight sends the error to Groq's free API (LLaMA 3.3 70B) and gets a clear explanation + fix in under a second.


Demo

# Pipe mode
cargo build 2>&1 | bugsight

Analyzing  thread 'main' panicked at 'index out of bounds'
Type       Runtime Panic
Message    index out of bounds: len is 3, index is 5
Fix        Use .get(i) instead of [i] to avoid panics.

# Explain mode
bugsight --explain 'permission denied: config.toml'

Analyzing  permission denied: config.toml
Type       Permission Error
Fix        Try sudo or check file permissions with ls -la.

# File mode
bugsight --file logs/error.log

Scanning   47 lines...
Done       3 errors detected and analyzed
Enter fullscreen mode Exit fullscreen mode

Supported languages

  • Rust — panics, compile errors, unwrap errors
  • Go — nil pointer, index out of range, missing modules
  • Python — ModuleNotFoundError, TypeError, KeyError, IndentationError
  • Node.js — Cannot find module, undefined property, EADDRINUSE
  • Docker — daemon not running, permission denied, port conflicts
  • Git — merge conflicts, push rejected, SSH errors
  • General — permission denied, file not found

Install

cargo install bugsight
Enter fullscreen mode Exit fullscreen mode

Optional: AI setup

bugsight works great without AI for known errors. For unknown errors, set up a free Groq API key:

  1. Create a free account at console.groq.com
  2. Generate an API key
  3. Export it:
export GROQ_API_KEY=gsk_xxxxxx
Enter fullscreen mode Exit fullscreen mode

Why Rust?

I wanted bugsight to be fast and reliable. Rust gave me:

  • Near-instant startup time
  • Strong pattern matching with the regex crate
  • A great CLI ecosystem (clap, colored)
  • Easy distribution via cargo install

What I learned building this

This was my first published Rust project. A few things I learned:

  • cargo publish requires a verified email on crates.io
  • GitHub Actions with cargo fmt --check and cargo clippy catches a lot of issues before they reach main
  • The Rust community is incredibly welcoming — even on Discord

What's next

  • More parsers (Java, PHP, Ruby...)
  • Interactive mode
  • Config file (~/.bugsight.toml) for custom patterns

Contribute

bugsight is open source and contributions are very welcome. Adding a new parser is straightforward — create a file in src/parsers/, implement the parse function and add tests.


Would love to hear your feedback. What errors do you run into most often? I'll add a parser for it.

Top comments (0)