Skip to content

CLI reference

Terminal window
purgeit [directory] [options]

If no directory is given, the current working directory is used.

FlagDescription
-d, --directory <path>Root directory to scan (default: cwd)
--fullFlat scan mode: treat the root as one scan unit
--project <name>Limit to a single top-level project (projects mode only)
--exclude <glob>Exclude paths matching the glob (repeatable)
--targets <names>Comma-separated rule names or target groups to restrict matching
--min-size <size>Skip matches below this size (e.g. 10MB, 500KB)
--depth <n>Max recursion depth
--config <path>Explicit config file path
--no-configIgnore any discovered config file (use defaults only)
--no-gatedDisable gated rules (always-safe only)
--sort <size|path|name>Sort key for list/JSON output (default: size)
--ascAscending sort (default: descending)
--dry-runSimulate deletion without touching files. In headless mode this is the default unless --delete is given; in a TTY the TUI still opens and confirmed deletions are simulated.
--deleteActually delete matched artifacts
-y, --yesSkip the confirmation prompt (headless --delete only)
--jsonMachine-readable JSON output (disables the TUI)
--tuiForce the interactive TUI
--headlessForce non-interactive mode
--concurrency <n>Max concurrent filesystem operations (default: 8)
--color / --no-colorForce ANSI color on or off
-h, --helpShow help
-V, --versionPrint version

Preview the largest artifacts in a directory:

Terminal window
purgeit --headless --dry-run ~/dev

Delete all node_modules folders across a project tree:

Terminal window
purgeit --targets node_modules --delete --yes ~/dev

Exclude a specific project from the scan:

Terminal window
purgeit --exclude 'legacy-project/*' ~/dev

Only clean artifacts above 10 MB:

Terminal window
purgeit --min-size 10MB --headless --dry-run ~/dev