Skip to main content

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.

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.

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

aidbg-0.1.3.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

aidbg-0.1.3-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

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

Hashes for aidbg-0.1.3.tar.gz
Algorithm Hash digest
SHA256 951a108f19c9ca260241e09313fe081da94a1a4baa80eecd6684ee64698b30ee
MD5 6d1f75e4fea02b3679de0905993b45e3
BLAKE2b-256 be19da6c6d5773b022ffb0c13064fcb6b9ab6aacf37ee12c6454a6bdd0e05aa4

See more details on using hashes here.

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

Hashes for aidbg-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b077bc15a41ed1b6d9087c6547727a49035758f94726276aa7b6e1195a9eccba
MD5 7e553b9bcfce6a932394d8eefb5cf908
BLAKE2b-256 fc3f4bb11e5fa645bcd3521be7809bcb4b41a2324a018ac59ba6fe133b104910

See more details on using hashes here.

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