No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mike 'Fuzzy' Partin 180bd689a2
All checks were successful
Test and Release / test (pull_request) Successful in 2m4s
Test and Release / lint (pull_request) Successful in 3m17s
feat: chore(deps): update konsoru to v1.0.1 and add indirect deps
2026-07-15 12:18:39 -07:00
.forgejo/workflows fix(release): correct build target from ./cmd/9biff to ./cmd/pget 2026-07-15 10:29:42 -07:00
cmd/pget feat(download): implement checksum verification with --checksum flag 2026-07-13 22:51:53 -07:00
internal feat(config): warn on invalid environment variable values 2026-07-15 10:35:00 -07:00
vendor feat: chore(deps): update konsoru to v1.0.1 and add indirect deps 2026-07-15 12:18:39 -07:00
.gitignore chore(deps): add core dependencies (konsoru, ftp) 2026-07-13 10:13:53 -07:00
.golangci.yml test: add unit tests for all untested packages 2026-07-14 04:35:27 -07:00
.goreleaser.yml ci: add golangci-lint and goreleaser configuration files 2026-07-13 10:01:23 -07:00
.pre-commit-config.yaml chore: add pre-commit configuration for code quality and security checks 2026-07-13 10:01:32 -07:00
go.mod feat: chore(deps): update konsoru to v1.0.1 and add indirect deps 2026-07-15 12:18:39 -07:00
go.sum feat: chore(deps): update konsoru to v1.0.1 and add indirect deps 2026-07-15 12:18:39 -07:00
README.md docs: add comprehensive README with examples and installation instructions 2026-07-14 02:05:37 -07:00
ROADMAP.md docs(roadmap): mark benchmarking and performance tuning complete 2026-07-14 03:57:10 -07:00

pget — Parallel file downloader

pget downloads files over HTTP and FTP using multiple parallel connections, with resume support, rate limiting, checksum verification, and a real-time progress bar.

Installation

# From source
git clone https://git.lan.thwap.org/thwap/pget.git
cd pget
go build -o pget ./cmd/pget

Usage

pget [options] <url>

Options

Flag Default Description
-n 3 Number of concurrent connections
-o (from URL) Output file path
-c false Resume partial download
-t 30s Request/connection timeout
-r 3 Max retries per chunk
--rate (unlimited) Download speed limit (e.g. 500k, 2M, 1G)
--checksum (none) Expected SHA256 (64 hex) or MD5 (32 hex) checksum
--header (none) Custom HTTP header, can be repeated
-A pget/1.0 User-Agent header
-q false Suppress non-error output
-v false Verbose output (worker details, server caps)

Examples

Basic download:

pget https://example.com/file.iso

File gets saved as file.iso (derived from URL). If it already exists, saves as file-1.iso.

With output path:

pget -o myfile.iso https://example.com/file.iso

Parallel download (5 connections):

pget -n 5 https://example.com/large-file.iso

Resume partial download:

pget -c https://example.com/large-file.iso

Rate-limited download (500 KB/s):

pget --rate=500k https://example.com/file.iso

Verify checksum after download:

pget --checksum=abcd1234... https://example.com/file.iso

Supports both SHA256 (64 hex chars) and MD5 (32 hex chars).

Custom HTTP headers:

pget --header "Authorization: Bearer token" https://example.com/file.iso
pget --header "Cookie: session=abc" --header "X-Custom: value" https://example.com/file.iso

FTP download:

pget ftp://example.com/file.iso
pget ftp://user:pass@example.com/file.iso
pget ftps://example.com/file.iso

FTPS (TLS) is supported via ftps:// scheme. Credentials resolve from URL, ~/.netrc, or anonymous fallback.

Verbose output:

pget -v https://example.com/file.iso

Shows worker retries, completions, and server capabilities (file size, range support).

Configuration

Create ~/.pgetrc to set persistent defaults:

concurrency = 5
timeout = 60s
rate = 1M
user-agent = my-agent/1.0
verbose = true

Priority: built-in defaults < config file < CLI flags < environment variables.

Environment Variables

Variable Overrides
PGET_CONCURRENCY -n
PGET_RETRIES -r
PGET_TIMEOUT -t
PGET_USER_AGENT -A
PGET_OUTPUT -o
PGET_RESUME -c
PGET_QUIET -q
PGET_VERBOSE -v
PGET_RATE --rate
PGET_CHECKSUM --checksum
PGET_HEADER --header (semicolon-separated pairs)

Features

  • Parallel chunked downloads (configurable concurrency)
  • HTTP range request support with single-stream fallback
  • FTP/FTPS with REST command support
  • Real-time progress bar with speed and ETA
  • Resume interrupted downloads (-c)
  • Rate limiting (--rate)
  • SHA256/MD5 checksum verification (--checksum)
  • Custom HTTP headers (--header)
  • .netrc credential support for FTP
  • .pgetrc configuration file (~/.pgetrc)
  • Signal handling (SIGINT/SIGTERM — clean shutdown, resume-state save)
  • Verbose mode (-v) for worker-level detail