โจ Easy, customizable and expandable development cache cleaner CLI with interactive configuration! Smart, safe, and configurable cache management for 25+ development tools.
npm install squeaky-cleanEasy 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
``bash`
npm install -g squeaky-clean
Or using other package managers:
`bashYarn
yarn global add squeaky-clean
$3
`bash
npm install --save-dev squeaky-clean
`$3
Squeaky Clean includes a built-in update command:
`bash
Check for and install updates
squeaky updateOnly check for updates without installing
squeaky update --check
`By default, squeaky-clean will automatically check for updates once every 24 hours when you run any command. You can disable this with:
`bash
squeaky update --disable-auto
`Usage
$3
Start the interactive configuration wizard:
`bash
squeaky interactive
`This will guide you through:
- Selecting which tools to clean
- Configuring cleaning preferences
- Setting up automatic cleaning schedules
$3
#### Clean all caches
`bash
squeaky clean --all
`#### Clean specific cache types
`bash
Clean only package manager caches
squeaky clean --types package-managerClean multiple types
squeaky clean --types package-manager,build-toolClean specific tools
squeaky clean npm yarn webpack
`#### Dry run mode (preview without cleaning)
`bash
squeaky clean --all --dry-run
`#### Show cache sizes
`bash
squeaky sizes
`#### List available caches
`bash
squeaky list
With sizes inline
squeaky list --sizes
`#### ๐ฏ Granular Cache Management
`bash
View detailed cache categories
squeaky categories --tool npm
squeaky categories --verbose # Show all tools with detailsClean caches older than 7 days
squeaky clean --older-than 7dClean caches larger than 100MB
squeaky clean --larger-than 100MBClean only low priority caches (preserve critical/important)
squeaky clean --priority lowClean archived/experimental caches
squeaky clean --use-case archivedCombine multiple criteria
squeaky clean --older-than 14d --priority low --larger-than 50MBClean specific categories by ID
squeaky categories --tool npm # First, list categories to get IDs
squeaky clean --categories npm-logs,npm-metricsUse custom config file
squeaky clean --config my-config.json --dry-run
`$3
| 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 |$3
####
clean Options-
-a, --all - Clean all configured caches
- -t, --types - Comma-separated list of cache types
- -e, --exclude - 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 - Clean caches older than specified age (e.g., 7d, 2w, 1m)
- --newer-than - Clean caches newer than specified age
- --larger-than - Clean caches larger than specified size (e.g., 100MB, 1GB)
- --smaller-than - Clean caches smaller than specified size
- --use-case - Target specific use cases (development, testing, production, experimental, archived)
- --priority - Clean only specified priority (critical, important, normal, low)
- --categories - Clean specific category IDs (comma-separated)####
categories Options-
-t, --tool - Show categories for specific tool
- --type - Filter by cache type
- -v, --verbose - Show detailed information####
list Options-
-s, --sizes - Include cache sizes inline with the list
- -t, --type - Filter by cache type####
update Options-
-c, --check - Only check for updates without installing
- --auto-on - Enable automatic update checks on startup (--enable-auto/--enable-auto-update aliases)
- --auto-off - Disable automatic update checks (--disable-auto/--disable-auto-update aliases)#### Global Options
-
-v, --verbose - Enable verbose output
- --no-color - Disable colored output
- --config - Use custom configuration file
- --version - Show version number
- -h, --help - Display help๐ ๏ธ Supported Tools
$3
| 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 |$3
| 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/ |$3
| 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 |$3
| Tool | Caches Cleaned |
|------|----------------|
| Chrome | Dev tools cache, Service workers |
| Firefox | Dev tools cache, Temporary files |
$3
| Tool | Caches Cleaned |
|------|----------------|
| Docker | Unused containers, images, volumes |
| Gradle |
~/.gradle/caches, .gradle/ |โ๏ธ Configuration
Squeaky Clean can be configured through:
1. Interactive wizard:
squeaky interactive
2. Configuration file: ~/.squeaky-clean/config.json
3. Environment variables: SQUEAKY_*$3
Squeaky Clean now supports automatic migration from legacy configuration format to the new schema:
`bash
Migrate your config automatically
squeaky config doctorOr use the doctor command
squeaky doctor --configPreview migration without changing files
squeaky config doctor --dry-runMigrate to a different file
squeaky config doctor --input old-config.json --output new-config.json
`$3
#### New Schema (v0.2.0+)
`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"
}
}
`#### Legacy Schema (still supported)
`json
{
"tools": {
"npm": { "enabled": true },
"yarn": { "enabled": true },
"webpack": { "enabled": false }
},
"auto": {
"enabled": true,
"schedule": "weekly",
"sizeThreshold": "1GB"
},
"output": {
"verbose": false,
"useColors": true
}
}
`$3
-
SQUEAKY_AUTO_CLEAN - Enable automatic cleaning
- SQUEAKY_DRY_RUN - Always run in dry-run mode
- SQUEAKY_VERBOSE - Enable verbose output
- SQUEAKY_NO_COLOR - Disable colored output๐ Automatic Cleaning
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
`bash
Configure automatic cleaning
squeaky autoEnable with weekly schedule
squeaky auto --enable --schedule weeklySet size threshold
squeaky auto --size-threshold 5GB
`๐๏ธ Architecture
Squeaky 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:`typescript
interface CleanerModule {
name: string;
type: CacheType;
description: string;
getCacheInfo(): Promise;
clear(dryRun?: boolean): Promise;
}
`๐งช Development
$3
- Node.js >= 16.0.0
- npm, yarn, pnpm, or bun
$3
`bash
Clone the repository
git clone https://github.com/justinchen/squeaky-clean.git
cd squeaky-cleanInstall dependencies
npm installBuild the project
npm run buildRun in development mode
npm run dev
`$3
-
npm run build - Build the TypeScript source
- npm run dev - Run in development mode with hot reload
- npm test - Run tests
- npm run test:watch - Run tests in watch mode
- npm run test:coverage - Generate test coverage report
- npm run lint - Lint the codebase
- npm run format - Format code with Prettier
- npm run release - Run tests/build, publish to npm, and sync the GitHub release (requires the gh CLI + GH_TOKEN or GITHUB_TOKEN to be set)$3
`bash
Run all tests
npm testRun tests in watch mode
npm run test:watchGenerate coverage report
npm run test:coverage
`๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature)
5. Open a Pull Request$3
To add support for a new tool:
1. Create a new cleaner module in
src/cleaners/
2. Implement the CleanerModule interface
3. Register it in src/cleaners/index.ts
4. Add tests in src/__tests__/cleaners/`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!
---