A BitTorrent client library and command-line tool for downloading and managing torrents.
- Download torrents from the BitTorrent network using .torrent files or magnet links
- Discover peers without trackers via the Distributed Hash Table (DHT) network
- Fetch metadata to download .torrent files from peers using just an info-hash
- Verify downloads against piece checksums to ensure data integrity
- Run as a DHT node to participate in the decentralized peer discovery network
docker pull ghcr.io/torrentdam/cmd:latest
docker run --rm ghcr.io/torrentdam/cmd:latest --helpA native (Scala Native) image built from the CI-produced binary on Ubuntu is also published:
docker pull ghcr.io/torrentdam/cmd-native:latest
docker run --rm ghcr.io/torrentdam/cmd-native:latest --helpDownload a torrent:
torrentdam torrent download --info-hash <hash> --save /downloadsFetch a .torrent file from the DHT:
torrentdam torrent fetch-file --info-hash <hash> --save file.torrentVerify a download:
torrentdam torrent verify --torrent file.torrent --target /downloadsRun torrentdam --help for complete command reference.
Enter a development environment with JDK 21, Mill, and transmission via Nix:
nix developTransmissionIntegrationSuite is a true end-to-end test: it generates a
random payload (16 MB), seeds it with a real transmission daemon, and verifies
that the torrentdam CLI downloads it over the peer-to-peer wire protocol using
only the --peer flag (no DHT discovery). The test is fully self-contained
and needs no internet access.
The test needs transmission-daemon, transmission-create, and
transmission-remote on the PATH (all provided by nix develop). It builds
the CLI assembly jar via mill cmd.assembly if TORRENT_TEST_CMD_JAR is not
set.
nix develop
mill cmd.assembly
export TORRENT_TEST_CMD_JAR="$PWD/out/cmd/assembly.dest/out.jar"
mill e2e.jvm.testUnlicense - Public Domain