ranget

command module
v0.0.0-...-095e5a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 11 Imported by: 0

README

ranget

A multi-threaded HTTP downloader with resume capability, proxy support, and MCP server integration.

Features

  • Multi-threaded HTTP downloads with range request support
  • Resume interrupted downloads with state file persistence
  • Automatic retry with exponential backoff (unlimited retries by default)
  • Progress tracking for all segments, including finished ones
  • Proxy support with optional authentication
  • HTTP redirect handling (301, 302, 303, 307, 308)
  • MCP (Model Context Protocol) server for AI agent integration
  • Cross-platform support (Linux, macOS, Windows, FreeBSD)
  • Signal handling for graceful shutdown (Ctrl+C)

Installation

Using Go
go install github.com/computeio/ranget@latest
Download Binary

Download the appropriate binary for your platform from the Releases page.

Usage

CLI Mode
# Download a file
ranget https://example.com/file.zip

# With custom thread count
ranget -t 8 https://example.com/file.zip

# With proxy
ranget -p proxy.example.com:8080 https://example.com/file.zip

# With proxy authentication
ranget -p user:pass@proxy.example.com:8080 https://example.com/file.zip

# With custom output name
ranget -n myfile.zip https://example.com/file.zip

# Enable stdout progress
ranget -s https://example.com/file.zip

# Set request timeout (default: 30 seconds)
ranget -timeout 60 https://example.com/file.zip
MCP Server Mode

Run ranget as an MCP server for AI agent integration:

ranget -m

The MCP server provides two tools:

  • download - Download a file with configurable options
  • check - Check if a URL supports range requests

Options

Option Short Description
-proxy -p Proxy server (host:port or user:pass@host:port)
-threads -t Number of download threads (default: 4)
-name -n Output filename
-stdout -s Enable stdout output
-timeout Request timeout in seconds (default: 30)
-mcp -m Run as MCP server
-version -v Show version
-help -h Show help

Resume Capability

ranget automatically saves download progress to a .state file. If a download is interrupted, simply run the same command again to resume.

The state file is automatically removed upon successful completion.

Logging

Logs are written to ~/logs/ranget-<name>.log for troubleshooting. The log file is truncated on each run.

Development

Build

Using Make:

make build              # Build for current platform
make build-all          # Build for all platforms
make build-linux        # Build for Linux only
make build-darwin       # Build for macOS only
make build-windows      # Build for Windows only

Using Go directly:

go build .
Test
make test              # Run tests
make test-race         # Run tests with race detection
Other Make targets
make clean             # Remove build artifacts
make fmt               # Format code
make release           # Create release packages
make help              # Show all available targets

License

MIT

Documentation

Overview

ranget is a multi-threaded HTTP downloader with resume capability.

Directories

Path Synopsis
internal
downloader
Package downloader implements multi-threaded HTTP range downloads.
Package downloader implements multi-threaded HTTP range downloads.
logger
Package logger provides file-based logging for ranget.
Package logger provides file-based logging for ranget.
mcp
Package mcp implements a stdio-based MCP server for ranget.
Package mcp implements a stdio-based MCP server for ranget.
proxy
Package proxy handles HTTP proxy configuration with optional authentication.
Package proxy handles HTTP proxy configuration with optional authentication.
state
Package state manages download progress persistence for resume capability.
Package state manages download progress persistence for resume capability.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL