delphi-clean is a PowerShell utility designed for Delphi developers to help remove
build artifacts, intermediate files, and IDE-generated clutter.
# Preview cleanup
pwsh -File .\delphi-clean.ps1 -WhatIf
# Perform cleanup
pwsh -File .\delphi-clean.ps1
# CI usage
pwsh -File .\delphi-clean.ps1 -Level full -Json- Three cleanup levels:
lite,build,full - CI-friendly output with optional JSON mode
- Optional structured output via
-PassThru - Supports the
-WhatIfdry-run mode
Runs on the widely available Windows PowerShell 5.1 (powershell.exe) and the newer PowerShell 7+ (pwsh).
Run the script from its directory, or provide a path explicitly.
pwsh -File .\delphi-clean.ps1Defaults to:
- Level:
lite - Root: parent directory of the script
pwsh -File .\delphi-clean.ps1 -Level lite
pwsh -File .\delphi-clean.ps1 -Level build
pwsh -File .\delphi-clean.ps1 -Level fullpwsh -File .\delphi-clean.ps1 -RootPath C:\code\my-projectpwsh -File .\delphi-clean.ps1 -WhatIfShows what would be deleted without making changes.
pwsh -File .\delphi-clean.ps1 -Verbosepwsh -File .\delphi-clean.ps1 -PassThruReturns objects describing each item processed.
pwsh -File .\delphi-clean.ps1 -JsonOutputs a JSON summary including:
- Files found
- Directories found
- Files deleted
- Directories deleted
- Item-level details
pwsh -File .\delphi-clean.ps1 -ExcludeDirectories .git,.vs,.idea- see: /docs/cleanup-levels.md for breakdown of each level
Safe cleanup of common transient files.
Includes:
.dcu,.tmp,.bak,.identcache__history
Removes build outputs and generated artifacts.
Includes everything in lite, plus:
- Compiled binaries (
.exe,.dll,.bpl, etc.) - Debug and release folders
- Intermediate files
More aggressive cleanup
Includes everything in build, plus:
- Backup files (
*.~*) - FinalBuilder related files (logs, breakpoint, lock)
- TestInsight custom settings
This repository is currently incubator and is under active development.
It will graduate to stable once:
- At least one downstream consumer exists.
Until graduation, breaking changes may occur
This tool is part of the Continuous-Delphi ecosystem, focused on improving engineering discipline for long-lived Delphi systems.

