CLI tool to clear temporary and junk files from your Windows system.
Clears files from known safe locations — Temp folders and Windows Prefetch — with full control over what gets deleted. Built with extensibility for Mac/Linux support in the future.
- Node.js 16 or higher
- Windows OS (Mac/Linux support planned)
npm install -g sys-cache-clearOr run directly from the project folder:
npm install
node bin/sys-cache-clear.js --helpLists all known target cache folders without scanning them.
$ sys-cache-clear list
Cache Targets
temp C:\Users\You\AppData\Local\Temp
prefetch C:\Windows\Prefetch
Read-only scan. Shows file count and total size for each target folder. Does not delete anything.
$ sys-cache-clear scan
Scan Results
✔ temp scanned
📁 temp — 1,247 files, 523.41 MB
⚠ Skipping "prefetch" — requires Administrator privileges.
Total: 1,247 files, 523.41 MB
Scans all targets, shows a summary, asks for confirmation, then deletes files.
$ sys-cache-clear clean
Scanning targets...
✔ temp — 1,247 files, 523.41 MB
Found 1,247 files (523.41 MB) across 1 target(s).
? Delete 1,247 files (523.41 MB) from 1 target(s)? (y/N)
| Flag | Description |
|---|---|
--yes, -y |
Skip the confirmation prompt |
--dry-run |
Show exactly what would be deleted, but don't delete anything |
--target <name> |
Only clean a specific target (e.g. temp or prefetch) |
# Skip confirmation
sys-cache-clear clean --yes
# Preview what would be deleted
sys-cache-clear clean --dry-run
# Clean only the temp folder
sys-cache-clear clean --target temp
# Clean prefetch (requires Administrator)
sys-cache-clear clean --target prefetchPrints the current version.
Shows help text with all available commands and options.
The Windows Prefetch folder (C:\Windows\Prefetch) requires Administrator privileges to access. If you run sys-cache-clear without elevation, Prefetch will be skipped automatically with a warning message. To include it:
- Open Command Prompt or PowerShell as Administrator
- Run
sys-cache-clear clean
| Name | Path | Notes |
|---|---|---|
temp |
%TEMP% |
User's temp folder |
tmp |
%TMP% |
Only included if different from %TEMP% |
prefetch |
%WINDIR%\Prefetch |
Requires admin |
The tool never touches folders outside this defined list.
sys-cache-clear/
├── bin/
│ └── sys-cache-clear.js # CLI entry point (commander)
├── src/
│ ├── targets.js # OS-specific target definitions
│ ├── scanner.js # Recursive file scanner
│ ├── cleaner.js # File deletion with per-file error handling
│ ├── prompt.js # Confirmation prompt (inquirer)
│ ├── logger.js # Colored output (chalk)
│ └── utils.js # formatBytes, isAdmin
├── package.json
└── README.md
- No guessing: Only explicitly defined target folders are ever touched.
- Per-file try/catch: A single locked or permission-denied file is skipped — it never crashes the operation.
- Dry-run support: Always preview before deleting with
--dry-run. - Confirmation by default: The
cleancommand asks before deleting unless--yesis passed.
Found a bug or have a suggestion? Open an issue or submit a pull request on GitHub.
MIT