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
- Execute the requested command.
- Capture stderr output.
- Parse traceback to identify the source file and line number.
- Extract surrounding source code.
- Generate a unique hash of the error.
- Check the local cache.
- Retrieve relevant documentation using ChromaDB.
- Send the prompt to DeepSeek-R1.
- Parse the structured response.
- Display the diagnosis.
- Optionally apply the generated fix.
- Validate the updated program.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bugbee-0.1.0.tar.gz.
File metadata
- Download URL: bugbee-0.1.0.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d512cfa7dad0a19bff8575592517463f05e31b25d11aa05361421e22993be07
|
|
| MD5 |
f1529c7d58499de04b4e0be4cde37693
|
|
| BLAKE2b-256 |
e379d317e0a63e287a0f96b3c64a4731de9dbb650234b6c6bc496287dbed15a4
|
Provenance
The following attestation bundles were made for bugbee-0.1.0.tar.gz:
Publisher:
main.yml on KurmadasuPranav7/BugBee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bugbee-0.1.0.tar.gz -
Subject digest:
3d512cfa7dad0a19bff8575592517463f05e31b25d11aa05361421e22993be07 - Sigstore transparency entry: 1893474324
- Sigstore integration time:
-
Permalink:
KurmadasuPranav7/BugBee@75142bc8f60164b7f1728a2d0a2e8413108a034a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/KurmadasuPranav7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@75142bc8f60164b7f1728a2d0a2e8413108a034a -
Trigger Event:
release
-
Statement type:
File details
Details for the file bugbee-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bugbee-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c469b921e21762863cfdefc464484cd3eb723a819605b8c562643a9a7f3a0189
|
|
| MD5 |
3e96d1558e4e25b09b6953bcf4c644fd
|
|
| BLAKE2b-256 |
431e92115a58e60ffae3562d2facbb482f0e1f6d5869db8214ef629d899bf62e
|
Provenance
The following attestation bundles were made for bugbee-0.1.0-py3-none-any.whl:
Publisher:
main.yml on KurmadasuPranav7/BugBee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bugbee-0.1.0-py3-none-any.whl -
Subject digest:
c469b921e21762863cfdefc464484cd3eb723a819605b8c562643a9a7f3a0189 - Sigstore transparency entry: 1893474425
- Sigstore integration time:
-
Permalink:
KurmadasuPranav7/BugBee@75142bc8f60164b7f1728a2d0a2e8413108a034a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/KurmadasuPranav7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@75142bc8f60164b7f1728a2d0a2e8413108a034a -
Trigger Event:
release
-
Statement type: