Skip to content

anonymous243/Autofix-Logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 AutoFix Logs

Python License CLI Status

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.


✨ Features

  • 🔍 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

📦 Installation

Install from PyPI

pip install autofix-logs

or

pipx install autofix-logs

Install from Github

git clone https://github.com/anonymous243/Autofix-Logs
cd Autofix-Logs
pip install .

🔐 Setup

Create a .env file:

GEMINI_API_KEY=your_api_key_here

🚀 Usage

autofix analyze <filename.log>

⚡ Quick mode

autofix analyze <filename.log> --quick

📊 Summary mode

autofix analyze <filename> --summary

👀 Watch logs in real-time

autofix watch <filename>

🧰 Check system setup

autofix doctor

📌 Version

autofix version

🧪 Example

Input

autofix analyze <filename.log>

Output

🚨 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

Demo

autofix
autofix op

📁 Project Structure

autofix/
├── cli.py
├── main.py
├── parser.py
├── extractor.py
├── ai.py
├── formatter.py
├── watcher.py
├── utils.py
├── config.py
└── __init__.py

⚙️ Requirements

  • Python 3.9+
  • Internet connection

🧠 How It Works

  1. Extracts error blocks from logs
  2. Filters noise and prioritizes real issues
  3. Sends optimized input to AI
  4. Returns structured fixes instantly

🔮 Roadmap

  • 📡 Watch mode (real-time logs)
  • Smarter error ranking
  • 🧩 Multi-error detection
  • 🐳 Docker support
  • 📴 Offline AI models

🤝 Contributing

Contributions are welcome!

  1. Fork repo
  2. Create branch
  3. Commit changes
  4. Open PR

📜 License

MIT License


🌟 Support

⭐ Star the repo 🐛 Open issues 💡 Suggest features


👨‍💻 Author

Built by Amar


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages