Skip to content

Arnel-rah/bugsight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bugsight

CI Crates.io Downloads

Debug smarter, not harder.

A fast Rust CLI that analyzes errors, stack traces and logs — and tells you exactly how to fix them.

bugsight demo


Install

cargo install bugsight

Usage

# Pipe any command output
cargo build 2>&1 | bugsight

# Explain an error directly
bugsight --explain 'permission denied'

# Analyze a log file
bugsight --file logs/error.log

# Watch a log file in real-time
bugsight --watch logs/app.log

# Start daemon mode (REST API)
bugsight --daemon
bugsight --daemon --port 9000

# Show error history
bugsight --history

# Show error statistics
bugsight --stats

# Machine-readable JSON output
bugsight --explain 'NullPointerException' --json

# Create config file
bugsight --init

Daemon mode

Start bugsight as a local REST API:

bugsight --daemon
# bugsight daemon running on http://localhost:7878

Analyze errors from any tool or IDE:

# Health check
curl http://localhost:7878/health

# Analyze an error
curl http://localhost:7878/analyze \
  -H "Content-Type: application/json" \
  -d '{"error": "NullPointerException"}'

Response:

{
  "error_type": "Java NullPointerException",
  "found": true,
  "message": "NullPointerException",
  "suggestion": "An object is null. Add a null check with if (obj != null) or use Optional<T>."
}

Supported languages

Language Errors covered
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
Java NullPointerException, OutOfMemoryError, StackOverflow
PHP syntax errors, memory limit, undefined variables
Ruby NoMethodError, LoadError, Rails RecordNotFound
C/C++ segfault, memory leaks, linker errors, buffer overflow
Swift nil unwrap, EXC_BAD_ACCESS, type mismatch
Kotlin unresolved reference, type mismatch, ClassCastException
General permission denied, file not found

AI fallback

For unknown errors, bugsight uses Groq (free):

export GROQ_API_KEY=gsk_xxxxxx

Without the key, bugsight still works with its built-in parsers.


Config

bugsight --init

Creates ~/.bugsight.toml:

# Enable AI fallback
ai_enabled = true

# Save analyzed errors to history
history_enabled = true

# Language: "en" or "fr"
language = "en"

# Max errors in history
max_history = 100

JSON output

bugsight --explain 'permission denied' --json
{
  "error_type": "Permission Error",
  "message": "permission denied",
  "suggestion": "Try running with sudo or check file permissions with ls -la."
}

Stats

bugsight --stats
Error Statistics
────────────────────────────────────────
Type                           Count
────────────────────────────────────────
Permission Error               3  75% ███
Runtime Panic                  1  25% █
────────────────────────────────────────
Total errors analyzed: 4

Contributing

Contributions are welcome! The easiest way is to add a new parser.

  1. Fork the repo
  2. Create a branch: git checkout -b feat/your-parser
  3. Add src/parsers/your_lang.rs
  4. Register it in src/parsers/mod.rs
  5. Add tests
  6. Run cargo test
  7. Open a Pull Request

See CONTRIBUTING.md for details.


Built with


License

MIT © 2025 Arnel Raharinandrasana

About

A fast CLI tool that analyzes errors, stack traces and logs — and tells you exactly how to fix them.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages