Skip to main content

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.

Python Version License Platform

โœจ 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:

  1. Scan System: Choose categories to scan
  2. Clean Files: Select and clean identified files
  3. Optimize System: Run system optimization tasks
  4. 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.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mac_clean_cli-1.0.0.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mac_clean_cli-1.0.0-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

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

Hashes for mac_clean_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1136712e823df1d2697e324f8434366a2d841f855137505a5ea0f86fcead3aa0
MD5 2bcd8531033f2e62ab7b2c2cd40302ac
BLAKE2b-256 4c7627379f8da6c391ac170aa2bf597b497d7207675ea5072b80a1facfaf71a4

See more details on using hashes here.

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

Hashes for mac_clean_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e8b5b4682d6e619d8fd44752d6f3ece2f80f69667514818053926857c9205c5
MD5 f1730f2261a4a3970466ea52b6c11096
BLAKE2b-256 e5d910a7d347e0643f4f25007e2a951e5445fcea72f7af7758837b3c3de10b3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page