Complete guide to setting up and using heal for the first time.
pip install healRun the configuration wizard:
heal configYou'll see:
🔧 First-time setup - Let's configure your LLM provider
Available providers:
1. OpenRouter (recommended)
2. OpenAI
3. Anthropic
4. Google AI
💡 Tip: OpenRouter gives you access to all models with one API key
Select provider [1]:
Recommendation: Choose option 1 (OpenRouter) for access to all models.
The wizard will show you where to get your API key:
🔑 Get your OpenRouter API key here:
https://openrouter.ai/keys
Enter your API key:
- Click the link (or visit it in your browser)
- Sign up/login
- Create an API key
- Copy and paste it into heal
Choose from popular models:
🤖 Select a model from OpenRouter:
1. openai/gpt-5.4-mini
GPT-4o Mini (fast, cheap, recommended)
2. openai/gpt-4o
GPT-4o (most capable)
3. anthropic/claude-3.5-sonnet
Claude 3.5 Sonnet (excellent reasoning)
4. google/gemini-pro-1.5
Gemini Pro 1.5 (long context)
5. meta-llama/llama-3.1-70b-instruct
Llama 3.1 70B (open source)
6. qwen/qwen-2.5-72b-instruct
Qwen 2.5 72B (multilingual)
7. Custom (enter model name manually)
Select model [1]:
Recommendation: Choose option 1 for best value.
Verify everything works:
heal testYou'll see:
🧪 Testing heal configuration...
✓ Provider: OpenRouter
✓ Model: openai/gpt-5.4-mini
✓ API Key: ********************abc1
📝 Simulating error:
Command: python app.py
Error: ModuleNotFoundError: No module named 'flask'
🤖 Asking LLM for solution...
💡 LLM Response:
────────────────────────────────────────────────────────────
The error indicates Flask is not installed. Install it with:
pip install flask
If using a virtual environment, activate it first:
source venv/bin/activate
────────────────────────────────────────────────────────────
✅ Test successful! Heal is working correctly.
You can now use: command 2>&1 | heal
Set up automatic command capture:
heal initThis will:
✅ Heal bash integration created!
📄 Hook file: /home/user/.heal/heal.bash
📝 To activate, add this line to your ~/.bashrc:
source /home/user/.heal/heal.bash
Add to ~/.bashrc automatically? [Y/n]: y
✅ Added to ~/.bashrc
🔄 To activate now, run:
source ~/.bashrc
📚 Usage after activation:
1. Run any command (it will be captured automatically)
2. If it fails, just run: heal
3. Heal will analyze the error and suggest fixes
💡 Helper commands:
heal-last - Show last captured command
heal-output - Show last captured output
Press y to automatically add to your .bashrc.
source ~/.bashrcPipe errors directly to heal:
python broken_script.py 2>&1 | healJust run your command, then heal:
# Run a failing command
npm install some-package
# Fix it with heal
healHeal will automatically see the last command and its output!
Check what was captured:
### Debugging Python Errors
```bash
python app.py
healnpm install
healdocker build .
healgit merge feature-branch
healTest your configuration anytime:
heal testSwitch providers or models:
heal configBefore running heal, verify what was captured:
heal-last # Shows the command
heal-output # Shows the outputFor commands that don't fail but have warnings:
make build 2>&1 | healCopy heal's suggestions to a file:
heal > solution.txtMake sure heal is installed:
pip install heal
# or
pip install --user healAdd to PATH if needed:
export PATH="$HOME/.local/bin:$PATH"If you haven't run heal init, you need to pipe errors:
your_command 2>&1 | healOr run heal init to enable automatic capture.
Check your configuration:
heal configVerify:
- API key is correct
- You have credits/billing enabled
- Internet connection is working
Make sure you've activated the bash integration:
source ~/.bashrcOr run heal init if you haven't yet.
- Read Configuration Guide for advanced setup
- Check Examples for real-world error scenarios
- See TODO.md for upcoming features
heal config # Configure provider and model heal test # Test configuration heal init # Setup bash integration
heal # Fix last error (with init) command 2>&1 | heal # Fix piped error heal < error.log # Fix from file
heal-last # Show last command heal-output # Show last output
heal config # Reconfigure heal uninstall # Remove integration
## Getting Help
```bash
heal --help
For specific command help:
heal init --help
heal test --help
heal config --help