Cleanup File
fc_cleanup_fileCleans up files by removing UTF-8 BOM, trailing whitespace, NUL bytes, and normalizing line endings. Supports recursive directory processing and dry-run preview to avoid data loss.
Instructions
Cleans up one or more files from common problems.
Args:
path (string): Path to file or directory
recursive (boolean, optional): Recursive for directories
extensions (string, optional): Filter file extensions (e.g. ".txt,.json,.py")
remove_bom (boolean): Remove UTF-8 BOM
remove_trailing_whitespace (boolean): Remove trailing whitespace
normalize_line_endings (string, optional): "lf" | "crlf" | null
remove_nul_bytes (boolean): Remove NUL bytes
dry_run (boolean): Preview only
Cleans: BOM, NUL bytes, trailing whitespace, line endings
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to file/directory | |
| recursive | No | Recursive | |
| extensions | No | Filter extensions (.txt,.json) | |
| remove_bom | No | Remove BOM | |
| remove_trailing_whitespace | No | Trailing whitespace | |
| normalize_line_endings | No | Line endings | |
| remove_nul_bytes | No | Remove NUL bytes | |
| dry_run | No | Preview only |