Remove Operating System Files
Remove reviewed operating-system metadata files that are explicitly enabled in Nova config.
Summary
The remove-operating-system-files recipe recursively scans the project root for a closed set of macOS and Windows metadata files. It removes only enabled, untracked regular files and never accepts arbitrary paths or patterns from configuration.
New scaffolds include the complete settings block with the recipe and every file toggle disabled.
Why Use This Command?
- Removes common operating-system artifacts without maintaining a custom cleanup script in every repository.
- Protects Git-tracked files even when their names match an enabled cleanup toggle.
- Fails closed when Git metadata exists but Nova cannot read the tracked-file index.
- Supports
--dry-runso you can review every candidate before removal.
Requirements
- Node.js runtime — Use any Node.js LTS release with either the installed
novaCLI ornpx. - Project root — Run the command from the directory containing the root
package.json. nova.config.json— Enable the recipe and the exact reviewed file toggles you want removed.
Supported Files
| Operating system | Setting | Matched file |
|---|---|---|
| Linux | — | None |
| macOS | appleDouble | ._* |
| macOS | desktopServicesStore | .DS_Store |
| Windows | enhancedThumbnailDatabase | ehthumbs.db |
| Windows | enhancedVistaThumbnailDatabase | ehthumbs_vista.db |
| Windows | thumbnailDatabase | Thumbs.db |
Windows file-name matching is case-insensitive. Linux currently has no reviewed cleanup targets, so its settings object remains empty.
Safety Boundaries
- Scan only beneath the project root.
- Skip symbolic links,
.git, dependencies, coverage, and common build-output directories. - Select only regular files matching Nova's closed catalog.
- Read
git ls-filesand protect every tracked match. - Abort without deleting anything when Git metadata exists but the tracked-file list cannot be read.
Configuration
nova.config.json
{
"recipes": {
"miscellaneous": {
"remove-operating-system-files": {
"enabled": true,
"settings": {
"linux": {},
"macos": {
"appleDouble": true,
"desktopServicesStore": true
},
"windows": {
"enhancedThumbnailDatabase": true,
"enhancedVistaThumbnailDatabase": true,
"thumbnailDatabase": true
}
}
}
}
}
}
Unknown operating systems, unknown file toggles, and non-boolean values make Nova config invalid. Use nova utility configure to edit the closed choices interactively.
Usage
Options
| Flag | Description |
|---|---|
-d, --dry-run | List enabled files that would be removed without deleting files. |
Troubleshooting
- Recipe is skipped — Set
recipes.miscellaneous.remove-operating-system-files.enabledtotrue. - A matching file remains — Confirm its semantic file toggle is enabled. Nova also preserves symlinks, generated output, dependency contents, and Git-tracked files.
- Nova reports invalid configuration — Remove unsupported platforms or file names and make every supported toggle a boolean.
- Nova cannot read the Git index — Repair the repository metadata before retrying; Nova intentionally removes nothing in this state.