Batch file renamer driven by Markdown tables.
Platforms: macOS, Linux, Windows Requires: Swift 6.2+
git clone https://github.com/CleanCocoa/swift-md-bulk-renamer.git
cd swift-md-bulk-renamer
swift build
swift run mvmd examples/README.md # preview
swift run mvmd examples/README.md --apply # executeSee examples/ for demo files.
git clone https://github.com/CleanCocoa/swift-md-bulk-renamer.git
cd swift-md-bulk-renamer
swift build -c releaseThe binary will be at .build/release/mvmd.
Create a Markdown file with a rename table:
| From | To |
|------|-----|
| old-name.txt | new-name.txt |
| report.pdf | 2024-report.pdf |
| src/utils.swift | src/helpers.swift |Preview what would happen (dry-run):
mvmd renames.mdExecute the renames:
mvmd renames.md --apply| Option | Description |
|---|---|
--apply |
Execute renames (default is dry-run) |
--force |
Allow overwriting existing files |
-h, --help |
Show help |
cat renames.md | mvmd
echo '| From | To |
|---|---|
| a.txt | b.txt |' | mvmd --applyOr use - explicitly:
mvmd - < renames.md- First 2-column table in the file is used
- Header row is required (any names work)
- Rows with empty "To" column are skipped
- Paths are relative to the instruction file's directory (not the current working directory)
mvmd validates all paths before any rename:
- Rejects absolute paths (
/etc/hosts) - Rejects parent escapes (
../secret.txt) - Rejects Windows-style paths on non-Windows platforms (
C:\file.txt,\\server\share) - Rejects symlinks as sources
- Prevents overwrites unless
--force - Detects duplicate sources
- Detects conflicting destinations
If validation fails, no files are modified.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (parsing, validation, or execution failure) |