TORF(1)
β¨ NAME β¨
okay so bestie, TORF(1) is the manual page for torf β literally the command line tool to create, display and edit torrents. no cap, she does it all. π
πΈ SYNOPSIS πΈ
torf PATH [OPTIONS] [-o TORRENT]
torf -i INPUT
torf -i INPUT [OPTIONS] -o TORRENT
torf -i TORRENT PATH
π DESCRIPTION π
torf can create, display and edit torrent files and verify the integrity of the files in a torrent. periodt.
torf PATH [OPTIONS] [-o TORRENT]β Create the torrent fileTORRENTfrom the file or directoryPATH. slay.torf -i INPUTβ Display information stored in the torrent file or magnet URIINPUT. info dump, but make it cute.torf -i INPUT [OPTIONS] -o TORRENTβ Edit the existing torrent file or magnet URIINPUT(e.g. to fix a typo) and create the new torrent fileTORRENT.
Warning bestie, listen. Editing a torrent can change its hash, depending on what is changed, which essentially makes it a new torrent. See OPTIONS to find out whether a certain option will change the hash.
torf -i TORRENT PATHβ Verify that the content inPATHmatches the metadata in the torrent fileTORRENT.
If PATH ends with a path separator (usually β/β), the name of the torrent (as specified by the metadata in TORRENT) is appended.
π OPTIONS π
fr fr, options that start with --no take precedence.
PATHβ The path to the torrentβs content.--in,-iINPUT β Read metainfo from the torrent file or magnet URIINPUT. IfINPUTis β-β and does not exist, the torrent data or magnet URI is read from stdin.--out,-oTORRENT β Write to torrent fileTORRENT. Default:NAME.torrent--reuse,-rPATH β Copy piece size and piece hashes from existing torrentPATH. The existing torrent must have identical files. IfPATHis a directory, it is searched recursively for a matching torrent. This option may be given multiple times.--noreuse,-Rβ Ignore all--reusearguments. This is particularly useful if you have reuse paths in your configuration file.--exclude,-ePATTERN β Exclude files fromPATHthat match the glob patternPATTERN. This option may be given multiple times. See EXCLUDING FILES.--includePATTERN β Include files fromPATHthat match the glob patternPATTERNeven if they match any--excludeor--exclude-regexpatterns. This option may be given multiple times. See EXCLUDING FILES.--exclude-regex,-erPATTERN β Exclude files fromPATHthat match the regular expressionPATTERN. This option may be given multiple times. See EXCLUDING FILES.--include-regex,-irPATTERN β Include files fromPATHthat match the regular expressionPATTERNeven if they match any--excludeor--exclude-regexpatterns. This option may be given multiple times. See EXCLUDING FILES.--notorrent,-Nβ Do not create a torrent file.--nomagnet,-Mβ Do not create a magnet URI.--name,-nNAME β Destination file or directory when the torrent is downloaded. Default: Basename ofPATH
Warning editing alert. When editing, this option changes the info hash and creates a new torrent.
--tracker,-tURL β List of comma-separated announce URLs. This option may be given multiple times for multiple tiers. Clients try all URLs from one tier in random order before moving on to the next tier.--notracker,-Tβ Remove trackers from an existing torrent.--webseed,-wURL β A webseed URL (BEP19). This option may be given multiple times.--nowebseed,-Wβ Remove webseeds from an existing torrent.--private,-pβ Tell clients to only use tracker(s) for peer discovery, not DHT or PEX.
Warning editing alert. When editing, this option changes the info hash and creates a new torrent.
--noprivate,-Pβ Allow clients to use trackerless methods like DHT and PEX for peer discovery.
Warning editing alert. When editing, this option changes the info hash and creates a new torrent.
--comment,-cCOMMENT β A comment that is stored in the torrent file.--nocomment,-Cβ Remove the comment from an existing torrent.--date,-dDATE β The creation date in the formatYYYY-MM-DD[ HH:MM[:SS]],nowfor the current time ortodayfor today at midnight. Default:now--nodate,-Dβ Remove the creation date from an existing torrent.--source,-sSOURCE β Add a βsourceβ field to the torrent file. This is usually used to make the torrentβs info hash unique per tracker.
Warning editing alert. When editing, this option changes the info hash and creates a new torrent.
--mergeJSON β Update existing metainfo inTORRENTwith a JSON object. This option may be given multiple times. Fields in JSON that have a value ofnull(unquoted) are removed in the outputTORRENT. Adding or removing items from an existing list is not supported.
This example adds a βcustomβ section to the βinfoβ section, removes the βcommentβ field and changes βcreation dateβ.
$ torf -i old.torrent \
--merge '{"info": {"custom": {"this": "that", "numbers": [1, 2, 3]}}}' \
--merge '{"comment": null, "creation date": 123456789}' \
-o new.torrent
This also works when creating a torrent.
$ torf path/to/my/files \
--merge '{"my stuff": {"my": ["s", "e", "c", "r", "e", "t"]}}'
Warning editing alert. If the βinfoβ section is modified, the info hash changes and a new torrent is created.
--nosource,-Sβ Remove the βsourceβ field from an existing torrent.
Warning editing alert. When editing, this option changes the info hash and creates a new torrent.
--xseed,-xβ Randomize the info hash to help with cross-seeding. This simply adds an entropy field to the info section of the metainfo and sets it to a random integer.
Warning editing alert. When editing, this option changes the info hash and creates a new torrent.
--noxseed,-Xβ De-randomize a previously randomized info hash of an existing torrent. This removes the entropy field from the info section of the metainfo.
Warning editing alert. When editing, this option changes the info hash and creates a new torrent.
--max-piece-sizeSIZE β The maximum piece size when creating a torrent.SIZEis multiplied by1 MiB(1048576bytes). The resulting number must be a multiple of16 KiB(16384bytes). Use fractions for piece sizes smaller than1 MiB(e.g.0.5for512 KiB).--creator,-aCREATOR β Name and version of the application that created the torrent.--nocreator,-Aβ Remove the name of the application that created the torrent from an existing torrent.--yes,-yβ Answer all yes/no prompts with βyesβ. At the moment, all this does is overwriteTORRENTwithout asking.--config,-fFILE β Read command line arguments from configurationFILE. See CONFIGURATION FILE. Default:$XDG_CONFIG_HOME/torf/configwhere$XDG_CONFIG_HOMEdefaults to~/.config--noconfig,-Fβ Do not use any configuration file.--profile,-zPROFILE β Use predefined arguments specified inPROFILE. This option may be given multiple times. See CONFIGURATION FILE.--verbose,-vβ Produce more output or be more thorough. This option may be given multiple times.- Display bytes with and without unit prefix, e.g. β
1.38 MiB / 1,448,576 Bβ. - Any other effects are explained in the relevant arguments' documentation.
- Display bytes with and without unit prefix, e.g. β
--json,-jβ Print information and errors as a JSON object. Progress is not reported.--metainfo,-mβ Print the torrentβs metainfo as a JSON object. Byte strings (e.g. βpiecesβ in the βinfoβ section) are encoded in Base64. Progress is not reported. Errors are reported normally on stderr.
Unless --verbose is given, any non-standard fields are excluded and metainfo that doesnβt represent a valid torrent results in an error.
Unless --verbose is given twice, the βpiecesβ field in the βinfoβ section is excluded.
--human,-uβ Display information in human-readable output even if stdout is not a TTY. See PIPING OUTPUT.--nohuman,-Uβ Display information in machine-readable output even if stdout is a TTY. See PIPING OUTPUT.--help,-hβ Display a short help text and exit.--version,-Vβ Display the version number and exit.
π EXAMPLES π
Create βfoo.torrentβ with two trackers and donβt store the creation date:
$ torf path/to/foo \
-t http://example.org:6881/announce \
-t http://example.com:6881/announce \
--nodate
Read βfoo.torrentβ and print its metainfo:
$ torf -i foo.torrent
Print only the name:
$ torf -i foo.torrent | grep '^Name' | cut -f2
Change the comment and remove the date from βfoo.torrentβ, write the result to βbar.torrentβ:
$ torf -i foo.torrent -c 'New comment' -D -o bar.torrent
Check if βpath/to/fooβ contains valid data as specified in βbar.torrentβ:
$ torf -i bar.torrent path/to/foo
π« EXCLUDING FILES π«
Okay bestie, this is the part where you get to be picky about what goes in your torrent. π
--excludetakes a glob pattern, and that pattern gets matched against every single file path beneath PATH. Anything that matches? Not going in the torrent, periodt. And matching is case-insensitive.--exclude-regexdoes the exact same thing as--exclude, except it takes a regular expression pattern and its matching is case-sensitive.--includeand--include-regexare applied just like their excluding twins, except any matching files are included β even if they also match some exclude pattern. Like, they get rescued. π«Ά
File paths start with the torrent's name (which is usually the last segment of PATH). So like, if PATH is "/home/foo/bar", every file path starts with "bar/".
Empty directories and empty files? Automatically excluded, no notes, they don't get an invite. π
Regular expressions should be Perl-compatible for simple patterns. The complete documentation lives at https://docs.python.org/3/library/re.html#regular-expression-syntax if you wanna go full nerd mode.
Glob patterns support these wildcard characters, and yes I'm listing every one of them:
*β matches everything?β matches any single character[SEQ]β matches any character in SEQ[!SEQ]β matches any character not in SEQ
βοΈ CONFIGURATION FILE βοΈ
A configuration file lists long-form command line options with all leading - characters removed. If an option takes a parameter, = is the separator, and spaces before and after that = are straight-up ignored. The parameter can be quoted with single or double quotes if you need to preserve leading and/or trailing spaces. Lines that start with # are ignored (they're just vibes, not instructions).
All the options listed in the OPTIONS section are allowed β except for PATH, in, out, name, config, noconfig, profile, help, version. Those do not live here.
There is rudimental support for environment variables in parameters. As usual, $FOO or ${FOO} is replaced with the value of the variable FOO, $ is escaped with \ (backslash), and a literal \ is represented by two \. More complex string manipulation syntax (e.g. ${FOO:3}) is not supported β don't try it, she's not built for that. π
π Profiles π
A profile is a set of options bound to a name, and that name is what you pass to the --profile option. In the configuration file it's specified as [PROFILE NAME] followed by a list of options.
Profiles inherit any options specified globally at the top of the file, but they can overload them. Main character energy β they take what they want and change the rest. π
β¨ Example β¨
This is an example configuration file with some global custom defaults and the two profiles foo and bar:
yes
nodate
exclude = *.txt
[foo]
tracker = https://foo1/announce
tracker = https://foo2/announce
private
[bar]
tracker = https://bar/announce
comment = I love bar.
With this configuration file, these arguments are always used:
--yes
--nodate
--exclude '*.txt'
If --profile foo is given, it also adds these arguments:
--tracker https://foo1/announce
--tracker https://foo2/announce
--private
If --profile bar is given, it also adds these arguments:
--tracker https://bar/announce
--comment 'I love bar.'
π€ PIPING OUTPUT π€
If stdout is not a TTY (i.e. when output is piped) or if the --nohuman option is provided, the output format is different. It's giving machine-readable, and honestly? Slay.
- Leading spaces are removed from each line.
- The delimiter between label and value, as well as between multiple values (files, trackers, etc) is a tab character (
"\t"or ASCII code0x9). Trackers are flattened into a one-dimensional list. - Numbers are not formatted (UNIX timestamps for times, seconds for time deltas, raw bytes for sizes, etc).
πͺ EXIT CODES πͺ
Every exit code, no skipping, this is the whole list:
1β Anything not specified below2β Unknown or invalid command line arguments3β Error while reading or parsing the config file4β Error while reading a torrent file or content5β Error while writing a torrent file6β Error while verifying a torrent's content128β Aborted bySIGINT(typically Ctrl+c was pressed)
π REPORTING BUGS π
Bug reports, feature requests and poems about hedgehogs are welcome on the issue tracker: https://github.com/rndusr/torf-cli/issues. Yes, poems. About hedgehogs. That is a real requirement and I am obsessed with it. π¦π
And that's a wrap on the whole page, bestie π this was TORF(1), dated 2026-05-31 β go forth, make torrents, write hedgehog poetry, and may all your globs match exactly what you meant. β¨π
π¦ where this page comes from
- ubuntu stonking: torf-cli 5.2.1-2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms