A beautiful console application for cleaning and optimizing macOS
Project description
๐ macOS Cleaner
A beautiful and efficient console application for cleaning and optimizing macOS systems.
โจ Features
- ๐ Smart Scanning: Intelligently identifies unnecessary files across your system
- ๐งน Safe Cleaning: Removes only safe-to-delete files with backup options
- โก System Optimization: Memory purging, DNS flushing, and startup item management
- ๐จ Beautiful UI: Rich console interface with colors, progress bars, and animations
- ๐ก๏ธ Safety First: Built-in protections and confirmation prompts
- ๐ Detailed Reports: Comprehensive scan results and cleaning summaries
๐ Supported Cleaning Categories
- System & User Caches: Clear application and system cache files
- Browser Caches: Remove browser temporary files
- Temporary Files: Clean up system temporary directories
- Log Files: Remove old log files
- Downloads: Identify old files in Downloads folder
- Trash: Empty system trash
- Duplicate Files: Find and remove duplicate files
- Large Files: Identify unusually large files
- Old Files: Find files not accessed in months
- App Leftovers: Remove files from uninstalled applications
๐ Installation
Using pip
pip install mac-clean-cli
Using Homebrew (coming soon)
brew install mac-clean-cli
From Source
git clone https://github.com/qdenka/MacCleanCLI.git
cd MacCleanCLI
pip install -e .
๐ Usage
Basic Usage
# Run interactive mode
mac-clean
# Or use the short alias
mclean
Command Line Options
# Scan only, don't clean
mac-clean --scan-only
# Automatic mode (clean recommended items)
mac-clean --auto
# Use custom config file
mac-clean --config ~/myconfig.json
# Enable verbose output
mac-clean --verbose
๐ฎ Interactive Mode
The interactive mode provides a user-friendly menu system:
- Scan System: Choose categories to scan
- Clean Files: Select and clean identified files
- Optimize System: Run system optimization tasks
- Settings: Configure application behavior
โ๏ธ Configuration
Configuration file is stored at ~/.MacCleanCLI/config.json
Key Settings
{
"dry_run": false,
"enable_backup": true,
"verify_cleaning": true,
"remove_empty_dirs": true,
"max_workers": 4,
"backup_retention_days": 7
}
๐ก๏ธ Safety Features
- Protected Paths: System-critical directories are never touched
- Backup System: Optional backup before deletion
- Dry Run Mode: Preview what would be deleted without actually removing files
- Confirmation Prompts: Require user confirmation for destructive operations
- Verification: Post-cleaning verification of file removal
๐๏ธ Architecture
The application follows SOLID principles and clean architecture:
MacCleanCLI/
โโโ main.py # Entry point
โโโ core/ # Core business logic
โ โโโ scanner.py # System scanning
โ โโโ cleaner.py # File cleaning
โ โโโ optimizer.py # System optimization
โโโ models/ # Data models
โ โโโ scan_result.py # Result structures
โโโ ui/ # User interface
โ โโโ interface.py # Main UI logic
โ โโโ components.py # UI components
โโโ utils/ # Utilities
โโโ config.py # Configuration
โโโ logger.py # Logging
โโโ backup.py # Backup management
๐ง Development
Setup Development Environment
# Clone the repository
git clone https://github.com/qdenka/MacCleanCLI.git
cd MacCleanCLI
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install development dependencies
pip install -r requirements.txt
pip install -e .
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=.
# Run specific test file
pytest tests/test_scanner.py
Code Style
# Format code
black .
# Check linting
flake8 .
# Type checking
mypy .
๐ Performance
- Multi-threaded scanning: Utilizes multiple CPU cores for faster scanning
- Efficient file operations: Batch operations for improved performance
- Memory efficient: Streams large files instead of loading into memory
- Progress indication: Real-time progress updates during operations
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with Rich for beautiful terminal UI
- Uses psutil for system information
- Inspired by various macOS cleaning utilities
โ ๏ธ Disclaimer
This software is provided as-is. Always ensure you have backups of important data before running system cleaning operations. The authors are not responsible for any data loss.
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Wiki: Documentation Wiki
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mac_clean_cli-1.0.0.tar.gz.
File metadata
- Download URL: mac_clean_cli-1.0.0.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1136712e823df1d2697e324f8434366a2d841f855137505a5ea0f86fcead3aa0
|
|
| MD5 |
2bcd8531033f2e62ab7b2c2cd40302ac
|
|
| BLAKE2b-256 |
4c7627379f8da6c391ac170aa2bf597b497d7207675ea5072b80a1facfaf71a4
|
File details
Details for the file mac_clean_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mac_clean_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e8b5b4682d6e619d8fd44752d6f3ece2f80f69667514818053926857c9205c5
|
|
| MD5 |
f1730f2261a4a3970466ea52b6c11096
|
|
| BLAKE2b-256 |
e5d910a7d347e0643f4f25007e2a951e5445fcea72f7af7758837b3c3de10b3e
|