Easy cross-system development cache cleaner/manager with interactive configuration
Essentially a "universal cachectl"โsmart (sort of), safe (at least, I think it is...), and configurable cache cleaner/manager CLI-tool with support for most common development tools. Dsigned for easy integration expansion with additional tools (forks encouraged!).
Features โข Installation โข Usage โข Configuration โข Supported Tools โข Contributing
- ๐ฏ Smart Detection: Automatically detects installed development tools and their cache locations
- ๐จ Interactive Wizard: Beautiful CLI interface with progress bars and colored output
- ๐ก Real-Time Progress: Live parallel scanning status with animated indicators for 25+ tools simultaneously
- ๐ง Highly Configurable: Choose exactly which caches to clean and when
- ๐ Size Analytics: See how much space each cache is using before cleaning
- ๐ก๏ธ Safe by Default: Dry-run mode to preview what will be cleaned (v0.1.0+ defaults to dry-run)
- โก Performance: Parallel cleaning operations for maximum speed
- ๐ Auto-clean Mode: Schedule automatic cache cleaning based on your preferences
- ๐ฑ Cross-platform: Works on macOS, Linux, and Windows
- ๐ Config Migration: Automatic migration from legacy to new configuration format
- ๐ Plugin Support: Discover and use community cleaners via npm packages
- ๐ JSON Output: Machine-readable output for scripting and automation
- ๐ Auto-Update: Background update checking with easy self-update command
npm install -g squeaky-cleanOr using other package managers:
# Yarn
yarn global add squeaky-clean
# pnpm
pnpm add -g squeaky-clean
# Bun
bun add -g squeaky-cleannpm install --save-dev squeaky-cleanSqueaky Clean includes a built-in update command:
# Check for and install updates
squeaky update
# Only check for updates without installing
squeaky update --checkBy default, squeaky-clean will automatically check for updates once every 24 hours when you run any command. You can disable this with:
squeaky update --disable-autoStart the interactive configuration wizard:
squeaky interactiveThis will guide you through:
- Selecting which tools to clean
- Configuring cleaning preferences
- Setting up automatic cleaning schedules
squeaky clean --all# Clean only package manager caches
squeaky clean --types package-manager
# Clean multiple types
squeaky clean --types package-manager,build-tool
# Clean specific tools
squeaky clean npm yarn webpacksqueaky clean --all --dry-runsqueaky sizessqueaky list
# With sizes inline
squeaky list --sizes# View detailed cache categories
squeaky categories --tool npm
squeaky categories --verbose # Show all tools with details
# Clean caches older than 7 days
squeaky clean --older-than 7d
# Clean caches larger than 100MB
squeaky clean --larger-than 100MB
# Clean only low priority caches (preserve critical/important)
squeaky clean --priority low
# Clean archived/experimental caches
squeaky clean --use-case archived
# Combine multiple criteria
squeaky clean --older-than 14d --priority low --larger-than 50MB
# Clean specific categories by ID
squeaky categories --tool npm # First, list categories to get IDs
squeaky clean --categories npm-logs,npm-metrics
# Use custom config file
squeaky clean --config my-config.json --dry-run| Command | Description | Aliases |
|---|---|---|
clean |
Clean development caches with granular control | - |
list |
List available caches and their status | ls |
sizes |
Show cache sizes without clearing | - |
categories |
Show detailed cache categories with usage patterns | cats |
config |
Manage configuration | - |
doctor |
Check system and diagnose issues | - |
auto |
Configure automatic cleaning | - |
update |
Check for and install updates | - |
interactive |
Start interactive configuration wizard | i |
-a, --all- Clean all configured caches-t, --types <types>- Comma-separated list of cache types-e, --exclude <tools>- Comma-separated list of tools to exclude-d, --dry-run- Show what would be cleaned without actually cleaning-f, --force- Skip confirmation prompts-s, --sizes- Show cache sizes before cleaning
๐ฏ Granular Selection Options:
--older-than <age>- Clean caches older than specified age (e.g.,7d,2w,1m)--newer-than <age>- Clean caches newer than specified age--larger-than <size>- Clean caches larger than specified size (e.g.,100MB,1GB)--smaller-than <size>- Clean caches smaller than specified size--use-case <case>- Target specific use cases (development,testing,production,experimental,archived)--priority <level>- Clean only specified priority (critical,important,normal,low)--categories <ids>- Clean specific category IDs (comma-separated)
-t, --tool <tool>- Show categories for specific tool--type <type>- Filter by cache type-v, --verbose- Show detailed information
-s, --sizes- Include cache sizes inline with the list-t, --type <type>- Filter by cache type
-c, --check- Only check for updates without installing--auto-on- Enable automatic update checks on startup (--enable-auto/--enable-auto-updatealiases)--auto-off- Disable automatic update checks (--disable-auto/--disable-auto-updatealiases)
-v, --verbose- Enable verbose output--no-color- Disable colored output--config <path>- Use custom configuration file--version- Show version number-h, --help- Display help
| Tool | Caches Cleaned |
|---|---|
| npm | ~/.npm, node_modules/.cache |
| Yarn | ~/.yarn/cache, .yarn/cache |
| pnpm | ~/.pnpm-store, ~/.cache/pnpm |
| Bun | ~/.bun/install/cache |
| pip | ~/.cache/pip |
| Homebrew | brew --cache, old versions |
| Nix | /nix/store garbage, old generations |
| Tool | Caches Cleaned |
|---|---|
| Webpack | .webpack-cache, node_modules/.cache/webpack |
| Vite | node_modules/.vite, .vite-cache |
| Nx | node_modules/.cache/nx, .nx/cache |
| Turbo | .turbo, node_modules/.cache/turbo |
| Flutter | ~/.pub-cache, build/ |
| Tool | Caches Cleaned |
|---|---|
| VS Code | ~/.config/Code/Cache*, Extensions cache |
| Xcode | ~/Library/Developer/Xcode/DerivedData |
| Android Studio | ~/.android/cache, Build cache |
| JetBrains IDEs | ~/.cache/JetBrains/*/caches |
| Tool | Caches Cleaned |
|---|---|
| Chrome | Dev tools cache, Service workers |
| Firefox | Dev tools cache, Temporary files |
| Tool | Caches Cleaned |
|---|---|
| Docker | Unused containers, images, volumes |
| Gradle | ~/.gradle/caches, .gradle/ |
Squeaky Clean can be configured through:
- Interactive wizard:
squeaky interactive - Configuration file:
~/.squeaky-clean/config.json - Environment variables:
SQUEAKY_*
Squeaky Clean now supports automatic migration from legacy configuration format to the new schema:
# Migrate your config automatically
squeaky config doctor
# Or use the doctor command
squeaky doctor --config
# Preview migration without changing files
squeaky config doctor --dry-run
# Migrate to a different file
squeaky config doctor --input old-config.json --output new-config.json{
"cleaners": {
"npm": { "enabled": true },
"yarn": { "enabled": true },
"webpack": { "enabled": false }
},
"scheduler": {
"enabled": true,
"interval": "weekly",
"thresholds": {
"size": "1GB",
"age": "30d"
}
},
"defaults": {
"verbose": false,
"colors": true,
"format": "text"
}
}{
"tools": {
"npm": { "enabled": true },
"yarn": { "enabled": true },
"webpack": { "enabled": false }
},
"auto": {
"enabled": true,
"schedule": "weekly",
"sizeThreshold": "1GB"
},
"output": {
"verbose": false,
"useColors": true
}
}SQUEAKY_AUTO_CLEAN- Enable automatic cleaningSQUEAKY_DRY_RUN- Always run in dry-run modeSQUEAKY_VERBOSE- Enable verbose outputSQUEAKY_NO_COLOR- Disable colored output
Configure automatic cache cleaning based on:
- Schedule: Daily, weekly, or monthly
- Size threshold: Clean when caches exceed a certain size
- Smart detection: Clean only when tools haven't been used recently
# Configure automatic cleaning
squeaky auto
# Enable with weekly schedule
squeaky auto --enable --schedule weekly
# Set size threshold
squeaky auto --size-threshold 5GBSqueaky Clean is built with a modular architecture:
src/
โโโ cli.ts # CLI entry point
โโโ commands/ # Command implementations
โ โโโ clean.ts # Main cleaning logic
โ โโโ interactive.ts # Interactive wizard
โ โโโ config.ts # Configuration management
โ โโโ ...
โโโ cleaners/ # Tool-specific cleaners
โ โโโ npm.ts
โ โโโ docker.ts
โ โโโ ...
โโโ config/ # Configuration system
โโโ utils/ # Utility functions
โโโ types/ # TypeScript definitions
Each cleaner module implements the CleanerModule interface:
interface CleanerModule {
name: string;
type: CacheType;
description: string;
getCacheInfo(): Promise<CacheInfo>;
clear(dryRun?: boolean): Promise<ClearResult>;
}- Node.js >= 16.0.0
- npm, yarn, pnpm, or bun
# Clone the repository
git clone https://github.com/justinchen/squeaky-clean.git
cd squeaky-clean
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devnpm run build- Build the TypeScript sourcenpm run dev- Run in development mode with hot reloadnpm test- Run testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Generate test coverage reportnpm run lint- Lint the codebasenpm run format- Format code with Prettiernpm run release- Run tests/build, publish to npm, and sync the GitHub release (requires theghCLI +GH_TOKENorGITHUB_TOKENto be set)
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageContributions 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 some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
To add support for a new tool:
- Create a new cleaner module in
src/cleaners/ - Implement the
CleanerModuleinterface - Register it in
src/cleaners/index.ts - Add tests in
src/__tests__/cleaners/ - Update the README with the new tool
This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
- Commander.js for CLI parsing
- Chalk for puuurrrtty terminal output
- Inquirer.js for interactive prompts
- Ora for elegant terminal spinners
- ๐ Report bugs
- ๐ก Request features
- ๐ Read the docs
- โญ Star the project on GitHub!