Introducing cnkill: Reclaim Disk Space from vendor and node_modules
cnkill is a blazing fast, interactive PHP TUI that finds and deletes vendor, node_modules, and cache directories across your old projects.
Every developer knows the feeling: your disk is full and you have no idea why. The answer is almost always the same — a graveyard of old projects, each quietly hoarding a vendor/, node_modules/, or target/ directory that hasn't been touched in months. Individually they're easy to ignore; together they eat dozens of gigabytes.
That's why I built cnkill — a blazing fast, interactive TUI that scans your projects for dependency and cache directories and lets you delete them on demand. Think npkill, but not limited to node_modules: it speaks PHP, JavaScript, Rust, and the big frameworks' caches too.
What it does
Point it at a folder and it streams every dependency and cache directory it finds, with sizes, sorted the way you want. Navigate with the keyboard, hit Space on anything you want gone, and move on with your life.
Sixteen built-in targets
cnkill ships with 16 targets, 12 enabled out of the box:
PHP:
vendor/JavaScript:
node_modules/,.next/,.expo/,.turbo/,.svelte-kit/,.nuxt/,.parcel-cache/,coverage/,.output/Rust:
target/General caches:
.cache/
Four more — dist, build, DerivedData, and android/build — ship disabled by default, because those are sometimes worth keeping. And if your stack has a directory cnkill doesn't know about, a four-step wizard registers custom targets (folder name or pattern, label, manifest files, lock files) without touching a config file by hand.
Getting started
On Linux and macOS, the standalone binary is the recommended install:
curl -fsSL https://raw.githubusercontent.com/barnphp/cnkill/master/install.sh | shOr grab it with cpx or Composer:
cpx barnphp/cnkill
composer global require barnphp/cnkillEveryday usage
cnkill # scan the current directory
cnkill /path/to/projects # scan a specific tree
cnkill /path/to/projects --node # node_modules only
cnkill /path/to/projects --composer
cnkill /path/to/projects --rust
cnkill /path/to/projects --sort=size --maxdepth=4
cnkill cache --sort=modifiedIn the TUI: ↑/↓ to navigate, ←/→ to page, s to cycle sort mode, Shift+S to flip direction, Space to delete the highlighted directory, q to quit.
Configurable without being fussy
Settings live at ~/.config/cnkill/config.json (XDG respected), and per-run flags like --node and --composer override the saved config for a single invocation — no config editing just to do one targeted sweep.
What's next
The roadmap includes async size calculation and deletion, Windows support, and automated release binaries. It's MIT-licensed, tested in CI, and contributions are welcome — check out the repo on GitHub.
Interested in more posts ?
Here are some other posts you might be interested in.