Introduction
Welcome to Sentinel AI
Sentinel AI is an automated PHP code analysis tool with intelligent reporting and categorized auto-fix capabilities. It provides cross-platform support with native binaries for Linux, macOS, and Windows.
What is Sentinel AI? A cross-platform PHP code quality analysis tool that combines PHP_CodeSniffer, PHPStan, PhpMetrics, and custom duplicate detection into a single, easy-to-use interface. Features categorized auto-fixing, framework-aware analysis, and intelligent caching.
Key Features
- Categorized Auto-Fix System: Risk-based auto-fixing with LOW/MEDIUM/HIGH categories and interactive mode
- Multi-Tool Integration: PHP_CodeSniffer, PHPStan, PhpMetrics, Custom Duplicate Detection
- Framework-Aware Analysis: Automatic detection of Laravel, Symfony, CodeIgniter, CakePHP, Laminas, Yii
- Intelligent Caching: Incremental analysis with file-based caching using SHA256 hashes
- Zero Configuration: Works out of the box with sensible defaults
- Performance Optimized: Fast analysis with intelligent caching support
- Cross-Platform: Native binaries for Linux, macOS, Windows with universal PHAR support
- Beautiful Reports: HTML reports with metrics, JSON output for CI/CD, console formatting
How It Works
Sentinel AI analyzes your PHP code using:
- File Scanner: Discovers and processes PHP files in your project
- Framework Detection: Automatically detects and configures analysis for popular PHP frameworks
- Multi-Tool Analysis: Runs PHP_CodeSniffer, PHPStan, PhpMetrics, and custom duplicate detection
- Categorized Auto-Fixing: Provides risk-based fixing with interactive mode
- Intelligent Caching: Uses SHA256 hashes for incremental analysis
- Report Generation: Creates detailed HTML, JSON, and console reports
Supported Analysis Types
🎯 Categorized Auto-Fix System
- Risk-Based Auto-Fixing: Choose your comfort level with LOW/MEDIUM/HIGH risk categories
- Interactive Default Mode: Simple yes/no workflow with smart recommendations
- Advanced Interactive Mode: Detailed category breakdowns and custom selections
- Dry-Run Preview: See exactly what changes will be made before applying
- Force Mode: Skip confirmations for CI/CD integration
🔍 Analysis Engine
- PHP_CodeSniffer - PSR-12 coding standards and style checking
- PHPStan - Advanced static analysis for type safety
- PhpMetrics - Code quality metrics and complexity analysis
- Custom Duplicate Detection - Identifies copy-pasted code
- Framework-Aware Analysis - Automatic detection and configuration
🏗️ Framework Support
- Laravel - Uses Larastan extension for Laravel-specific analysis
- Symfony - Uses PHPStan Symfony extension
- CodeIgniter 4 - Uses CodeIgniter PHPStan extension
- CakePHP - Uses CakePHP PHPStan extension
- Laminas - Uses Laminas Framework PHPStan extension
- Yii 2 - Uses Yii2 PHPStan extension
⚡ Performance Features
- Intelligent Caching: File-based caching with SHA256 hashes
- Incremental Analysis: Only re-analyzes modified files
- Tool-Specific Caches: Separate caches for each analysis tool
- Automatic Invalidation: Cache invalidates when files or rules change
- Parallel Processing: Multiple tools run concurrently
📊 Reporting & Output
- HTML Reports: Beautiful, detailed reports with metrics and issue breakdowns
- JSON Output: Machine-readable output for CI/CD integration
- Console Output: Clean, formatted terminal output
- Custom Formats: Extensible output system
Download & Installation
GitHub Repository
Access the source code, report issues, and contribute to the project.
View on GitHubDownload Latest Release
Get the latest stable version with all features and bug fixes.
Download Latest- Automated Installation: Use the installation script for automatic setup
- Manual Download: Download PHAR or native binaries directly
- Global Installation: Install system-wide for use from any directory
- Project-Specific: Use within specific project directories
Quick Start
Get started with Sentinel AI in just a few steps:
# Automated installation (recommended)
curl -sSL https://raw.githubusercontent.com/abdulbaquee/sentinel-ai-releases/main/releases/v1.0.6/install.sh | bash
# Analyze a PHP project
sentinel analyze src/
# Auto-fix issues interactively
sentinel autofix src/ --interactive
# Generate HTML report
sentinel analyze src/ --format=html --output=report.html
Which Sentinel File to Use?
Sentinel AI provides multiple executable options depending on your needs:
Use Case | Command | Description |
---|---|---|
Daily use | sentinel analyze |
After global installation |
Quick testing | ./dist/sentinel analyze |
Direct use, no installation |
Development | ./bin/sentinel analyze |
For development work |
Direct PHAR | ./dist/sentinel.phar analyze |
Advanced users |
Project Structure
Sentinel AI is organized into these key components:
sentinel-ai-releases/
├── releases/
│ ├── v1.0.4/ # Previous release
│ └── v1.0.6/ # Latest release (current)
│ ├── sentinel.phar
│ ├── sentinel-linux-x86_64
│ ├── sentinel-macos-x86_64
│ ├── sentinel-windows-x86_64.bat
│ ├── install.sh
│ ├── install.ps1
│ ├── uninstall.sh
│ ├── uninstall.ps1
│ ├── RELEASE_NOTES.md
│ ├── QUICK_START.md
│ └── v1.0.6-checksums.txt
└── README.md # This file
Next Steps
Ready to get started? Follow these guides:
- Installation Guide - Set up Sentinel AI in your project
- Usage Guide - Learn how to run analysis and interpret results
- Custom Rules - Create your own analysis rules