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.

filebot -rename -r "/input" --db TheMovieDB -non-strict \
--action duplicate --output "/output" --format "{plex.id}"
Clone movie files into a new {plex} file and folder structure.

filebot -rename -r "/input" --db TheMovieDB::TV -non-strict \
--action duplicate --output "/output" --format "{plex.id}"
Clone TV series episode files into a new {plex} file and folder structure.

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
TheMovieDB::TV | TheTVDB | AniDB (Series Mode)
TheMovieDB | OMDb (Movie Mode)
AcoustID | ID3 (Music Mode)
xattr (Local Xattr Mode)
file (Plain File Mode)
exif (Photo Mode)
--order episode numbering Airdate | Absolute | DVD | Date and Title
--format naming scheme format expression
--action rename action move | copy | symlink | hardlink | test
--conflict conflict resolution skip | replace | 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 select files recursively
-d rename folders
--file-filter input file filter file filter expression
--file-order input file order file order 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
-list (Print Mode)
-list -rename (Linear Rename Mode)
-find print file paths
-find (Print Mode)
-find -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
-no-history disable history
-no-xattr disable extended attributes
-no-probe disable media parser
-no-index disable media index
-unixfs disable file path validation
-version print version
-help print usage

Need help getting started? Join the Forum or Discord.