Skip to main content
The Downloader is a lightweight replacement for wget that provides file downloading capabilities with support for custom TLS certificates and automatic retries.

Overview

Downloader simplifies the process of downloading files from URLs with built-in support for:
  • Custom CA certificates
  • TLS client authentication
  • Automatic retry logic
  • Directory prefix management
  • File clobbering protection

Usage

downloader [flags] <url>

Parameters

url
string
required
URL to download from

Output Options

--output-file
string
default:"basename of URL"
Destination file path to download to. Can be shortened to -O.
--directory-prefix
string
Directory prefix for the downloaded file. Can be shortened to -P. Cannot be used with --output-file.

Download Behavior

--no-clobber
boolean
default:"false"
Do not overwrite existing files. If the file already exists, the download will be skipped.
--no-verbose
boolean
default:"false"
Suppress verbose output and only show warnings and errors.

TLS Options

--ca-certificate
string
Path to a root certificate authority file to use when downloading files.
--certificate
string
Path to a TLS client certificate file to use for authentication.
--private-key
string
Path to a TLS client private key file to use for authentication. Must be used with --certificate.

Logging Options

--log-file
string
Path to file for log output.
--log-level
string
default:"info"
Log level: panic, fatal, error, warn, info, debug, trace.

Examples

Basic Download

Download a file to the current directory:
downloader https://example.com/file.tar.gz
The file will be saved as file.tar.gz in the current directory.

Download to Specific Location

Download and save with a custom filename:
downloader -O /path/to/output.tar.gz https://example.com/file.tar.gz

Download to Directory

Download to a specific directory while keeping the original filename:
downloader -P /path/to/directory https://example.com/file.tar.gz

Skip Existing Files

Avoid re-downloading if the file already exists:
downloader --no-clobber -O output.tar.gz https://example.com/file.tar.gz

Download with Custom CA Certificate

Download from a server with a custom certificate authority:
downloader --ca-certificate /path/to/ca.crt https://example.com/file.tar.gz

Download with Client Authentication

Download using TLS client certificate authentication:
downloader \
  --certificate /path/to/client.crt \
  --private-key /path/to/client.key \
  https://example.com/file.tar.gz

Features

Automatic Retry Logic

Downloader includes built-in retry logic to handle temporary network issues and ensure reliable downloads.

Query String Handling

When no output filename is specified, the tool automatically strips query strings from the URL to determine the output filename:
# Downloads as "file.tar.gz" not "file.tar.gz?token=abc123"
downloader https://example.com/file.tar.gz?token=abc123

System Certificate Pool

By default, Downloader uses the system certificate pool. Custom CA certificates are added to this pool rather than replacing it.

Error Handling

Downloader provides clear error messages for common issues:
  • Invalid URLs
  • Missing or invalid certificates
  • File permission errors
  • Network connectivity problems
The --output-file and --directory-prefix options cannot be used together. Choose one based on your needs.

Build docs developers (and LLMs) love