repo-clean
v1.2.1
Published
Clean common build and cache folders from a repository.
Maintainers
Readme
repo-clean
Clean common build outputs and cache folders from a repository.
Quick Start
No installation needed! Run it directly with npx:
npx repo-cleanOr you can install it globally:
npm i -g repo-clean
repo-cleanUsage
Use the command patterns below with either npx repo-clean or repo-clean (after global install).
repo-clean [--dry-run] [--node-modules] [--pm-cache] [--logs] [--editor] [--tmp] [--force]
repo-clean --all [--keep-nm] [--dry-run] [--force]
repo-clean --help | -h
repo-clean --version | -vrepo-clean accepts flags only. Positional arguments are rejected with an error.
Default behavior (no flags)
Removes:
distbuildcoverage.next.turbo.vite.parcel-cache.cache
Flags
--dry-runPrint what would be removed without deleting anything.--node-modulesAlso removenode_modules.--forceSkip confirmation prompt fornode_modulesremoval.--pm-cacheAlso remove package manager caches/stores:.yarn/cache.yarn/unplugged.yarn/install-state.gz.pnp.cjs.pnp.loader.mjs.pnpm-store
--logsAlso remove common root log files:npm-debug.log*yarn-error.log*pnpm-debug.log*lerna-debug.log*
--editorAlso remove editor folders (.vscode,.idea).--tmpAlso removetmpandtemp.--allInclude all optional cleanup categories above.--keep-nmWith--all, keepnode_modules.--help,-hPrint usage and flags.--version,-vPrint the CLI version.
Examples
# Dry-run default cleanup
npx repo-clean --dry-run
# Remove default targets + node_modules
npx repo-clean --node-modules --force
# Prompted node_modules removal (confirm with y/yes)
npx repo-clean --node-modules
# Full cleanup except node_modules
npx repo-clean --all --keep-nm
# Print installed version
npx repo-clean --version
# Invalid (positional argument): exits with code 2
npx repo-clean my-folderIssues and Support
- Bug reports: https://github.com/arbenkryemadhi/repo-clean/issues/new
- Feature requests: https://github.com/arbenkryemadhi/repo-clean/issues/new
- General issues: https://github.com/arbenkryemadhi/repo-clean/issues
When opening an issue, include:
- Your OS and Node.js version
- The exact command you ran
- The output you expected vs the output you got
- A minimal repo structure that reproduces the behavior (if possible)
Contributing
Contributions are welcome.
- Fork the repository.
- Create a branch for your change.
- Make focused changes and update docs when behavior changes.
- Test with
--dry-runand relevant flags. - Open a pull request with a clear description.
Local development
git clone https://github.com/arbenkryemadhi/repo-clean.git
cd repo-clean
npm test
node ./bin/repo-clean.js --help
node ./bin/repo-clean.js --dry-runPull request checklist
- Keep scope small and focused.
- Preserve existing CLI behavior unless intentionally changing it.
- Update README for any user-facing flag or behavior changes.
- Add reproducible steps in the PR description.
