torrent-diff
A simple CLI for diffing and reconciling torrents with their downloads.

Installation
go install gitlab.com/porkysm.0/torrent-diff/cmd/torrent-diff@latest
or use a prebuilt binary from the latest release.
Usage
NOTE: A changed file refers to a file with a change in size and does not compare file hashes as of now.
Torrent -> Download Diffing
Downloaded data can be diffed against its corresponding torrent file using the torrent-diff local
command:
torrent-diff local - Compare the directory structure of a torrent file against a local directory.
USAGE:
torrent-diff local [command options]
OPTIONS:
--download-path value, -d value The directory where the downloaded torrent contents are stored.
--input-torrent value, -t value The path of a torrent to use for this diff.
--input-magnet value, -m value The magnet URL of a torrent to use for this diff.
--input-file value, -F value The path to a file containing a list of paths separated by new lines that are available for a torrent.
--input-file-delimiter value The delimiter to use when parsing the --input-file's contents. (default: "\n")
--rm-new If specified, all files that exist in the --download-path but don't exist in the torrent will be removed. (default: false)
--rm-changed If specified, all files that differ from their torrent equivalents will be removed.
NOTE: A changed file refers to a file with a change in size and does not compare file hashes as of now. (default: false)
--force, -f If specified, all destructive operations (e.g. rm-new) will be run without a prompt. (default: false)
--no-reconcile-path If specified, the torrent download path will not be automatically reconciled. (default: false)
--show-unchanged, -e If specified, all unchanged files will be shown in the output diff. (default: false)
--json, -j If specified, the output will be printed in JSON. (default: false)
--reverse-diff, --reserve, -r If specified, the diff will be reversed (e.g. torrent -> directory becomes directory -> torrent). (default: false)
--help, -h show help
Examples
Get a human-redable list of local file changes
torrent-diff local -d /path/to/data/directory -t /path/to/torrent.torrent
Get a human-redable list of local file changes, including all unchanged files
torrent-diff local -e -d /path/to/data/directory -t /path/to/torrent.torrent
Remove all changed and new local files
torrent-diff local --rm-changed --rm-new -d /path/to/data/directory -t /path/to/torrent.torrent
Get a JSON-parsable list of local file changes
torrent-diff local -j -d /path/to/data/directory -t /path/to/torrent.torrent
Torrent -> Torrent Diffing
Torrents can be diffed against each other corresponding torrent file using the torrent-diff torrent
command:
torrent-diff torrent - Compare the directory structure of two torrents.
USAGE:
torrent-diff torrent [command options]
OPTIONS:
--input-torrent-1 value, --t1 value The path of a torrent to use for this diff.
--input-magnet-1 value, --m1 value The magnet URL of a torrent to use for this diff.
--input-torrent-2 value, --t2 value The path of a torrent to use for this diff.
--input-magnet-2 value, --m2 value The magnet URL of a torrent to use.
--show-unchanged, -e If specified, all unchanged files will be shown in the output diff. (default: false)
--json, -j If specified, the output will be printed in JSON. (default: false)
--reverse-diff, --reserve, -r If specified, the diff will be reversed (e.g. torrent -> directory becomes directory -> torrent). (default: false)
--help, -h show help
Examples
Get a human-redable list of torrent file changes
torrent-diff torrent -t1 /path/to/a/torrent.torrent -t2 /path/to/another/torrent.torrent
Get a human-redable list of torrent file changes, including all unchanged files
torrent-diff torrent -e -t1 /path/to/a/torrent.torrent -t2 /path/to/another/torrent.torrent
Get a JSON-parsable list of torrent file changes
torrent-diff torrent -e -j -t1 /path/to/a/torrent.torrent -t2 /path/to/another/torrent.torrent