Debug AI - A simple CLI tool that can be invoked in front of any of your normal terminal commands. When your program encounters an error, debugai will automatically prompt an AI (Claude, GPT) with the error details and provide useful debugging information. Otherwise it will just run the command as normal.
First clone the repo:
# e.g. using https
git clone https://github.com/Jjschwartz/dai.git
cd daiTo install dai as a global CLI tool using uv:
uv tool install .
# or to reinstall
uv tool install --force .This will install dai as a tool globally for the current user. You may need to create a new terminal session for the tool to be available.
This project uses uv for managing installation and dependencies.
uv sync
# for development (installs additionaldev dependencies)
uv sync --devSimply prefix any command with dai to get AI-powered error analysis:
dai your normal command hereFor example:
dai git status
dai python my_program.py
# you can even do the following (but things get weird)
dai dai python my_program.pyNormal shell syntax is supported, including pipes, redirects, and complex commands by using quotes.
dai "git status | grep 'modified'"
dai "python -c 'print(1/0)'"
# without quotes things work as normal, with each command separate
# e.g. dai will only run for the first and third command
dai which python && python --version && dai python main.pyWhen the command fails, dai will capture the error and provide intelligent debugging suggestions using Claude.
You'll need to set your Anthropic API key as an environment variable:
export ANTHROPIC_API_KEY='your-api-key-here'