Skip to content

Conversation

Copy link

Copilot AI commented Oct 5, 2025

Overview

This PR implements the complete cleanmac.sh bash script as documented in the README.md. The script provides a comprehensive, interactive CLI tool for cleaning up macOS development environments.

What's New

Created cleanmac.sh (415 lines) with full feature implementation including:

Core Features

  • Interactive Menu System - 12 cleanup options plus exit (0-12)
  • Disk Usage Tracking - Shows disk space before cleanup, after cleanup, and total freed space
  • Color-Coded Output - Beautiful terminal output with emojis and color indicators (✅ success, ⚠️ warnings, ❌ errors, ➡️ actions)
  • Safety First - macOS-only validation, permission-aware execution, safe removal with error handling

Cleanup Operations

The script implements all 11 cleanup categories described in the README:

  1. Project folders - Removes node_modules, .next, .nuxt, .expo, .vercel, dist, build
  2. Package manager caches - Cleans npm, yarn, and pnpm caches
  3. Homebrew - Runs brew cleanup and removes cached packages
  4. Xcode - Deletes DerivedData, iOS DeviceSupport, and Archives
  5. CocoaPods - Removes pod caches and iOS artifacts
  6. App caches - Clears caches from VSCode, Chrome, Discord, and Slack
  7. Docker - Runs docker system prune -a -f to clean images and containers
  8. System logs - Removes user logs and system logs (with sudo)
  9. Trash & Downloads - Empties Trash and cleans old Downloads files
  10. Large files - Finds and deletes cache files larger than 1 GB
  11. Desktop screenshots - Removes screenshot files from Desktop
  12. Run ALL - Executes all cleanup operations sequentially

Usage

Users can now run CleanMac exactly as documented in the README:

# Quick run without downloading
bash <(curl -s https://raw.githubusercontent.com/shade-solutions/cleanmac/main/cleanmac.sh)

# Or save locally
curl -o ~/Desktop/cleanmac.sh https://raw.githubusercontent.com/shade-solutions/cleanmac/main/cleanmac.sh
chmod +x ~/Desktop/cleanmac.sh
./Desktop/cleanmac.sh

Technical Details

  • Script validation - Includes macOS detection to prevent accidental execution on other platforms
  • Error handling - Uses set -e and comprehensive error checking throughout
  • Safe operations - Never touches personal files (Documents, Pictures, etc.)
  • Permission awareness - Only prompts for sudo when necessary for system-level cleanup
  • Executable - Proper shebang (#!/usr/bin/env bash) and executable permissions set

This completes the implementation of the CleanMac tool as described in the repository README.

Closes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>create cleanmac.sh</issue_title>
<issue_description></issue_description>

<agent_instructions>create the bash script from readme that will contains all and extra features ac to readme
cleanmac.sh</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #2

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: SH20RAJ <66713844+SH20RAJ@users.noreply.github.com>
Copilot AI changed the title [WIP] create cleanmac.sh Create cleanmac.sh - Complete macOS cleanup script implementation Oct 5, 2025
Copilot finished work on behalf of SH20RAJ October 5, 2025 18:30
Copilot AI requested a review from SH20RAJ October 5, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create cleanmac.sh

2 participants