pcleaner

Clean Various Projects Build Files Effortlessly

ProjectCleaner (pcleaner)

ProjectCleaner (or pcleaner) is a command-line utility to quickly scan and clean build artifacts from multiple types of projects, including Flutter, Rust, and Node.js. It helps developers reclaim disk space and keep project directories tidy.


Features

  • Automatically detects projects based on their configuration files:

    • pubspec.yaml → Flutter projects
    • Cargo.toml → Rust projects
    • package.json → Node.js projects
  • Cleans build artifacts:

    • Flutter: runs flutter clean
    • Rust: runs cargo clean
    • Node.js: deletes node_modules directory
  • Supports dry-run mode to preview actions without deleting anything

  • Skips common large directories like .git, .vscode, node_modules, target, and build during scanning

  • Interactive confirmation before deleting anything for safety


Installation

Clone the repository and build the binary:

git clone <repo-url>
cd pcleaner
go build -o pcleaner main.go

After building, you can run the pcleaner binary from any directory.


Usage

./pcleaner [--dry-run]

Options

  • --dry-run Scan the directory and show what would be cleaned without actually deleting any files.

Example

# Dry run
./pcleaner --dry-run

# Actual cleanup
./pcleaner

The program will prompt for confirmation before performing any destructive actions.


Supported Projects

Project Type Detection File Cleanup Action
Flutter pubspec.yaml flutter clean
Rust Cargo.toml cargo clean
Node.js package.json Delete node_modules

Safety Notes

  • Always use --dry-run first if you are unsure what will be deleted.
  • The program will prompt for confirmation before performing destructive actions.
  • Skipped directories include .git, .vscode, node_modules, target, and build.