A CLI tool to safely nuke development and build caches across multiple languages and frameworks.
Join our Discord community for discussions, support, and updates:
- One command to safely clean dev/build caches
- Smart detection of project types and relevant caches
- Safe operations with timestamped backups
- Cross-platform (macOS, Linux, Windows)
- JSON output for scripting and automation
- CI/CD integration with GitHub Actions, GitLab CI, and CircleCI
- Specialized integrations for HuggingFace, PyTorch, Vercel, and Cloudflare
- Advanced NPX analysis with per-package visibility and stale detection
- Enhanced edge cache purging with improved API integration
- System diagnostics with
--doctorcommand
git clone https://github.com/kagehq/cachekill.git
cd cachekill
cargo build --releasecargo install cachekill# List all caches
./target/release/cachekill --list
# Show what would be cleaned
./target/release/cachekill --dry-run
# Clean with confirmation
./target/release/cachekill
# Clean specific language
./target/release/cachekill --lang js
# Include Docker and NPX
./target/release/cachekill --docker --npx
# JSON output for scripting
./target/release/cachekill --list --json
# System diagnostics
./target/release/cachekill --doctor
# CI mode for automation
./target/release/cachekill --ci prebuild
./target/release/cachekill --ci postbuild
# Specialized integrations
./target/release/cachekill --hf --list
./target/release/cachekill --torch
./target/release/cachekill --vercel --list
./target/release/cachekill --cloudflare
# Advanced NPX analysis with per-package details
./target/release/cachekill --npx --list
# NPX cache management
./target/release/cachekill --npx --dry-run # Preview what would be cleaned
./target/release/cachekill --npx --force # Nuclear option - clear all NPX caches
./target/release/cachekill --npx --stale-days 7 --force # Surgical - only stale packages- JavaScript/TypeScript:
node_modules/,.next/,.vite/ - Python:
__pycache__/,.venv/,.pytest_cache/ - Rust:
target/,.cargo/ - Java:
.gradle/,build/,~/.m2/repository - Machine Learning:
~/.cache/huggingface,~/.cache/torch - NPX:
~/.npm/_npx - Docker: Images, containers, volumes
- HuggingFace: Model caches, datasets, and repositories with detailed analysis
- PyTorch: Checkpoints, hub models, and datasets with version tracking
- NPX: Per-package analysis with name, version, size, and stale detection
- Vercel: Enhanced edge cache purging with improved API integration
- Cloudflare: Enhanced edge cache purging with zone-specific targeting
CacheKill provides detailed per-package analysis for NPX caches:
# Analyze NPX packages with detailed breakdown
./target/release/cachekill --npx --list
# Output shows:
# - Package name and version
# - Size and last-used timestamp
# - Stale detection (configurable threshold)
# - Sorted by size (largest first)
# - Summary statisticsCreate a .cachekillrc file in your project root:
default_lang = "auto"
stale_days = 14
safe_delete = true
backup_dir = ".cachekill-backup"
exclude_paths = [".git", ".cachekill-backup"]- uses: ./.github/actions/cachekill
with:
mode: 'postbuild'
args: '--docker --npx'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}include:
- local: 'ci/gitlab-cachekill.yml'
variables:
CACHEKILL_ARGS: "--docker --npx"orbs:
cachekill: cachekill/[email protected]
workflows:
build:
jobs:
- cachekill/prebuild
- build
- cachekill/postbuild- Safe Delete: Moves caches to timestamped backup directory
- Stale Detection: Configurable threshold (default: 14 days)
- Project Detection: Automatically detects project type
- Restore: Use
--restore-lastto restore from backup
- Always use
--dry-runfirst to see what will be cleaned - Use
--listto understand your cache usage before cleaning - Configure
.cachekillrcfor project-specific settings - Use
--restore-lastif a build fails after cleanup
For detailed documentation, see DETAILED.md.
This project is licensed under the FSL-1.1-MIT License. See the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run
make test - Submit a pull request