Next Prune 🧹
Prune Next.js build artifacts and caches from your terminal. Interactive TUI to scan and delete
.next
,out
,.vercel/output
,.turbo
, and other safe-to-delete directories to free disk space.
What Gets Pruned
Safe to delete (recreated by tools):
.next/
- Next.js build output and cacheout/
- Next.js static export output.vercel/output/
- Vercel Build Output API bundle.turbo/
- Turborepo cache (default at.turbo/cache
).vercel_build_output/
- Legacy Vercel build outputnode_modules/.cache/next
- Next.js cache in node_modules
Always preserved:
.vercel/project.json
- Keeps local folder linked to Vercel projectvercel.json
- Vercel project configurationnext.config.*
- Next.js configuration- All source code and project files
Features:
- 🎯 Interactive terminal UI built with Ink
- 🔍 Scans recursively for Next.js, Vercel, and Turborepo build artifacts
- 📊 Shows disk usage for each directory found
- ✅ Select multiple directories for batch deletion
- 🚀 Non-interactive modes for scripting (
--list
,--json
) - 🛡️ Safe deletion with confirmation prompts
Install
$ npm install --global next-prune
Quick Start
# Scan and interactively select what to delete
$ npx next-prune
# One-shot cleanup (no prompts)
$ npx next-prune --yes
# Non-interactive listing
$ npx next-prune --list
$ npx next-prune --json
CLI
$ next-prune --help
Usage
$ next-prune
Options
--yes, -y Skip confirmation and delete selected immediately
--dry-run Don't delete anything; just show results
--cwd=<path> Directory to scan (default: current working dir)
--list Non-interactive list of artifacts and sizes, then exit
--json Output JSON (implies --list)
Examples
$ next-prune # interactive TUI
$ next-prune --dry-run # scan only
$ next-prune --list # list found artifacts
$ next-prune --json # machine-readable output
$ next-prune --yes # one-shot cleanup
One-Shot Cleanup
For quick cleanup without interaction:
# Equivalent to: rm -rf .next out .vercel/output .turbo
$ next-prune --yes
Contributing
See CONTRIBUTING.md
. By participating, you agree to our CODE_OF_CONDUCT.md
.
License
MIT © next-prune contributors