This is a submission for the GitHub Copilot CLI Challenge
LogAI is an intelligent command-line tool that analyzes log files, detects errors, summarizes issues, and suggests fixes using AI-powered analysis. Built with GitHub Copilot CLI assistance to streamline development and enhance productivity.
# Analyze a log file
logai analyze app.log
# Explain a specific error
logai explain ERROR_502
# Detect errors in Docker logs
logai detect docker.log
# Get a summary of issues
logai summary backend.log- 🔍 Smart Error Detection - Automatically identifies errors, warnings, and critical issues
- 📊 Issue Summarization - Provides concise summaries of log file problems
- 💡 Fix Suggestions - AI-powered recommendations to resolve detected issues
- 🐳 Multi-Format Support - Works with backend logs, Docker logs, application logs, and more
- ⚡ Fast Analysis - Quick parsing and pattern matching
- 🎨 Beautiful Output - Color-coded, readable terminal output
# Clone the repository
git clone https://github.com/MengseuThoeng/logai.git
cd logai
# Install dependencies
pip install -e .
# Or install directly
pip install logailogai analyze /path/to/app.loglogai explain ERROR_502
logai explain "Connection timeout"logai detect /path/to/logs/error.loglogai summary /path/to/logs/app.loglogai watch /path/to/logs/app.logThroughout this project, GitHub Copilot CLI was instrumental in:
- Regex Pattern Generation - Creating complex patterns for log parsing
- Error Handling - Suggesting robust error handling strategies
- CLI Command Structure - Designing intuitive command-line interfaces
- Code Optimization - Improving performance of log parsing algorithms
- Testing Strategies - Generating test cases for various log formats
# Used to generate log parsing regex
gh copilot suggest "create regex pattern to match timestamp, log level, and message in log files"
# Used to optimize file reading
gh copilot suggest "efficient way to read large log files in Python without loading entire file in memory"
# Used to design CLI structure
gh copilot suggest "create Click-based CLI with analyze, explain, detect, and summary commands"- Python 3.8+ - Core language
- Click - CLI framework
- Rich - Beautiful terminal output
- Re (Regex) - Pattern matching
- JSON - Configuration and output formats
logai/
├── logai/
│ ├── __init__.py
│ ├── cli.py # Main CLI entry point
│ ├── analyzer.py # Log analysis logic
│ ├── detector.py # Error detection
│ ├── parser.py # Log parsing
│ ├── explainer.py # Error explanation
│ └── patterns.py # Regex patterns for different log formats
├── tests/
│ ├── test_analyzer.py
│ ├── test_detector.py
│ └── sample_logs/
├── examples/
│ ├── app.log
│ ├── docker.log
│ └── backend.log
├── setup.py
├── requirements.txt
├── LICENSE
└── README.md
╭─────────────────────────────────────────────────────────╮
│ 📊 LogAI Analysis Report │
╰─────────────────────────────────────────────────────────╯
📁 File: app.log
📏 Lines: 1,247
⏱️ Time Range: 2026-01-23 08:00:00 - 2026-01-23 14:30:22
╭─────────────────────────────────────────────────────────╮
│ ⚠️ Errors Detected: 15 │
╰─────────────────────────────────────────────────────────╯
🔴 CRITICAL (3):
• Line 234: Database connection timeout
• Line 567: OutOfMemory exception
• Line 891: Authentication service unreachable
🟡 WARNINGS (12):
• Slow query warnings (8 occurrences)
• Deprecated API calls (4 occurrences)
╭─────────────────────────────────────────────────────────╮
│ 💡 Suggested Fixes │
╰─────────────────────────────────────────────────────────╯
1. Database Connection Timeout
→ Check connection pool settings
→ Verify database server status
→ Review network connectivity
2. OutOfMemory Exception
→ Increase JVM heap size
→ Check for memory leaks
→ Review application memory usage patterns
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
Mengseu Thoeng - @MengseuThoeng
Built for the GitHub Copilot CLI Challenge 2026
⭐ If you found this useful, please star the repo!