Minimal Bash CLI for normalizing and repairing problematic .cue files in large music archives.
- Recursively scans
.cuefiles from a selected archive root - Converts legacy encodings to UTF-8
- Removes UTF-8 BOM and CRLF line endings
- Repairs common broken
TITLE,PERFORMER,SONGWRITER,FILE, andTRACKlines - Tries to resolve broken
FILEreferences from adjacent audio files - Creates centralized backups in
Original_CUE/ - Does not create backup directories in
--dry-runmode - Uses temporary files and only replaces originals after validation
- Supports
--dry-runand--verbose
Run from the root of a music archive:
cue-normalize --dry-run --verbose
cue-normalizeOr pass an archive root explicitly:
cue-normalize --dry-run --verbose /path/to/music/archive
cue-normalize /path/to/music/archiveShow help:
cue-normalize --helpShow version:
cue-normalize --versionRequired at runtime:
bashcoreutilsfindutilsgrepsedgawkperlfile
Optional:
uchardetfor better encoding detection
iconv is used for charset conversion and is typically provided by glibc on Arch Linux.
- Keep it a single Bash script
- Prefer conservative fixes over speculative rewriting
- Use simple Unix tools
- Back up first, then modify
- Skip unsafe cases instead of forcing changes
- Does not fully implement the CUE specification
- Focuses on real-world corruption cases seen in music archives
- Not a full validator
- Cannot make ambiguous
FILEreferences safe if multiple audio files match - Some
libcuelimitations, such as very large track counts, are outside the scope of this tool
The included PKGBUILD installs:
- the
cue-normalizeexecutable to/usr/bin - the MIT license to
/usr/share/licenses/cue-normalize/
MIT