npkill CLI
The CLI locates large dependency directories for selected removal, with JSON output an agent can use to plan cleanup.
- 9,500 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Selected directories are deleted from disk; automatic flags can remove all matches within the search scope.
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/npkillDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Selected directories are deleted from disk; automatic flags can remove all matches within the search scope.
This is third-party code. Review the repository files before installing.
What it does
npkill searches for node_modules from a selected directory and shows disk usage. Users inspect candidates and select dependencies to remove, with project modification information to help identify older folders. JSON and streaming JSON let an agent prepare an inventory. Dry runs, exclusions and custom directory names support scoped cleanup decisions based on each path’s purpose.
Who it is for. Owners of local JavaScript projects who want a clear deletion-candidate inventory before reclaiming disk space.
Good fit when
- Old test projects have accumulated large dependencies.
- An agent should estimate reclaimable space without deletion.
- Cleanup must stay inside a selected work directory and exclusions.
- A manual decision needs sorted paths and sizes.
Not a fit when
- A found directory’s owning application is unknown.
- Dependencies may contain unsaved local modifications.
- All results would be deleted without reviewing search scope.
Example request
Run npkill in dry-run mode only over test projects and show paths and sizes without deleting anything.Limitations
Node.js 20.19 or later is required; check the runtime in the terminal where you will start the package. Removing node_modules can break applications or discard local changes, so identify each directory first. Search starts in the current directory by default; set the intended root explicitly. Automatic deletion flags differ from manual selection, so preview the results without deletion and agree on exact paths.
How to disable. Exit with Q or Ctrl+C. Exiting does not restore deleted dependencies; use project installation or backups as appropriate.
FAQ
Is global installation required?
No. Run `npx npkill` without installing it globally. Add `--dry-run` for the initial inspection.
How do I check without deleting?
Add `--dry-run`.
How do I restrict search?
Set `--directory` and `--exclude`.
Can a script read the results?
Yes. `--json` emits the final result and `--json-stream` emits findings as discovered.
What does last_mod mean?
It reflects project-file modification time, a clue to recent use rather than proof that the folder is dispensable.
Discussion
No questions or reviews yet.
Related
CLI toolsThe CLI selects a project’s package manager and forwards short install and run commands to reduce confusion in agent workflows.
Mole inspects Mac storage and system state, cleans caches and build files, and previews selected items before deletion.
broot is a terminal file manager that calculates directory sizes in the background to show large folders before cleanup.
A Rust CLI for TypeScript and JavaScript: dead code, duplicates, cycles, complexity and architecture boundaries from one graph, plus MCP and skills
Simplify Codebase
simplify-codebase
A skill that says prove first and delete after: finding accidental complexity in code and safe removal without breakage. The README is in Chinese
nnn manages files in a terminal with selection, batch renaming, disk analysis, bookmarks and optional plugin extensions.
README in short
Profiles define search targets. Results can be sorted by size, path or age, and the parent directory can be opened for inspection.