A Python package for healing and wellness
Project description
Heal
A Python package for fixing shell errors using LLM assistance.
Installation
pip install heal
Quick Start
Basic Usage (with pipe)
# Fix errors by piping stderr to heal
make dev 2>&1 | heal fix
# Or from error file
heal fix < error.txt
Automatic Mode (with shell hook)
# Install shell hook for automatic error capture
heal install
# Add to ~/.bashrc:
source ~/.heal/heal.bash
# Now you can run:
your_failing_command
heal fix
Features
- LLM-powered error analysis - Uses GPT models to understand and fix shell errors
- Automatic command capture - Shell hook captures last command and output
- Multiple input methods - Works with stdin, files, or shell hooks
- Configurable models - Support for various LLM providers via litellm
Commands
heal fix
Fix shell errors using LLM. Reads from stdin or shell hook.
heal fix [--model MODEL] [--api-key KEY]
heal install
Install shell hook for automatic error capture.
heal install
heal uninstall
Remove shell hook and configuration.
heal uninstall
Configuration
On first run, heal will prompt for:
- API key (for your LLM provider)
- Model name (e.g.,
gpt-4o-mini,gpt-4.1)
Configuration is stored in ~/.heal/.env.
Examples
Fix a make error
make dev 2>&1 | heal fix
Fix a Python error
python script.py 2>&1 | heal fix
Fix from error log
heal fix < application.log
Development
This package uses modern Python packaging with pyproject.toml.
Install in development mode
pip install -e .
Run tests
python -m pytest
How it works
- Command capture: Gets last command from bash history or shell hook
- Error collection: Reads error output from stdin or captured file
- LLM analysis: Sends command and error to LLM for analysis
- Solution proposal: Returns concrete fix suggestions
Limitations
- Shell processes cannot access previous process stderr without pipes
- Shell hook required for fully automatic operation
- Requires API key for LLM service
License
Apache License 2.0 - see LICENSE for details.
Author
Created by Tom Sapletta - tom@sapletta.com
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 heal-0.1.3-py3-none-any.whl.
File metadata
- Download URL: heal-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
487c4cb2edc955893cea5e7ac336326ebd19893c28456c237c08eb8d0d86596c
|
|
| MD5 |
e61a3f9602c95570dfd509cd64656c85
|
|
| BLAKE2b-256 |
b8ded31325497e21e38ee136810b47369c0d0c13fd20240d52eb5853f06947d8
|