Skip to main content

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

  1. Command capture: Gets last command from bash history or shell hook
  2. Error collection: Reads error output from stdin or captured file
  3. LLM analysis: Sends command and error to LLM for analysis
  4. 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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

heal-0.1.3-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

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

Hashes for heal-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 487c4cb2edc955893cea5e7ac336326ebd19893c28456c237c08eb8d0d86596c
MD5 e61a3f9602c95570dfd509cd64656c85
BLAKE2b-256 b8ded31325497e21e38ee136810b47369c0d0c13fd20240d52eb5853f06947d8

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