CLI-based macOS optimization tool for Intel Macs
A comprehensive command-line system optimization suite designed specifically for Intel-based MacBooks. This is the CLI version of the OptiMac application, offering powerful system tuning, maintenance, and monitoring capabilities through an interactive terminal interface.
This tool is designed exclusively for Intel-based Macs. If you have an Apple Silicon Mac (M1/M2/M3), please use the appropriate version.
- Performance Tuning: Optimize kernel parameters for improved system responsiveness
- Memory Management: Advanced memory optimization and purging
- SSD Optimization: TRIM support and hibernation management
- Security Hardening: Firewall configuration and system security enhancements
- TCP/IP Stack Tuning: Optimize network parameters for better throughput
- DNS Management: Fast DNS cache flushing
- Firewall Control: Easy firewall enable/disable functionality
- Cache Clearing: System and user cache cleanup
- Language Files: Remove unused language resources
- Font Cache: Rebuild and optimize font caches
- Metadata Cleanup: Remove .DS_Store files recursively
- Spotlight Control: Disable/enable system indexing
- Animation Removal: Eliminate UI animations for faster response
- Dashboard Management: Disable legacy Dashboard
- Dock Optimization: Remove Dock animations
- Disk Permissions: Verify and repair disk permissions
- Maintenance Scripts: Run daily/weekly/monthly maintenance
- System Logs: Clear old log files
- SMC Reset: Guided SMC reset instructions
- Power Settings: Optimize sleep and wake behaviors
- Low Power Mode: Toggle power saving features
- AutoBoot Control: Manage automatic boot on lid open (Intel only)
- CPU Information: Detailed processor stats
- Memory Status: Real-time RAM usage
- GPU Details: Graphics card information
- Battery Health: Cycle count and battery condition
- Disk Usage: Storage space monitoring
- Network Status: Active network interfaces
- Temperature Sensors: Hardware temperature monitoring (requires iStats)
- Multi-Select Interface: Choose multiple optimizations per section (e.g.,
A,Cto run options A and C) - State Tracking: Persistent logging of all optimizations with timestamps
- MDM Detection: Check for Mobile Device Management enrollment
- Flexible Input: Supports both comma-separated and space-separated selections
# Clone the repository
git clone https://github.com/VonKleistL/OptiMac-Intel.git
# Navigate to the directory
cd OptiMac-Intel
# Make the script executable
chmod +x optimac.sh
# Run the optimizer
./optimac.sh- macOS: 10.13 High Sierra or later
- Architecture: Intel x86_64 only
- Privileges: Sudo access required for most optimizations
- Shell: Bash 3.2 or later (default on macOS)
./optimac.shThe script will present an interactive menu with the following sections:
- System Optimizations - Core system performance tuning
- Network Optimizations - Network stack enhancements
- Storage Optimizations - Disk and cache management
- Performance Tweaks - UI and system responsiveness
- Maintenance - System maintenance tasks
- Power Management - Battery and power settings
- Check System Status - Comprehensive system information
- View All Optimization States - Review optimization history
- Reset All Optimizations - Clear optimization state tracking
- Check MDM Status - Detect MDM enrollment
When entering any optimization section, you can select multiple options using letters:
Select optimizations to run (e.g., A,C or A C):
A. Optimize System Performance
B. Optimize Memory Management
C. Optimize SSD Settings
D. Optimize Security
0. Cancel
Enter your selections: A,C
Supported input formats:
A,C(comma-separated)A C(space-separated)a c(lowercase works too)A, C(mixed with spaces)
Optimization states are tracked in ~/.macbook_optimizer_state.conf
Format: feature=status|timestamp
Example:
system_performance=enabled|2025-12-13 13:45:22
memory_management=enabled|2025-12-13 13:45:35
ssd_optimization=failed|2025-12-13 13:46:10
- Run the script:
./optimac.sh - Select 4. Performance Tweaks
- Enter
A,B,C,Dto disable all animations and UI delays - Return to main menu and select 1. System Optimizations
- Enter
A,Bfor performance and memory optimization
- Run the script
- Select 2. Network Optimizations
- Enter
Ato optimize TCP/IP settings - Select
Cto enable firewall if needed
- Run the script
- Select 3. Storage Optimizations
- Enter
A,C,Dto clear caches and metadata - Select 5. Maintenance
- Enter
B,Cto run maintenance scripts and clear logs
- Run the script
- Select 6. Power Management
- Enter
A,Bto optimize power settings and enable low power mode
- State Tracking: All operations logged with success/failure status
- Reversible: Many optimizations can be undone by re-running
- Permission Checks: Validates write access before operations
- Confirmation: Displays what will be executed before running
- Error Handling: Comprehensive error messages and recovery
If you encounter permission issues:
chmod 644 ~/.macbook_optimizer_state.confOr delete and recreate:
rm ~/.macbook_optimizer_state.conf
./optimac.sh # Will recreate automaticallyMost optimizations require admin privileges. You'll be prompted for your password when needed.
Check the status log:
cat ~/.macbook_optimizer_state.confView specific feature status in the script's menu option 8.
If temperature monitoring fails, install iStats:
sudo gem install iStatsTo remove all traces:
# Remove the configuration file
rm ~/.macbook_optimizer_state.conf
# Remove the script directory
cd .. && rm -rf OptiMac-IntelNote: System changes made by optimizations will persist. To revert:
- Re-enable features (Spotlight, Dashboard, etc.) through System Preferences
- Restart your Mac to reset kernel parameters to defaults
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-optimization) - Commit your changes (
git commit -m 'Add amazing optimization') - Push to the branch (
git push origin feature/amazing-optimization) - Open a Pull Request
- AutoBoot control (NVRAM-based)
- SMC reset procedures
- Some hardware-specific optimizations
- Apple Silicon Macs (M1/M2/M3)
- macOS versions earlier than 10.13
- Non-Mac Unix systems
Use at your own risk. While all optimizations are tested, system changes can have unintended effects.
Backup your data before running aggressive optimizations.
Some optimizations require a restart to take full effect.
MDM-enrolled devices may have restrictions that prevent certain optimizations.
- OptiMac - Full-featured GUI version for macOS
- OptiMac-Silicon - Optimized for Apple Silicon Macs
MIT License - see LICENSE file for details
Built with extensive research into macOS system internals and optimization techniques. Special thanks to the macOS developer community for documentation and best practices.
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing issues for solutions
- Review the troubleshooting section
Made for Intel Mac users who want maximum performance from their machines.