dotnet-cleanup 1.0.0

dotnet tool install --global dotnet-cleanup --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local dotnet-cleanup --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-cleanup&version=1.0.0
                    
nuke :add-package dotnet-cleanup --version 1.0.0
                    

dotnet-cleanup

.NET tool for cleaning generated folders from a directory tree.

By default, it targets the common output/dependency folders **/bin, **/obj and **/node_modules.

To maximize the speed of deletion, enabling instant working with your project, the tool moves the deleted files to a temp-folder first, before deleting.

Install

Requires .NET SDK: https://dotnet.microsoft.com/download

Install the .NET tool:

dotnet tool install --global dotnet-cleanup

Usage

USAGE:
    dotnet-cleanup [PATH] [OPTIONS]

EXAMPLES:
    dotnet-cleanup c:\src\project --include **/bin --include **/obj --include **/node_modules --exclude README.md
    dotnet-cleanup -p **/bin -p **/obj -y
    dotnet-cleanup -p **/node_modules --verbosity minimal

ARGUMENTS:
    [PATH]    The starting path for the cleanup. Defaults to current directory

OPTIONS:
    -h, --help                  Prints help information
    -p, --include <PATTERNS>    Glob paths to include in cleanup. Default paths: **/bin, **/obj, **/node_modules
    -x, --exclude <PATTERNS>    Glob paths to exclude from cleanup
    -y, --yes                   Run cleanup skipping confirm prompt
        --noop                  No-op mode: list matching paths without moving or deleting anything. Equivalent to
                                --no-move and --no-delete
        --no-delete             Skip deleting matched paths after moving them to temporary folder. Ignored when --noop
                                is used
        --no-move               Skip moving matched paths to temporary folder before deletion. Ignored when --noop is
                                used
        --temp-path <PATH>      Temporary path to move cleanup files before deletion
    -v, --verbosity <LEVEL>     Sets the verbosity level. Allowed values are minimal (m), normal (n) and detailed (d)

Examples

# Clean current directory tree (confirmation prompt enabled)
dotnet-cleanup

# Clean a specific folder tree
dotnet-cleanup C:\src\project

# Custom include/exclude patterns
dotnet-cleanup -p "**/bin" -p "**/obj" -p "**/node_modules" -x "**/samples/**"

# Skip confirmation
dotnet-cleanup -y

# List only (do not move or delete)
dotnet-cleanup --noop

# Move to temp folder, but do not delete
dotnet-cleanup --no-delete -y

# Delete in place without temp staging
dotnet-cleanup --no-move -y

Behavior

  • Start path defaults to your current working directory.
  • Default include patterns are **/bin, **/obj, and **/node_modules.
  • Include/exclude patterns are matched relative to the chosen start path.
  • Exclude patterns take precedence over include patterns.
  • By default, matched paths are moved to a temp staging folder before deletion, then the temp staging folder for the run is removed.
  • --no-delete keeps moved paths in temp staging and skips deletion.
  • --noop lists matching paths but skips both move and delete.
  • Temp staging defaults to the system temp path; override with --temp-path.
  • Temp path is only checked when move before delete is enabled (default).
  • Verbosity levels: minimal, normal, detailed.
  • Normal verbosity prints completion summaries. When confirmation is enabled, matching paths are listed before the prompt.
  • Detailed verbosity also prints step headings and matching paths.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 227 4/28/2026
0.6.1 9,533 4/30/2020
0.6.0 3,964 7/18/2019
0.5.2 3,161 10/23/2018
0.5.1 2,513 10/22/2018
0.5.0 2,502 10/17/2018