CLI tool to create, read and edit torrent files


Keywords
bittorrent, torrent, magnet, cli, magnet-link, magnet-uri, torrent-files
License
CNRI-Python-GPL-Compatible
Install
pip install torf-cli==5.2.0

Documentation

torf-cli

torf-cli is a command line tool that can create, read and edit torrent files and magnet URIs. It can also verify a file system path against a torrent and provide detailed errors. When creating a torrent, it can find an existing torrent with the same files and copy its piece hashes to the freshly created torrent to avoid hashing the files again.

The output is pleasant to read for humans or easy to parse with common CLI tools.

An optional configuration file specifies custom default options and profiles that combine commonly used options.

Documentation is available as a man page, or you can read it here.

The only dependencies are torf and pyxdg.

Examples

Create private torrent with two trackers and a specific creation date:

Display information about an existing torrent:

Quickly add a comment to an existing torrent:

Verify the files in docs:

Get a list of files via grep and cut:

Get a list of files via jq:

Get metainfo as JSON:

Installation

The latest release is available on PyPI and on AUR.

pipx

The easiest and cleanest installation method is pipx, which installs each application with all dependencies in a separate virtual environment in ~/.local/venvs/ and links the executable to ~/.local/bin/.

The only drawback is that, at the time of writing, pipx doesn't make the man page available, but it's also available here.

pip

The alternative is regular pip, but if you decide to uninstall, you have to manually uninstall the dependencies.

The latest development version is available on GitHub in the master branch.

Contributing

Bug reports and feature requests are welcome in the issue tracker.

License

torf-cli is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.