Skip to content
/ leech Public

Leech is concurrent download manager from command line

License

Notifications You must be signed in to change notification settings

vigo/leech

Repository files navigation

Version Go Run golangci-lint Run go tests codecov

Leech

Concurrent command-line download manager. Inspired from Leech macOS application!

Features

  • Concurrent chunked downloads (parallel byte-range fetches)
  • Multiple URL support (pipe and/or arguments)
  • Progress bar with real-time terminal output
  • Bandwidth limiting (shared token bucket across all downloads)
  • Resume support (.part files, continues from where it left off)
  • Single-chunk fallback for servers without Accept-Ranges
  • Structured logging with log/slog (debug mode via -verbose)

Requirements

  • Go 1.26+

Installation

Homebrew (macOS)

brew tap vigo/leech
brew install leech

Cask Conflict: Homebrew's official cask registry has an app called Leech (a GUI download manager by Many Tricks). If that cask is installed, brew install leech will install the formula but skip linking the binary. To fix this:

brew install vigo/leech/leech
brew link --overwrite leech

Go

go install github.com/vigo/leech@latest

Build from source

git clone https://github.com/vigo/leech.git
cd leech
make build

Usage

# single URL
leech https://example.com/file.zip

# multiple URLs
leech https://example.com/file1.zip https://example.com/file2.zip

# pipe URLs
cat urls.txt | leech

# with options
leech -verbose -chunks 10 -limit 5M -output ~/Downloads https://example.com/file.zip

Flags

-version        display version information
-verbose        verbose output / debug logging (default: false)
-chunks N       chunk size for parallel download (default: 5)
-limit RATE     bandwidth limit, e.g. 5M, 500K (default: 0, unlimited)
-output DIR     output directory (default: current directory)

Bandwidth Limit Examples

leech -limit 1M  ...   # 1 MB/s total
leech -limit 500K ...  # 500 KB/s total
leech -limit 2G  ...   # 2 GB/s total (why not)

Development

make build    # build binary
make test     # run tests with race detector
make lint     # run golangci-lint v2
make clean    # remove binary and .part files
make install  # go install

Pre-commit

pre-commit install
pre-commit run --all-files

Contributor(s)


Contribute

All PR's are welcome!

  1. fork (https://github.com/vigo/leech/fork)
  2. Create your branch (git checkout -b my-feature)
  3. commit yours (git commit -am 'add some functionality')
  4. push your branch (git push origin my-feature)
  5. Than create a new Pull Request!

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.


License

This project is licensed under MIT

About

Leech is concurrent download manager from command line

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •