Skip to main content

AI Debugger - aidbg

A minimal, event-driven, multi-language AI debugging engine for modern developers.

PyPI Python License CI

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:

  1. Project config (.aidbg/config.json)
  2. 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.

Metadata

Release files for aidbg 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aidbg 0.1.3
File Size Uploaded Provenance Actions
aidbg-0.1.3.tar.gz 16.1 kB Without provenance Details for aidbg-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aidbg 0.1.3
File Interpreter ABI Platform Actions
aidbg-0.1.3-py3-none-any.whl Python 3 none any Details for aidbg-0.1.3-py3-none-any.whl

Total release size: 35.0 kB

Release files / aidbg-0.1.3.tar.gz

Download URL aidbg-0.1.3.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
951a108f19c9ca260241e09313fe081da94a1a4baa80eecd6684ee64698b30ee
BLAKE2b-256 checksum
How to use checksums
be19da6c6d5773b022ffb0c13064fcb6b9ab6aacf37ee12c6454a6bdd0e05aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / aidbg-0.1.3-py3-none-any.whl

Download URL aidbg-0.1.3-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b077bc15a41ed1b6d9087c6547727a49035758f94726276aa7b6e1195a9eccba
BLAKE2b-256 checksum
How to use checksums
fc3f4bb11e5fa645bcd3521be7809bcb4b41a2324a018ac59ba6fe133b104910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for aidbg 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page