Skip to content

folder_photos · folder_convert · folder_archive · folder_watch

Media and automation tools. folder_photos is dependency-free; folder_convert needs ffmpeg and folder_archive needs tar (both shelled out, so there's no library dependency). folder_photos/folder_convert preview until --apply.

folder_photos — organize by EXIF capture date

folder_photos <src...> <dest> [--template "<t>"] [--move] [--apply] [-j -1]

Reads each image's EXIF DateTimeOriginal (the moment it was shot) and files it under a templated path — default {year}/{month}/{name}. Falls back to the filesystem mtime when a file has no EXIF; the preview/CSV marks which date source was used. Only image files are considered; clashes get a " (2)" suffix.

folder_photos ~/Camera ~/PhotoLibrary --apply
folder_photos ./dump ./by-day --template "{date:%Y-%m-%d}/{name}" --apply

folder_convert — batch media conversion (ffmpeg)

folder_convert <path...> --to <ext> [--from <ext>] [--out <dir>]
               [--delete-source] [--apply] [-j -1]

Finds media files and runs ffmpeg to convert each to --to's format (codecs inferred from the extension). --from limits which inputs are converted; --jobs runs that many ffmpeg processes at once. Preview until --apply. Requires ffmpeg on PATH.

folder_convert ./clips --from mov --to mp4 --apply -j -1
folder_convert song.flac --to mp3 --apply

folder_archive — create / extract / list (tar)

folder_archive --create  <archive> <input...>     # format from the extension
folder_archive --extract <archive> [dest]
folder_archive --list    <archive>

A thin wrapper over the system tar (bsdtar on Windows 10+, GNU tar elsewhere). The compression is chosen from the archive extension: .tar, .tar.gz/.tgz, .tar.bz2, .tar.xz, .zip.

folder_archive --create backup.tar.gz ./project ./notes.txt
folder_archive --extract backup.tar.gz ./restore

folder_watch — run a command on changes

folder_watch <dir> --command "<cmd>" [--pattern <glob>] [--interval <sec>]
             [-R] [--run-existing]

Polls <dir> and, when a file matching --pattern is new or changed, runs the command with {} replaced by the file's path. Runs until Ctrl-C — great for auto-processing an inbox.

# Auto-convert PNGs dropped into ./inbox to JPG
folder_watch ./inbox --pattern "*.png" --command "folder_convert {} --to jpg --apply"