Skip to content

Repository files navigation

 █████████ ██████ █████ █████ ████ █████ █████ █████
 ███░░░░░██ ░██████ ░███ ░███ ███░ ░███ ░███ ░███
 ███ ░░░ ░███░███ ░███ ░███ ███ ░███ ░███ ░███
░███ ░███░░███░███ ░███████ ░███ ░███ ░███
░███ ░███ ░░██████ ░███░░███ ░███ ░███ ░███
░░███ ███ ░███ ░░█████ ░███ ░░███ ░███ ░███ █ ░███ █
 ░░█████████ █████ ░░█████ █████ ░░████ █████ ███████████ ███████████
 ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░ ░░░░░ ░░░░░░░░░░░ ░░░░░░░░░░░

Latest Version on PackagistGitHub Tests Action StatusGitHub Code Style Action StatusTotal Downloads

A Blazing Fast, Interactive TUI tool (like npkill) to find and delete vendor/ and node_modules/ directories in your old projects — freeing up disk space fast.

Installation && Update

We provide multiple installation methods to suit your preferences. The recommended way is the standalone executable for Linux and macOS.

  1. Quick install (Linux/macOS, standalone executable):
curl -fsSL https://raw.githubusercontent.com/barnphp/cnkill/master/install.sh | sh
  1. System-wide install (requires sudo):
curl -fsSL https://raw.githubusercontent.com/barnphp/cnkill/master/install.sh | sh -s -- --system
  1. Install via cpx (the npx for PHP):
cpx barnphp/cnkill
  1. Install globally via Composer:
composer global require barnphp/cnkill

You will find it installed in ~/.composer/vendor/bin or ~/.config/composer/vendor/bin. Add it to your PATH or create an alias:

alias cnkill="~/.composer/vendor/bin/cnkill"# oralias cnkill="~/.config/composer/vendor/bin/cnkill"

Usage

cnkill [path: defaults to current path] [options]
## Examples
cnkill # find both vendor/ and node_modules/ in current path
cnkill /path/to/projects # find both vendor/ and node_modules/ in a specific path
cnkill /path/to/projects --node # find node_modules/ only
cnkill /path/to/projects --composer # find vendor/ only
cnkill /path/to/projects --sort=size # sort by size
cnkill /path/to/projects --maxdepth=4 # limit search depth
cnkill /path/to/projects --rust # find target/ (Rust Cargo) directories only
cnkill cache --sort=modified # sort caches by last modified

Configuration

cnkill stores its configuration at ~/.config/cnkill/config.json (respects $XDG_CONFIG_HOME).

Use the config command to manage which targets are scanned and to define custom ones.

Toggle enabled targets

cnkill config

Opens an interactive multi-select list of all known targets (built-in and custom). Use Space to toggle a target on or off, Enter to save, and q to quit without saving.

Add a custom target

cnkill config add

Runs an interactive 4-step wizard:

  1. Folder name or pattern — a simple name (e.g. .venv) or a wildcard path pattern (e.g. */ios/build)
  2. Label — human-readable name shown in cnkill config
  3. Manifest files — comma-separated files that must exist in the parent directory to confirm it's a real project (e.g. pyproject.toml, requirements.txt); leave blank to match any
  4. Lock / reference files — files used to determine the "last modified" timestamp; defaults to manifests if left blank

After the wizard, the new target is saved and automatically enabled.

Remove a custom target

cnkill config remove

Presents a list of user-defined custom targets. Select one and confirm to delete it.

Built-in targets

TargetDirectoryEnabled by default
vendorvendor (Composer)Yes
nodenode_modules (npm/pnpm/yarn/bun)Yes
next.next (Next.js build output)Yes
expo.expo (Expo / React Native)Yes
turbo.turbo (Turborepo cache)Yes
svelte-kit.svelte-kit (SvelteKit)Yes
nuxt.nuxt (Nuxt build output)Yes
cache.cache (generic tool cache)Yes
parcel-cache.parcel-cache (Parcel bundler)Yes
coveragecoverage (test coverage reports)Yes
output.output (Nitro / Nuxt server output)Yes
rusttarget (Cargo build output)Yes
distdist (build distribution)No
buildbuild (generic build output)No
derived-dataDerivedData (Xcode)No
androidandroid/build (Android / Gradle)No

Note: Per-run flags like --node and --composer override the saved config for that invocation only.

Controls

KeyAction
/ Navigate the list
/ Page through the list
sCycle sort mode
Shift + sToggle sort direction
SpaceDelete the highlighted directory
q / Ctrl-CQuit

Roadmap

  • Interactive TUI with real-time streaming results
  • Support for vendor/ directories (Composer)
  • Support for node_modules/ directories (npm/yarn)
  • Async size calculation and deletion
  • Add support for Windows
  • Add a build workflow to publish release binaries automatically
  • ... share your ideas in the issues

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please open an issue to report any security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Save disk space by removing (php) vendor, node_modules, and cache directories from old projects on your machine.

Topics

Resources

Contributing

Stars

5 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages