NPkill
使用 npkill 清理 node_modules 和 .next 文件夹以释放磁盘空间。专门设计用于帮助 JavaScript 和 Next.js 开发人员消除消耗大量存储空间的累积构建工件。提供交互式和自动清理选项以及安全检查,以保护重要的系统目录。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:ashirbadgudu~ashirbadgudu-npkillcURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Aashirbadgudu~ashirbadgudu-npkill/file -o ashirbadgudu-npkill.mdGit 仓库获取源码
git clone https://github.com/clawdbot/skills/commit/13d089ff9daab27c035479e20257ab298e5fb809## 概述(中文) 使用 npkill 清理 node_modules 和 .next 文件夹以释放磁盘空间。专门设计用于帮助 JavaScript 和 Next.js 开发人员消除消耗大量存储空间的累积构建工件。提供交互式和自动清理选项以及安全检查,以保护重要的系统目录。 ## 原文 # NPkill - Node.js and Next.js Build Artifact Cleaner This skill leverages the npkill tool to clean up node_modules and .next folders that accumulate over time from JavaScript and Next.js development, freeing up significant disk space. ## Purpose This skill addresses a common problem faced by JavaScript and Next.js developers: accumulation of large build artifact folders (node_modules, .next) that consume significant disk space over time. It provides a safe and efficient way to identify and remove these unnecessary folders. ## When to Use This Skill Use this skill when: - Your disk space is running low due to accumulated node_modules folders - You want to clean up old Next.js build artifacts (.next folders) - You need to maintain a clean development environment - You want to identify which projects are consuming the most disk space - You want to perform regular maintenance on your development workspace ## Core Commands ### Interactive Cleanup (Recommended) ```bash npkill ``` Launches the interactive interface to browse and selectively delete node_modules folders. This is the safest method as it allows you to review each folder before deletion. ### Target .next Folders Specifically ```bash npkill --target .next ``` Search specifically for .next folders (used by Next.js projects) instead of node_modules. ### Dry Run (Always Recommended First) ```bash npkill --dry-run ``` Simulates the operation without actually deleting anything. Shows what would be deleted. ### Automated Cleanup (Use with Caution) ```bash npkill --delete-all --yes ``` Automatically deletes all node_modules folders found. Use only after verifying with dry-run. ### View Sizes in Gigabytes ```bash npkill --gb ``` Shows folder sizes in gigabytes instead of megabytes for easier reading. ### Scan from Specific Directory ```bash npkill --directory /path/to/search/from ``` Starts searching from a specific directory instead of current directory. ## Safety Features - **Warnings for Protected Directories**: npkill highlights system/app directories that shouldn't be deleted with a ⚠️ symbol - **Interactive Confirmation**: Manual selection required in interactive mode - **Dry-run Option**: Preview changes before executing any deletions - **Exclusion Options**: Ability to exclude specific directories from scanning ## Common Use Cases for Next.js Developers ### Clean .next Folders Safely ```bash # First, preview what would be deleted npkill --target .next --dry-run # Then, if satisfied with the preview, run interactively npkill --target .next ``` ### Regular Maintenance ```bash # Run interactive cleanup to review and selectively delete npkill ``` ### Check Disk Usage ```bash # View all node_modules folders sorted by size npkill --sort=size ``` ## Best Practices 1. **Always run with --dry-run first** to see what would be deleted 2. **Review warnings carefully** about protected directories marked with ⚠️ 3. **Use interactive mode** for safer selective deletion 4. **Consider excluding important project directories** using --exclude if needed 5. **Schedule regular cleanup** to prevent massive accumulation ## Installation Requirements This skill requires the npkill CLI tool to be installed globally: ```bash npm install -g npkill ``` ## Limitations - Requires npkill to be installed separately - May not detect all protected system directories in all environments - Interactive mode requires terminal with arrow key support