WinFlux follows a modular architecture for easy maintenance and extensibility.
WinFlux/
│
├── winflux.py # Single-file version (standalone)
│
├── winflux/ # Package version (modular)
│ ├── __init__.py # Package initialization
│ ├── cli.py # CLI interface with Click
│ ├── config.py # Configuration management
│ └── modules/ # Core functionality modules
│ ├── __init__.py # Module initialization
│ ├── cleanup.py # Cleanup operations
│ ├── analyze.py # Disk analysis
│ ├── optimize.py # System optimization
│ ├── report.py # Health reporting
│ └── utils.py # Utility functions
│
├── tests/ # Unit tests
│ ├── test_cleanup.py
│ ├── test_analyze.py
│ └── test_report.py
│
├── requirements.txt # Python dependencies
├── setup.py # Package installation script
├── LICENSE # MIT License
├── README.md # Main documentation
├── INSTALL.md # Installation guide
├── EXAMPLES.md # Usage examples
├── CONTRIBUTING.md # Contribution guidelines
└── .gitignore # Git ignore file
Complete single-file implementation with all features. Perfect for quick use without installation.
Usage:
python winflux.py cleanModular implementation organized into logical components.
- Command-line interface using Click
- Command registration and routing
- Input validation and user interaction
- Configuration file management
- Logging setup
- Default settings
Functions:
clean_temp_files()- Remove temporary filesclean_browser_cache()- Clear browser cachesclean_recycle_bin()- Empty recycle binclean_junk_files()- Remove logs and dumps
Functions:
analyze_disk_usage()- Analyze disk space usage- Display top N largest files/folders
- Calculate directory sizes
Functions:
list_startup_programs()- Show startup applications- Registry access for startup entries
- System optimization recommendations
Functions:
generate_report()- Create system health report- CPU, RAM, disk metrics
- System uptime and boot time
- Health warnings
Utility Functions:
get_dir_size()- Calculate directory sizeformat_bytes()- Human-readable byte formattingis_admin()- Check admin privileges
User Command
↓
cli.py (Click)
↓
Module Selection
↓
Operation Execution
↓
Rich Output
↓
Logging
Location: ~/.winflux/config.json
{
"auto_confirm": false,
"show_banner": true,
"log_level": "INFO",
"backup_enabled": true
}Location: ~/.winflux/logs/winflux_YYYYMMDD.log
Format:
2025-10-14 10:30:45 - INFO - Cleanup completed. Freed: 3.04 GB
2025-10-14 10:35:12 - INFO - System report generated
2025-10-14 10:40:22 - WARNING - Could not delete C:\Windows\Temp\file.tmp
- Create module in
winflux/modules/ - Register command in
winflux/cli.py - Add tests in
tests/ - Update documentation
Edit winflux/modules/cleanup.py:
def clean_new_target(self):
"""Clean new target files."""
console.print("\n[cyan]🧹 Cleaning new target...[/cyan]")
# Implementation hereEdit winflux/modules/report.py:
def generate_report(self):
"""Generate report with new section."""
# ... existing sections ...
# New section
new_table = Table(title="New Metric")
# Add rows
console.print(new_table)- click - CLI framework for command handling
- rich - Beautiful terminal output with colors and tables
- psutil - System and process information
- colorama - Cross-platform colored terminal text
- winshell - Windows shell operations (recycle bin)
- pywin32 - Windows API access (registry, etc.)
- Large directories can take time
- Progress indicators keep user informed
- Recursive scanning is optimized
- File lists are processed in batches
- Large files aren't loaded into memory
- Efficient directory traversal
- Dry-run mode for testing
- Confirmation prompts
- Comprehensive logging
- Error handling for locked files
Planned features:
- Duplicate file finder
- Registry cleaner
- Network optimization
- Scheduled task integration
- GUI version
- Plugin system
- Cloud storage cleanup
- Performance benchmarking
- Modularity - Each feature in separate module
- Testability - Unit tests for all modules
- Extensibility - Easy to add new features
- Safety - Multiple safeguards against data loss
- User-Friendly - Clear output and confirmations
- Cross-Windows - Works on Windows 10/11
Note: This structure is designed to be simple yet professional, suitable for both personal use and potential commercial applications.