Local-first CLI AI debugger for Python projects
Project description
AI Debugger - aidbg
A minimal, event-driven, multi-language AI debugging engine for modern developers.
aidbg is a local-first, CLI-based AI debugging tool that works across multiple programming languages.
It wraps program execution, detects runtime failures, collects minimal diagnostic context, and returns a structured debugging explanation using an LLM โ without running background processes or monitoring your system.
aidbg activates only when your program crashes, analyzes the error, prints a concise fix, and exits immediately.
๐ Supported Languages
- Python (.py)
- JavaScript (Node.js) (.js)
- Go (.go)
- Java (.java)
Each language is handled through a lightweight adapter architecture.
โจ Why aidbg?
Modern developers often copy-paste errors into AI tools to debug problems.
aidbg removes that friction.
Instead of:
python app.py
# copy error
# open browser
# paste into AI
You do:
aidbg run app.py
Or:
aidbg run app.js
aidbg run main.go
aidbg run Test.java
And get:
- Root Cause
- Fix
- Short Explanation
All inside your terminal.
๐ Key Features
-
CLI-based execution wrapper
-
Event-driven (no background daemon)
-
Zero idle CPU usage
-
Multi-language adapter architecture
-
Minimal context collection
-
Token-controlled LLM responses
-
Guardrails against unsafe or hacky fixes
-
Multi-provider support:
- Groq
- OpenAI
- Ollama (local)
-
Global and project-level configuration
-
Fully open-source core
๐ง How It Works
Execution Flow:
aidbg run file.ext
โ detect language adapter
โ execute runtime (python/node/go/java)
โ detect crash (non-zero exit)
โ extract failure location
โ collect minimal context
โ send structured prompt to LLM
โ print debugging result
โ exit
aidbg never:
- Runs continuously
- Monitors your system
- Sends your full repository
- Collects environment variables
- Reads .env files
- Uploads datasets
๐ฆ Installation
Basic installation:
pip install aidbg
With provider extras:
pip install aidbg[groq]
pip install aidbg[openai]
pip install aidbg[ollama]
โ๏ธ Configuration
Initialize configuration:
aidbg init
Project-specific config:
aidbg init --local
Config priority:
- Project config (.aidbg/config.json)
- Global config (~/.aidbg/config.json)
๐ Usage
aidbg run app.py
aidbg run app.js
aidbg run main.go
aidbg run Test.java
Example output:
Root Cause:
Division by zero.
Fix:
Validate the divisor before performing the division.
Explanation:
The program does not check for zero before division.
๐ Runtime Requirements
Depending on language used:
- Python 3.9+
- Node.js (for .js files)
- Go (for .go files)
- Java JDK (for .java files)
๐ Privacy Model
Collected:
- Relevant traceback or runtime error
- Failing file + line number
- Code snippet around failure
- Shallow project structure (depth โค 2)
- Runtime version and OS
- Lightweight dependency info
Never collected:
- Full repository
- Secrets
- Environment variables
- Binary files
- Historical logs
๐งฉ Project Structure
aidbg/
โ
โโ cli.py # CLI entrypoint
โโ runner.py # Runtime execution per language
โโ trigger.py # Crash detection + LLM orchestration
โโ init.py # Interactive configuration
โโ config.py # Config resolution logic
โโ prompt.py # Prompt construction
โ
โโ languages/ # Language adapters
โ โโ base.py
โ โโ python.py
โ โโ javascript.py
โ โโ go.py
โ โโ java.py
โ โโ resolver.py
โ
โโ context/ # Context extraction modules
โ โโ collector.py
โ โโ project_tree.py
โ โโ environment.py
โ โโ dependencies.py
โ
โโ logic/
โ โโ complexity.py
โ โโ token_budget.py
โ
โโ llm/
โ โโ base.py
โ โโ groq.py
โ โโ openai.py
โ โโ ollama.py
โ
โโ tests/
๐งช Testing
pytest
๐ Roadmap
v0.2
- Multi-language support
- Adapter-based architecture
v0.3 (Planned)
- Interactive terminal mode
- Improved error classification
v1.0 (Future)
- Custom lightweight debugging model
- Optional hosted API
- Core CLI remains open-source
๐ License
MIT License.
The open-source CLI tool is released under MIT. Future hosted APIs or proprietary debugging models may be released under separate commercial terms.
๐ค Contributing
Pull requests welcome. Keep contributions minimal, testable, and consistent with the local-first philosophy.
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 aidbg-0.1.3.tar.gz.
File metadata
- Download URL: aidbg-0.1.3.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
951a108f19c9ca260241e09313fe081da94a1a4baa80eecd6684ee64698b30ee
|
|
| MD5 |
6d1f75e4fea02b3679de0905993b45e3
|
|
| BLAKE2b-256 |
be19da6c6d5773b022ffb0c13064fcb6b9ab6aacf37ee12c6454a6bdd0e05aa4
|
File details
Details for the file aidbg-0.1.3-py3-none-any.whl.
File metadata
- Download URL: aidbg-0.1.3-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b077bc15a41ed1b6d9087c6547727a49035758f94726276aa7b6e1195a9eccba
|
|
| MD5 |
7e553b9bcfce6a932394d8eefb5cf908
|
|
| BLAKE2b-256 |
fc3f4bb11e5fa645bcd3521be7809bcb4b41a2324a018ac59ba6fe133b104910
|