self-heallm/php-self-heallm
Composer 安装命令:
composer require self-heallm/php-self-heallm
包简介
Framework-agnostic PHP library for automated error triage and LLM-powered self-healing.
README 文档
README
Packagist (self-heallm/php-self-heallm)
GitHub (universe-coder/php-self-heallm)
Canonical repository URLs are in composer.json (homepage, support). The Composer package name on Packagist remains self-heallm/php-self-heallm.
Framework-agnostic PHP Composer library that scans recent log errors, asks an LLM for a fix (OpenAI, Anthropic, Hugging Face OpenAI-compatible endpoint, or Ollama), validates path safety, optionally applies patches, and sends reports (Telegram, Slack, webhook, Sentry, JSONL file).
Install
composer require self-heallm/php-self-heallm
CLI
From your project root (with config/self-heal.php or env vars):
vendor/bin/self-heal
Or pass an explicit config path:
vendor/bin/self-heal --config=/absolute/path/to/self-heal.php
Copy config/self-heal.php into your app and adjust paths under log, reporting, and deduplication defaults (package defaults use <package>/var/... when shipped alone).
Programmatic use
use SelfHealLM\Bootstrap\SelfHealApplication; $pipeline = SelfHealApplication::fromConfigFile(__DIR__ . '/config/self-heal.php'); $result = $pipeline->run(); // ['status' => 'ok'|'skipped', 'reason' => ...?]
Or build config in memory:
$pipeline = SelfHealApplication::fromConfigArray([ 'enabled' => true, 'dry_run' => true, 'log' => ['path' => '/var/log/app.log', 'max_lines' => 200], // ... same keys as in config/self-heal.php (no outer `self-heal` key required) ]);
Environment variables
Same SELF_HEAL_* names as the Laravel-oriented package; see config/self-heal.php for the full list. Set SELF_HEAL_OPENAI_TOKEN, SELF_HEAL_LOG_PATH, etc., in your process environment or .env loader before including the config file.
Security
- Only paths under configured
allowed_pathsare accepted;forbidden_pathsalways win. - Auto-apply runs only when
enabled,auto_apply, anddry_runare set accordingly in config.
Related
The laravel-self-heallm package targets Laravel apps; this library is suitable for any PHP runtime with Composer.
License
MIT. See LICENSE.
self-heallm/php-self-heallm 适用场景与选型建议
self-heallm/php-self-heallm 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 self-heallm/php-self-heallm 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 self-heallm/php-self-heallm 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 38
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-09