Remediator-CLI
Command-line Application to sort images and video based off of their filesystem metadata or exif/media metadata formatted from a predefined or custom template.
Installation
Installation assumes you have already installed v8.5.0 or greater of Node.js. If you have not done this, or do not know how to, please follow the directions at https://nodejs.org/.
Get Remediator-CLI
Open your CLI of choice with Node v8.5.0 or greater installed and run the following to install Remediator-CLI.
$ npm install remediator-cli -g
Usage
Remediator-CLI is a simple to use command-line application that accepts a range of options to sort your media.
Note: First run of Remediator-CLI may take slightly longer as Exiftool will be automatically downloaded to your computer.
Remediator-CLI Options
Option | Default | Description | Example |
---|---|---|---|
-b, --batch-size | 20 | (Advanced) amount of files to process asynchronously at a time. | remediator --batch-size 5 |
-f, --format | :YYYY:\\:MM0:. :Month:\\:DD0: :Day:\\:YYYY:.:MM0:.:DD0: :HH0:.:MN0:.:Ext: | (Advanced) Template markup to use when building new file names. | remediator --format :YYYY:/:DD0:.:Ext: |
-h, --help | -- | Lists all Remediator-CLI options. | remediator --help |
-m, --mode | dry | May run in one of three different modes: dry, copy, or move. | remediator --mode copy |
-o, --output | Directory Remediator-CLI is ran from. | Base output directory for transformed files. | remediator --output /output_directory |
-r, --recursive | disabled | Enable recursively fetch all files from subdirectories of source directories. | remediator --recursive |
-e, --skip-errors | disabled | Enable skipping errors will continue processing all files even if errors are encountered. | remediator --skip-errors |
-s, --source | Directory Remediator-CLI is ran from. | Directory(s) to get files to transform from. | remediator --source /source_directory |
-v, --verbose | all | May run in one of three different verbosity levels: all, error, or none. | remediator --verbose none |
-V, --version | -- | Output the version number. | remediator --version |
Basic Demo - No options
Basic Demo - Copy
Basic Demo - Move
Building Format Templates
Format templates are used to define file output structure. :
's are used to denote the start and end of a transformer section. Remediator will replace the first "transformer" it encounters in a section. If the first transformer found is empty everything between the :
's will not be added to the filename.
For example, if you have a format of :YYYY::-Make-:.:Ext:
and a image named image.jpg
that was taken in the year 2000 but does NOT have any metadata for the device make the output would be: 2000.jpg
. However, if image.jpg
did have a device make of "Sony" the output would be: 2000-Sony-.jpg
.
The following tables list all currently supported "transformers" by Remediator-CLI.
Transformers
Date based
Name | Transformer Markup | Description | Example(s) Output |
---|---|---|---|
Year | YYYY | Date based numeric year. | 2018 |
Month | DD | Date based numeric day of the month. | 1, 10, 20, 30 |
DD0 | Date based numeric day of the month with leading zero. | 01, 10, 20, 30 | |
MM | Date based month numeric month of the year. | 1, 4, 5, 12 | |
MM0 | Date based month numeric month of the year with leading zero. | 01, 04, 05, 12 | |
Month | Date based name of month. | January | |
lcMonth | Date based lowercase name of month. | january | |
ucMonth | Date based uppercase name of month. | JANUARY | |
Week | Day | Date based day of the week. | Sunday |
lcDay | Date based lowercase day of the week. | sunday | |
ucDay | Date based uppercase day of the week. | SUNDAY |
Time based
Name | Transformer Markup | Description | Example(s) Output |
---|---|---|---|
Hour | HH | Time based numeric hour media was captured. | 0, 9, 12, 23 |
HH0 | Time based numeric hour media was captured with leading zero. | 00, 09, 12, 23 | |
Minute | MN | Time based numeric minute media was captured. | 0, 7, 31, 44, 59 |
MN0 | Time based numeric minute media was captured with leading zero. | 00, 07, 31, 44, 59 |
Device Based
Name | Transformer Markup | Description | Example(s) Output |
---|---|---|---|
Device Make | Make | Make of camera used from media metadata. | Sony |
lcMake | Lowercase make of camera used from media metadata. | sony | |
ucMake | Uppercase make of camera used from media metadata. | SONY | |
Device Model | Model | Model of camera used from media metadata. | Nexus 5x |
lcModel | Lowercase model of camera used from media metadata. | nexus 5x | |
ucModel | Uppercase model of camera used from media metadata. | NEXUS 5X |
File Metadata Based
Name | Transformer Markup | Description | Example(s) Output |
---|---|---|---|
Extension | Ext | Original file extension of source file. | Jpeg |
lcExt | Lowercase File Extension of source file. | jpeg | |
ucExt | Uppercase File Extension of source file. | JPEG | |
Height | Height | Pixel height of media. | 1080 |
Orientation | Orientation | Orientation of camera when photo was taken. | Horizontal (normal) |
lcOrientation | Lowercase orientation of camera when photo was taken. | horizontal (normal) | |
ucOrientation | Uppercase orientation of camera when photo was taken. | HORIZONTAL (NORMAL) | |
Width | Width | Pixel width of media. | 1920 |
Acknowledgements
Remediator-CLI would not be possible without Exiftool by Phil Harvey. Please consider donating!
Additionally, big thanks to Adobe Systems for allowing work on the original prototype of Remediator during a Hackathon.