This script is an open-source alternative for App Cleaner on Mac OS
The script is created following Sun Knudsen's How to clean uninstall macOS apps using AppCleaner open source alternative tutorial. The repo is set up so that people can clone and contribute to make it better.
Watch this demo to see the uninstall script in action:
To install, simply run the following command in your terminal:
curl -fsSL https://raw.githubusercontent.com/bradflaugher/uninstall-cli/main/install.sh | bashTo uninstall an application, run the uninstall command followed by the path to the application:
uninstall /Applications/YourApp.appThe script will:
- Extract app information (name, bundle ID, etc.)
- Search for all related files and folders
- Display results grouped by search term
- Provide interactive options to refine the search
- Ask for confirmation before permanently removing files
- Use
sudo rm -rfto completely remove all associated files
Note: Files are permanently deleted, not moved to trash.
After viewing the search results, you'll see these options:
- y - Proceed with deletion
- s - Switch to stricter search (fewer items)
- a - Switch to more aggressive search (more items)
- e - Add exclude pattern to filter out unwanted matches
- n - Cancel
This allows you to refine the search until you're satisfied with the results.
Example workflow:
$ uninstall /Applications/OneDrive.app
# See results including Microsoft Teams, Excel, etc.
# Choose 's' to switch to strict mode
# Now only OneDrive-specific files are shown
# Choose 'y' to proceed with deletionControl how aggressively the script searches for related files using the --mode flag:
Only searches for exact bundle ID matches:
uninstall --mode strict /Applications/OneDrive.appSearches for: com.microsoft.OneDrive-mac only
Searches for bundle ID and app names, but excludes company names:
uninstall --mode normal /Applications/OneDrive.app
# or simply:
uninstall /Applications/OneDrive.appSearches for: OneDrive, com.microsoft.OneDrive-mac, OneDrive-mac
Won't match: microsoft (prevents catching Teams, Excel, etc.)
Includes bundle ID components like company names:
uninstall --mode aggressive /Applications/OneDrive.appSearches for: OneDrive, microsoft, OneDrive-mac, com.microsoft.OneDrive-mac
Warning: May catch related applications from the same company
Filter out specific matches using the --exclude flag (can be used multiple times):
# Exclude Teams and Excel files
uninstall --exclude teams --exclude excel /Applications/OneDrive.app
# Exclude any path containing "word"
uninstall --exclude word /Applications/Office.appFor automation or scripting, use the -y flag to automatically confirm all prompts:
uninstall -y /Applications/YourApp.app
# Combine with other flags
uninstall -y --mode strict /Applications/YourApp.app
uninstall -y --exclude pattern1 --exclude pattern2 /Applications/YourApp.app# Safe uninstall - only exact bundle ID matches
uninstall --mode strict /Applications/Slack.app
# Default uninstall - balanced approach
uninstall /Applications/Discord.app
# Aggressive uninstall - find everything related
uninstall --mode aggressive /Applications/Adobe.app
# Exclude specific patterns
uninstall --exclude creative-cloud /Applications/Photoshop.app
# Non-interactive strict mode
uninstall -y --mode strict /Applications/TestApp.appTo uninstall this tool, run the following command:
sudo rm /usr/local/bin/uninstallThis project includes a test suite using pytest. To run the tests:
# Install test dependencies
pip install -r requirements-test.txt
# Run tests
pytest tests/ -vNote: Full integration tests require macOS as they test macOS-specific functionality like plist parsing and file discovery.
The project uses GitHub Actions to automatically run tests on every commit. The CI pipeline runs on macOS to ensure full compatibility testing.
