Open-source AI-powered CLI tool to analyze logs and suggest fixes instantly.
AutoFix Logs helps developers quickly understand errors from logs by providing structured explanations, root causes, and exact fix commands — directly in your terminal.
- 🔍 Smart Log Parsing – Extracts meaningful error segments from logs
- 🧠 AI-Powered Analysis – Uses Gemini AI for root cause detection
- ⚡ Instant Fix Suggestions – Provides exact commands to resolve issues
- 💻 CLI-Based Workflow – Works directly in your terminal
- 🔐 Secure – Uses environment variables for API keys
pip install autofix-logs
or
pipx install autofix-logsgit clone https://github.com/anonymous243/Autofix-Logs
cd Autofix-Logs
pip install .Create a .env file:
GEMINI_API_KEY=your_api_key_hereautofix analyze <filename.log>autofix analyze <filename.log> --quickautofix analyze <filename> --summaryautofix watch <filename>autofix doctorautofix versionautofix analyze <filename.log>
🚨 Error Detected
Type: ModuleNotFoundError
Confidence: High (100%)
💡 Cause:
The 'requests' package is not installed
📖 Explanation:
Python could not find the 'requests' module...
⚡ Fix Command:
pip install requests
autofix/
├── cli.py
├── main.py
├── parser.py
├── extractor.py
├── ai.py
├── formatter.py
├── watcher.py
├── utils.py
├── config.py
└── __init__.py
- Python 3.9+
- Internet connection
- Extracts error blocks from logs
- Filters noise and prioritizes real issues
- Sends optimized input to AI
- Returns structured fixes instantly
- 📡 Watch mode (real-time logs)
- Smarter error ranking
- 🧩 Multi-error detection
- 🐳 Docker support
- 📴 Offline AI models
Contributions are welcome!
- Fork repo
- Create branch
- Commit changes
- Open PR
⭐ Star the repo 🐛 Open issues 💡 Suggest features
Built by Amar