Command-line malware scanner for macOS โ Simple, fast, and transparent.
MacScan is an open-source CLI tool designed to scan your Mac for malware, adware, and potentially unwanted software. Built for power users and security researchers who prefer the terminal over bloated GUI applications.
- Quick Scan โ Scan common threat locations (Downloads, Desktop, Documents, Applications)
- Full System Scan โ Deep scan of your entire system
- Path Scan โ Scan specific directories
- Real-time Progress โ See current file being scanned with counter
- Quarantine โ Isolate and manage infected files safely
- Whitelist โ Exclude trusted paths from scans
- JSON Export โ Export scan results for automation
- macOS Notifications โ Native alerts on scan completion
- Interactive TUI โ Arrow-key menu navigation with keyboard shortcuts
- Lightweight โ Pure Bash with ClamAV backend
- Transparent โ Open source, no telemetry, no network requests
- Safe โ No auto-delete, all actions require confirmation
# Clone the repository
git clone https://github.com/artcc/macscan.git
cd macscan
# Run the installer
./install.shThe installer will check for dependencies and offer to install them:
- Homebrew โ Package manager for macOS (if not installed)
- ClamAV โ Open-source antivirus engine (if not installed)
The installer will also offer to initialize the virus database automatically.
If you prefer to install dependencies manually:
# Install Homebrew (if needed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install ClamAV
brew install clamav# Interactive mode (TUI menu)
ms
# Quick scan (common threat locations)
ms scan
# Scan a specific directory
ms scan --path ~/Downloads
# Full system scan
ms scan --full
# Preview what will be scanned (with whitelist)
ms scan --dry-run
# Silent scan with notification
ms scan --quiet --notify
# Export results to JSON
ms scan --export results.json
# Update virus signatures
ms update
# Show status and last scan info
ms status
# Manage whitelisted paths
ms whitelist list
ms whitelist add ~/safe-folder
# Manage quarantined files
ms quarantine list
ms quarantine restore <id>
# Uninstall MacScan
ms remove
# Show version and author info
ms version
ms author
# Show help
ms helpRun ms without any arguments to launch the interactive menu:
msThis opens a TUI with arrow key navigation:
__ __ ____
| \/ | __ _ ___/ ___| ___ __ _ _ __
| |\/| |/ _` |/ __\___ \ / __/ _` | '_ \
| | | | (_| | (__ ___) | (_| (_| | | | |
|_| |_|\__,_|\___|____/ \___\__,_|_| |_|
https://github.com/artcc/macscan
Command-line malware scanner for macOS
โถ 1. Quick Scan Scan common threat locations
2. Full Scan Deep scan of your entire system
3. Scan Path Scan a specific directory
4. Update Update virus database signatures
5. Status Show system status and last scan
6. Quarantine Manage quarantined files
7. Whitelist Manage excluded paths
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโ Navigate Enter Select H Help V Version A Author Q Quit
| Command | Description |
|---|---|
ms scan |
Quick scan of common threat locations |
ms scan --path <dir> |
Scan a specific directory |
ms scan --full |
Full system scan (takes longer) |
ms update |
Update ClamAV virus database |
ms status |
Show system status and last scan info |
ms quarantine |
Manage quarantined files |
ms whitelist |
Manage excluded paths |
ms remove |
Uninstall MacScan |
ms help |
Show help information |
ms version |
Show version information |
ms author |
Show author information |
| Option | Description |
|---|---|
-p, --path <dir> |
Specify directory to scan |
-f, --full |
Perform full system scan |
-v, --verbose |
Show detailed output |
-q, --quiet |
Suppress output (for scripts) |
--dry-run |
Show what would be scanned without scanning |
--no-color |
Disable colored output |
--notify |
Send macOS notification on completion |
--export <file> |
Export results to JSON file |
-h, --help |
Show help for a command |
MacScan follows the XDG Base Directory Specification:
/usr/local/bin/
โโโ macscan # Main command
โโโ ms # Short alias
~/.config/macscan/ # Configuration
โโโ config.conf # User settings
โโโ whitelist # Scan exclusions
โโโ bin/ # Installed scripts
โโโ lib/ # Library modules
~/.local/share/macscan/ # Persistent data
โโโ quarantine/ # Isolated threats
โโโ logs/ # Scan history
~/.cache/macscan/ # Temporary cache
โโโ last_scan # Last scan info
Configuration file: ~/.config/macscan/config.conf
# Example configuration
verbose=0
auto_update=1Exclude paths from scanning using the whitelist command:
# List whitelisted paths
ms whitelist list
# Add a path to whitelist
ms whitelist add ~/Library/Caches
# Remove a path from whitelist
ms whitelist remove ~/Library/Caches
# Edit whitelist manually
ms whitelist editOr edit the file directly at ~/.config/macscan/whitelist:
# Lines starting with # are comments
/path/to/exclude
/another/path
MacScan automatically warns you if the virus database is older than 7 days before each scan. Keep your database updated with:
ms updatemacscan/
โโโ bin/
โ โโโ macscan # Main entry point
โ โโโ ms # Alias script
โโโ lib/
โ โโโ core/
โ โ โโโ common.sh # Utilities and helpers
โ โ โโโ colors.sh # ANSI colors and formatting
โ โโโ scan/
โ โ โโโ clamav.sh # ClamAV wrapper
โ โโโ ui/
โ โโโ spinner.sh # Loading spinners
โ โโโ progress.sh # Progress bars
โโโ completions/
โ โโโ macscan.bash # Bash completion
โ โโโ _macscan # Zsh completion
โโโ docs/
โ โโโ TROUBLESHOOTING.md # Common issues
โโโ .github/
โ โโโ workflows/ci.yml # GitHub Actions
โโโ install.sh # Installer
โโโ uninstall.sh # Uninstaller
โโโ LICENSE # MIT License
โโโ README.md # This file
# Clone and enter directory
git clone https://github.com/artcc/macscan.git
cd macscan
# Run directly without installing
./bin/ms scan
./bin/ms --help# If installed
ms remove
# Or run the uninstaller directly
~/.config/macscan/uninstall.sh
# Or from the source directory
./uninstall.shThis will remove:
/usr/local/bin/macscanand/usr/local/bin/ms~/.config/macscan/~/.local/share/macscan/~/.cache/macscan/
Note: ClamAV is not removed. To remove it:
brew uninstall clamav
- Basic CLI structure
- ClamAV integration
- Quick/Full/Path scanning
- TUI with colors and progress
- Installer/Uninstaller
- Quarantine management
- Whitelist support (CLI)
- JSON export
- macOS notifications
- Shell completions (Bash/Zsh)
- Database age warning
- Dry-run mode
- Signal handling (Ctrl+C safety)
- GitHub Actions CI
- Interactive TUI menu
- macOS-specific malware hashes (Objective-See)
- Scheduled scans (launchd)
- Homebrew
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- ClamAV - Open source antivirus engine
- Mole - Inspiration for TUI design
- Objective-See - macOS security research
MacScan is provided "as is" without warranty of any kind, express or implied.
- No antivirus solution can detect 100% of malware. MacScan uses ClamAV's open-source virus database, which may not include the latest threats or macOS-specific malware.
- This tool is for educational and supplementary security purposes only. It should not replace macOS built-in security features (Gatekeeper, XProtect, Malware Removal Tool) or professional security solutions.
- False positives may occur. ClamAV may flag legitimate files as threats. Always verify before deleting.
- The authors are not responsible for any damage, data loss, or security incidents resulting from the use or misuse of this software.
- Use at your own risk. Always maintain current backups of important data.
By using MacScan, you acknowledge that you understand these limitations and accept full responsibility for its use on your system.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ for the macOS community
Built with GitHub Copilot (Claude Opus 4.5)
Arturo Carretero Calvo โ 2026