Skip to main content

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?

  1. Removes common operating-system artifacts without maintaining a custom cleanup script in every repository.
  2. Protects Git-tracked files even when their names match an enabled cleanup toggle.
  3. Fails closed when Git metadata exists but Nova cannot read the tracked-file index.
  4. Supports --dry-run so you can review every candidate before removal.

Requirements

  • Node.js runtime — Use any Node.js LTS release with either the installed nova CLI or npx.
  • 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 systemSettingMatched file
Linux—None
macOSappleDouble._*
macOSdesktopServicesStore.DS_Store
WindowsenhancedThumbnailDatabaseehthumbs.db
WindowsenhancedVistaThumbnailDatabaseehthumbs_vista.db
WindowsthumbnailDatabaseThumbs.db

Windows file-name matching is case-insensitive. Linux currently has no reviewed cleanup targets, so its settings object remains empty.

Safety Boundaries

  1. Scan only beneath the project root.
  2. Skip symbolic links, .git, dependencies, coverage, and common build-output directories.
  3. Select only regular files matching Nova's closed catalog.
  4. Read git ls-files and protect every tracked match.
  5. Abort without deleting anything when Git metadata exists but the tracked-file list cannot be read.

Configuration

nova.config.json
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

FlagDescription
-d, --dry-runList enabled files that would be removed without deleting files.

Troubleshooting

  • Recipe is skipped — Set recipes.miscellaneous.remove-operating-system-files.enabled to true.
  • 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.