When downloading Cleanser directly on macOS, you'll need to authorize the app since it's not signed with an Apple Developer certificate.
Installing the Desktop App (.dmg)
Download the .dmg file for your Mac (Apple Silicon or Intel)
Double-click the .dmg to open it
Drag Cleanser to the Applications folder
Try to open Cleanser - macOS will show a security warning
Open System Settings β Privacy & Security
Scroll down to find the message about Cleanser being blocked
Click "Open Anyway"
Confirm by clicking "Open" in the dialog
Why does this happen?
macOS Gatekeeper blocks apps from unidentified developers. Since Cleanser is open-source and not signed with a paid Apple Developer certificate, you need to manually authorize it. This is a one-time process.
Installing the CLI (.tar.gz)
# Extract the archivetar -xzf cleanser-*.tar.gz# Move to a directory in your PATHsudo mv cleanser /usr/local/bin/# Remove quarantine attribute (bypass Gatekeeper)sudo xattr -d com.apple.quarantine /usr/local/bin/cleanser
Alternative: Homebrew
The easiest way to install on macOS is via Homebrew: brew tap phpfc/cleanser && brew install cleanser. This handles all the signing automatically.
Quick Start
Get up and running with Cleanser in seconds:
# Scan your system for cleanable filescleanser scan# Preview what would be deletedcleanser clean --dry-run# Clean safe items onlycleanser clean --risksafe
Tip
Always use --dry-run first to preview what will be deleted before running the actual clean command.
scan
Scan the filesystem for cleanable files and directories.
cleanser scan [OPTIONS]Primary
Analyzes your filesystem to find files that can be safely deleted, including caches, temporary files, build artifacts, and large files.
Option
Description
Default
-s, --speed <SPEED>
Scan speed: quick, normal, or thorough
normal
-p, --paths <PATHS>
Specific paths to scan
$HOME
--ignore <PATTERNS>
Directories to exclude from scanning
-
--min-size <MB>
Minimum file size in MB for large file detection
100
--size-range <RANGE>
Filter by size range (e.g., 100MB-500MB)
-
--older-than <DURATION>
Only files older than duration (e.g., 90d, 2w, 6m)
-
--newer-than <DURATION>
Only files newer than duration
-
--max-depth <N>
Maximum depth for directory traversal
-
--find-duplicates
Find duplicate files
false
--interactive
Launch interactive TUI browser
false
--json
Output results as JSON
false
--no-cache
Don't save scan results to cache
false
Scan Speed Levels
Speed
Description
Depth
quick
Fast scan for immediate results
3
normal
Balanced scan
6
thorough
Deep scan for comprehensive results
unlimited
clean
Delete files based on risk level.
cleanser clean [OPTIONS]Destructive
Deletes files found by the scan command based on the specified risk level. Uses cached scan results by default.
Option
Description
Default
-r, --risk <LEVEL>
Maximum risk level: safe, moderate, or risky
safe
-y, --yes
Skip confirmation prompts
false
--dry-run
Preview what would be deleted without deleting
false
--force-scan
Force a fresh scan instead of using cache
false
--interactive
Review and select files interactively
false
--trash
Move files to trash instead of permanent deletion
false
--secure
Securely overwrite files before deletion (DoD 5220.22-M)
false
--secure-passes <N>
Number of overwrite passes (1-35)
3
Deletion Methods
Method
Description
Speed
Standard
Normal filesystem deletion (default)
Fastest
Trash (--trash)
Move to recoverable trash
Fast
Secure (--secure)
Overwrite with zeros, ones, then random data
Slower
Warning
Standard and secure deletion permanently remove files. Use --dry-run first to preview, or --trash for recoverable deletion.
map
Manage the intelligent filesystem map for faster scans.
cleanser map <ACTION>Utility
Cleanser builds an intelligent map of your filesystem to enable faster repeated scans and better classification of directories.
Actions
Action
Description
show
View mapped directories and summary
stats
Detailed breakdown by category and type
rebuild
Force rebuild the filesystem map
verify
Check if mapped paths still exist
suggest
Suggest paths to add to whitelist
Rebuild Options
Option
Description
Default
--max-depth <N>
Maximum depth for scanning
10
--min-confidence <F>
Minimum confidence level (0.0-1.0)
0.6
whitelist
Manage permanent exclusions from scanning and cleaning.
cleanser whitelist <ACTION>Config
Paths added to the whitelist will never be scanned or included in clean operations.
Action
Description
add <PATH>
Add a path to the whitelist
remove <PATH>
Remove a path from the whitelist
list
Show all whitelisted paths
# Protect an important directorycleanser whitelist add ~/important-project# View all protected pathscleanser whitelist list
cache
Manage scan result cache.
cleanser cache <ACTION>Utility
Cleanser caches scan results to speed up subsequent clean operations.
Action
Description
show
View cache information (age, items, size)
clear
Clear the scan cache
trash
Manage the recoverable trash instead of permanently deleting files.
cleanser trash <ACTION>Recovery
Move files to a recoverable trash instead of permanently deleting them. Items in trash can be restored or permanently deleted later.
Action
Description
list
Show all items in trash with size and age
restore <ID>
Restore an item to its original location
delete <ID>
Permanently delete an item from trash
empty
Permanently delete all items in trash
stats
Show trash statistics and location
Options
Option
Description
--to <PATH>
Restore to a custom location instead of original
--secure
Use secure deletion when emptying trash
-y, --yes
Skip confirmation when emptying
--json
Output as JSON
# Clean files to trash instead of permanent deletioncleanser clean --trash# View items in trashcleanser trash list# Restore a file (use ID from list)cleanser trash restore abc12345# Empty trash to free spacecleanser trash empty
Trash Location
Trash is stored in ~/.cleanser/trash/. Use cleanser trash stats to see the exact location and total size.
schedule
Automate disk cleanup with scheduled jobs using your system's native scheduler.
cleanser schedule <ACTION>Automation
Create, manage, and run automated cleanup jobs. Uses platform-specific schedulers: launchd (macOS), systemd (Linux), or Task Scheduler (Windows).
Action
Description
set <NAME>
Create a new scheduled job
list
Show all scheduled jobs
remove <NAME>
Delete a scheduled job
enable <NAME>
Enable a disabled job
disable <NAME>
Temporarily disable a job
run <NAME>
Run a job immediately
history
Show job execution history
Schedule Frequencies
Format
Description
Example
daily
Run once per day at midnight
daily
daily@HH:MM
Run daily at specific time
daily@14:30
weekly
Run once per week (Sunday)
weekly
weekly@DAY
Run weekly on specific day
weekly@friday
monthly
Run on the 1st of each month
monthly
every Xh
Run every X hours
every 6h
cron
Standard cron expression
0 3 * * 0
Job Options
Option
Description
Default
-f, --frequency
Schedule frequency (required)
-
-r, --risk
Maximum risk level to clean
safe
-p, --paths
Specific paths to clean
$HOME
--trash
Move to trash instead of delete
false
--secure
Use secure deletion
false
--notify
Send notification on completion
false
# Create a daily cleanup jobcleanser schedule set daily-cleanup-fdaily@03:00# Weekly cleanup with moderate risk levelcleanser schedule set weekly-deep-fweekly@sunday-rmoderate# Cleanup every 6 hours, moving to trashcleanser schedule set frequent-f"every 6h"--trash# List all scheduled jobscleanser schedule list# View execution historycleanser schedule history# Run a job manuallycleanser schedule run daily-cleanup
Platform Integration
Platform
Scheduler
Config Location
π macOS
launchd
~/Library/LaunchAgents/
π§ Linux
systemd
~/.config/systemd/user/
πͺ Windows
Task Scheduler
System Task Scheduler
Best Practice
Schedule cleanup jobs during off-hours (e.g., 3 AM) to avoid interfering with your work. Use the --trash flag initially to allow recovery if needed.
Desktop Application
Cleanser also comes as a desktop GUI application, built with Tauri and React. It provides a visual interface for disk cleanup with all the power of the CLI.
Features
Feature
Description
Scan View
Visual overview of cleanable files grouped by category with size breakdown
Great for developers - can be rebuilt with package managers
Risky
Large files (> 100MB), duplicate files
Review carefully before deleting
Smart Validation
Build directories are validated against project files. For example, target/ is only flagged if Cargo.toml exists in the parent directory.
Platform Support
Cleanser works on all major operating systems and automatically detects platform-specific cache locations.
Platform
Cache Locations
π macOS
~/Library/Caches, ~/.cache, ~/Library/Logs
π§ Linux
~/.cache, XDG paths, /var/log
πͺ Windows
%LOCALAPPDATA%, %TEMP%
Examples
Common usage patterns for Cleanser.
Basic Usage
# Quick scan of your home directorycleanser scan# Preview safe deletionscleanser clean --dry-run# Clean safe items with confirmationcleanser clean --risksafe
Developer Workflow
# Scan your projects directorycleanser scan --paths~/Projects# Clean build artifacts (node_modules, target, etc.)cleanser clean --riskmoderate# Protect important project from cleaningcleanser whitelist add ~/Projects/production-app
Finding Large Files
# Find files larger than 500MBcleanser scan --min-size500# Find files between 100MB and 1GBcleanser scan --size-range100MB-1GB# Find old large files (not modified in 90 days)cleanser scan --min-size100--older-than90d
Interactive Mode
# Browse and select files to delete with TUIcleanser scan --interactive# Interactively review files by risk levelcleanser clean --riskmoderate--interactive
Finding Duplicates
# Find duplicate filescleanser scan --find-duplicates# Output results as JSON for scriptingcleanser scan --find-duplicates--json
Automation
# Clean safe items without prompts (for scripts/cron)cleanser clean --risksafe-y# Force fresh scan before cleaningcleanser clean --force-scan--risksafe-y
Permanent Deletion
Cleanser permanently deletes files. They cannot be recovered from the trash. Always use --dry-run first and consider backing up important data.