← All tools

LOCAL FILE UTILITY

Directory Cleaner

Keep, move or archive files using patterns, creation dates and size limits. Preview every change first.

Description

A local file organizer available as both a web-service workspace and a downloadable script. Match filename or relative-path patterns, combine creation-before/after and size-smaller/larger conditions, then Keep, Move or Delete to archive. Keep rules win; otherwise the first match applies, and unmatched files remain untouched. Nothing is permanently deleted or overwritten.

Tool

Browse the complete local tool. Select any file to inspect its source; no script runs in this viewer.

Download all (.zip)

Select a file

Your tool, down to the source. Pick a file from the hierarchy to begin.

Use Cases

Setup

  1. Use the downloadable script

    Requires Node.js 22+. Download the complete script ZIP from Tool or Workspace, extract it and download your settings from the rule editor. Preview does not change files.

    node .\clean.mjs --settings .\directory-cleaner-settings.json --plan .\preview.json
  2. Apply a reviewed script preview

    Read preview.json and use its actual ID. Delete always puts files into an archive. The exact source snapshot is revalidated before any changes.

    node .\clean.mjs --apply .\preview.json --confirm "APPLY <preview-id>"
  3. Or start the local web service

    From this repository, run the service in its own terminal. It binds only to 127.0.0.1:8766; no account or installation runs automatically.

    pnpm tool:directory-cleaner
  4. Enable the portal connection

    In another terminal, opt in and bind the portal to loopback. Connect in Workspace, preview the files and type the exact confirmation. Both local-service connections are independent and off by default.

    $env:TOOLS_MOORKYZ_COM_DIRECTORY_CLEANER_ENABLED = "1"
    pnpm --filter @moorkyz-tools/portal dev --hostname 127.0.0.1

Workspace

Keep what matters. Move what belongs elsewhere. Delete always means archive. Rules combine conditions with AND; Keep wins, otherwise the first match applies. Unmatched files stay untouched.

Folders and rules
Rule 1
Creation date and size filters
Rule 2
Creation date and size filters
Download script (.zip)

Choose an absolute source folder before previewing or downloading settings.

Local service connection is off. The settings editor and script download still work; no local requests or polling run. Follow Setup to enable the service.