Clover (π) is a lightweight, fast, leech-only torrent client written in Go. It implements the core BitTorrent protocol to download torrents directly from the terminal.
- Torrent parsing - Implements an encoder and decoder for parsing bencode encoded .torrent files.
- Dual peer discovery - Finds peers via both UDP trackers and the DHT network, merging them into a single stream.
- Concurrent downloads - Manages multiple peer connections to download pieces simultaneously.
- Session management - Supports resuming and deleting stopped downloads.
- Clean CLI stats - Real-time stats showing a progress bar, percentage completed, pieces downloaded, active peer count, and time elapsed.
- Go
You can install the latest pre-compiled binary of Clover automatically.
Run the following command in your terminal to download and run the installer:
curl -fsSL https://raw.githubusercontent.com/JoelVCrasta/clover/main/scripts/install.sh | shNote: By default, this installs the binary to /usr/local/bin. If write permission is denied, it will prompt for sudo. To install to a different directory, download the script and specify BIN_DIR, for example:
curl -fsSL https://raw.githubusercontent.com/JoelVCrasta/clover/main/scripts/install.sh -o install.sh
chmod +x install.sh
BIN_DIR=$HOME/.local/bin ./install.shRun the following command in PowerShell:
irm https://raw.githubusercontent.com/JoelVCrasta/clover/main/scripts/install.ps1 | iexNote: This downloads clover.exe to $HOME\.clover\bin and appends it to your User PATH environment variable. You will need to restart your terminal after installation.
If you have Go installed and want to build the executable from source:
git clone https://github.com/JoelVCrasta/clover.git
cd clover
go build ./cmd/cloverTo download a torrent, use the download subcommand. The --input (-i) flag is required.
# Using go run:
go run ./cmd/clover/main.go download -i <path-to-torrent-file> -o <output-directory>
# Using the built binary:
clover download -i <path-to-torrent-file> -o <output-directory>If the output flag is not provided, then it will download to the ~/Downloads directory.
# Download to a specific directory
clover download -i ~/downloads/ubuntu.torrent -o ~/downloads/
# Download to the default ~/Downloads directory
clover download -i ~/downloads/ubuntu.torrentTo see the list of paused downloads:
clover listTo resume a paused download by its index (from the list command):
clover resume <index>To delete a download session by its index (from the list command):
clover delete <index>.
βββ client
β βββ bitfield.go
β βββ client.go
βββ cmd
β βββ clover
β β βββ main.go
β βββ example
β βββ main.go
βββ config
β βββ config.go
βββ dht
β βββ dht.go
βββ download
β βββ download.go
β βββ state.go
β βββ save.go
βββ handshake
β βββ handshake.go
βββ message
β βββ message.go
βββ metainfo
β βββ decode.go
β βββ encode.go
β βββ hash.go
β βββ torrentfile.go
βββ peer
β βββ peer.go
β βββ peer_id.go
ββββ tracker
β βββ scrape.go
β βββ tracker.go
β βββ tracker_test.go
βββ torrent.go
βββ discover_peers.go
βββ go.mod
βββ go.sum