Skip to main content

AI-powered CLI debugging and auto-repair tool with RAG, automatic patch generation, and validation.

Project description

BugBee

AI-powered CLI debugging assistant that automatically analyzes runtime errors, retrieves relevant documentation using RAG, and suggests or applies intelligent fixes.

BugBee wraps your terminal commands, intercepts runtime failures, analyzes the traceback, retrieves relevant documentation from official sources, and uses an LLM to explain and optionally fix the issue.


Features

  • AI-powered debugging using DeepSeek-R1
  • Retrieval-Augmented Generation (RAG) using ChromaDB
  • Automatic traceback parsing
  • Context-aware code analysis
  • Retrieval from official framework documentation
  • SHA256-based intelligent response caching
  • Automatic code patch generation
  • Validation after applying fixes
  • Metrics collection
  • Cross-platform support (Windows, Linux, macOS)
  • Packaged for PyPI

Architecture

                 User Command
                       │
                       ▼
            Execute Target Program
                       │
                       ▼
               Capture stderr
                       │
                       ▼
          Parse Traceback & Context
                       │
                       ▼
             Compute Error Hash
                       │
            ┌──────────┴──────────┐
            │                     │
            ▼                     ▼
       Cache Hit             Cache Miss
            │                     │
            │             Retrieve Docs
            │                     │
            │                     ▼
            │              ChromaDB Search
            │                     │
            │                     ▼
            └────────► DeepSeek-R1 ◄─────────
                             │
                             ▼
                  AI Diagnosis + Fix
                             │
                             ▼
                 Optional Auto Patch
                             │
                             ▼
                   Validation Run
                             │
                             ▼
                        Metrics

Installation

pip install bugbee

Configuration

Create a .env file in your project.

HF_TOKEN=your_huggingface_api_key

You can obtain a Hugging Face token from:

https://huggingface.co/settings/tokens


Usage

Analyze a Python script:

bugbee run python app.py

Analyze any command:

bugbee run pytest
bugbee run uv run main.py

Display help:

bugbee --help

Example

Original error

name = "BugBee"

print(nmae)

BugBee output

🐝 BugBee Analysis

Root Cause
-----------
NameError: name 'nmae' is not defined

Suggested Fix
-------------

Replace

print(nmae)

with

print(name)

After confirmation, BugBee automatically:

  • Updates the file
  • Creates a backup
  • Executes a validation run
  • Reports success or failure

How It Works

  1. Execute the requested command.
  2. Capture stderr output.
  3. Parse traceback to identify the source file and line number.
  4. Extract surrounding source code.
  5. Generate a unique hash of the error.
  6. Check the local cache.
  7. Retrieve relevant documentation using ChromaDB.
  8. Send the prompt to DeepSeek-R1.
  9. Parse the structured response.
  10. Display the diagnosis.
  11. Optionally apply the generated fix.
  12. Validate the updated program.
  13. Record metrics.

Technologies

  • Python
  • Typer
  • LangChain
  • ChromaDB
  • Sentence Transformers
  • Hugging Face
  • DeepSeek-R1
  • Pydantic
  • Rich

Metrics

BugBee records useful runtime metrics including:

  • Successful analyses
  • Cache hit rate
  • Average latency
  • Token usage
  • Auto-fix count
  • Validation success rate

Roadmap

v0.2

  • Multiple LLM providers
  • Better framework detection
  • Improved retrieval pipeline

v0.3

  • AST-based patch generation
  • Framework-specific fix templates
  • Smarter patch validation

v1.0

  • VS Code extension
  • Plugin system
  • Multi-language support
  • Interactive terminal UI

Contributing

Contributions are welcome!

Please read CONTRIBUTING.md before submitting pull requests.


License

Apache License 2.0


Author

Pranav Kurmadasu

If you found BugBee useful, consider giving the repository a ⭐.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bugbee-0.1.2.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bugbee-0.1.2-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file bugbee-0.1.2.tar.gz.

File metadata

  • Download URL: bugbee-0.1.2.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bugbee-0.1.2.tar.gz
Algorithm Hash digest
SHA256 482673fe1c1116352fc87962bfe3887cf3bac5a9e985a5518f06d71d45ffaa20
MD5 7307462b896e30c55bdeb4abcc51bfa7
BLAKE2b-256 d92b5810f3854a51f05ad225545e6f6b5a9c91212607ff09e4fd9915f1a01c9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bugbee-0.1.2.tar.gz:

Publisher: main.yml on KurmadasuPranav7/BugBee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bugbee-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bugbee-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bugbee-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e25989a50cb8a4fba893436cde32b599e3966041f0c4c4633671ea3090f92ef7
MD5 ef9f6d187293915612db23727218b3c3
BLAKE2b-256 68b7fd46666d86caa6a35fd234a15feef13976713b6453e711db11da98b9de3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bugbee-0.1.2-py3-none-any.whl:

Publisher: main.yml on KurmadasuPranav7/BugBee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page