FileBot CLI Command-line interface usage manual

FileBot command-line tools

About

FileBot can be called with a set of command-line arguments directly from the console or in scripts for automation, running tasks like renaming TV shows and movies, fetching subtitles or checking SFV files.

The CLI is designed for simple commands that do one thing and do it well.

Please read Scripts and Automation if you need more advanced behaviours. Find shared scripts for many common tasks in the Script Repository.

Examples

Rename

filebot -rename *.mkv Rename given episode files or movie files.

filebot -rename *.mkv --db AniDB -non-strict Rename given episode files using AniDB episode listing.

filebot -rename -r "/path/to/files" --format "{s} - {s00e00} - {t}" Rename given episode files using the given custom format.

filebot -rename "1x01.mkv" --q "Firefly" --db TheMovieDB::TV --lang German Rename a given episode file forcing a given series based on German language episode listing.

filebot -rename A.mkv --q 19995 --db TheMovieDB Rename a given movie file using the numeric ID to lookup the movie information.

The GUI uses opportunistic matching by default. However, the filebot command is strict by default to avoid mismatches. You may need to set -non-strict depending on the files at hand.

Fetch Subtitles

filebot -get-subtitles -r "/path/to/files" -non-strict Fetch missing subtitles for the given episode files or movie files.

filebot -get-subtitles -r "/path/to/files" -non-strict \
--lang zh --output srt --encoding utf-8
Fetch missing Chinese language subtitles and convert them to SubRip format and UTF-8 encoding.

File Verification

filebot -check "/path/to/files" Compute CRC32 checksums and create an SFV file.

filebot -check "/path/to/files" --format SHA-256 Compute SHA-256 hashes and create an sha256sum file.

filebot -check *.sfv Check file integrity for all the files listed in the given SFV file.

Scripting

filebot -extract -r "/input" --output "/output" Extract all archives from the given input folder to the given output folder.

filebot -list --q "Firefly" --db TheMovieDB::TV \
--filter "s == 1" \
--format "{id} | {s} | {y} | {sxe} | {t}"
Fetch episode list and print episode information for the selected episodes.

filebot -mediainfo -r "/path/to/files" \
--filter "f.video && minutes > 15" \
--format "{vc} | {vf} | {ac} | {af} | {bitrate} | {bytes} | {f}"
Read media info and print to console.

filebot -script *.groovy "/input" --def a=1 b=2 c=3 ... Execute a given Groovy script and pass along input arguments and script parameters.

filebot -script fn:amc "/input" --output "/output" --action duplicate \
-non-strict --log-file amc.log --def excludeList="amc.txt"
Execute the amc script with the given input arguments, options and script parameters.

Argument Reference source

Name Description Usage
-rename rename media files media folder or media file
--db database
TheTVDB | AniDB | TheMovieDB::TV (Series Mode)
TheMovieDB | OMDb (Movie Mode)
AcoustID | ID3 (Music Mode)
File | Exif | Xattr (Plain File Mode)
--order episode numbering Airdate | Absolute | DVD
--format naming scheme format expression
--action rename action move | copy | symlink | hardlink | test
--conflict conflict resolution override | skip | auto | index | fail
--filter match filter filter expression
--mapper episode mapper mapper expression
--q manual lookup query expression
--lang language code English | French | German | Chinese | etc
-non-strict opportunistic match mode
enable opportunistic matching (Rename Mode)
enable fuzzy subtitle search (Subtitle Mode)
-r traverse folders recursively
-d rename folders
--file-filter input file filter file filter expression
--output output path
output folder (Rename Mode)
srt (Subtitle Mode)
verification file (Checksum Mode)
--apply apply post-processing artwork | nfo | date | import | prune
-exec execute command exec expression
-extract extract archives folder or archive file
-check compute or verify hashes folder or verification file
-get-subtitles fetch missing subtitles media folder or video file
--encoding output charset UTF-8 | Windows-1252 | GB18030 | etc
-list print episode list -rename (Linear Rename Mode)
-find print file paths -exec (Find Exec Mode)
-mediainfo print media info
-script run script
-revert undo rename operations
--mode interactive enable console-interactive mode
--log log level all | fine | info | warning
-clear-cache clear cache
-clear-prefs reset application settings
-clear-history reset history
-unixfs disable file path validation
-no-xattr disable extended attributes
-no-probe disable media parser
-no-history disable history disable history
-version print version
-help print usage

Need help getting started? Join the Forum or Discord.