Overview
AIGuardian Documentation
Loading update info...
View on GitHubAIGuardian Project Overview (v1.1.0)
AIGuardian is an AI-powered codebase optimizer and cleaner tool designed to help developers maintain clean, secure, and efficient codebases. The tool is built with Node.js and is intended to be used as a command-line utility.
Core Architecture
- 1. Project Structure: -
- 2. Core Components: - Project Detector: Automatically identifies the type of project (JavaScript/TypeScript, Python, Java, etc.) by analyzing files and directory structures. - Task Runner: Manages the execution of optimization tasks, handling errors, and reporting results. - Backup Manager: Creates backups of projects before making changes to ensure safety.
- 3. Task-Based Architecture: - Tasks are organized by project type (common, JavaScript, Python, Java) - Enhanced task registry with improved project type handling - Each task is implemented as a standalone module with a consistent interface - Tasks can be run individually or as part of a complete optimization suite - Flexible task retrieval by project type or task ID
- 1. Universal Detection: The tool automatically identifies project types and adapts to different codebases.
- 2. Smart Optimization: It provides tailored tasks for specific languages and frameworks: - Common Tasks (for all projects): - Optimize .gitignore files - Normalize line endings - Clean temporary files - Format code
- 3. Safety Features: - Creates backups before making changes - Supports dry-run mode to preview changes without applying them - Provides detailed logs and error handling
- 4. User Experience: - Interactive CLI with visual progress indicators - Color-coded output for better readability - Detailed summaries of actions taken
- 1. Command-Line Interface: - Uses native Node.js modules for command-line argument parsing - Uses native readline module for interactive prompts - Uses
- 2. File Operations: - Safe file reading/writing with error handling - Directory creation and management - File pattern matching with native Node.js capabilities
- 3. Logging and Reporting: - Custom logger implementation with different log levels - Formatted output for better readability - Support for verbose logging for debugging
- 1. Individual Task Mode (
aiguardian
):
- Allows users to select and run specific optimization tasks
- Interactive menu for task selection - 2. Complete Optimization Mode (
aiguardian-all
):
- Runs all appropriate optimization tasks for the detected project type
- Non-interactive mode for automation - 3. Command Line Options: - Path specification - Dry-run mode - Verbose logging - Backup control - Force mode (skip confirmations)
bin/
: Contains the entry point scripts (aiguardian.js
and aiguardian-all.js
)
- lib/
: Core functionality and task implementations
- docs/
: Documentation files
- assets/
: Logo and visual assets
- tests/
: Test directories (currently empty)Key Features
- JavaScript/TypeScript Tasks: - Convert JavaScript to TypeScript - Optimize npm dependencies
- Python Tasks: - Clean __pycache__ directories - Optimize requirements.txt
- Java Tasks: - Clean build artifacts - Optimize dependencies
Implementation Details
chalk
for colorful terminal outputUsage Patterns
Development Status
The project appears to be in a functional state but might still be under active development. The codebase is well-structured with clear separation of concerns and consistent patterns across different modules.
Was this page helpful?