piko is a command-line and Go library for segmented HTTP downloads using range requests, with support for resume, custom DNS, proxies, and multiple connection strategies.

Stars

62

7-day growth

No data

Forks

2

Open issues

0

License

GPL-3.0

Last updated

2026-07-26

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It offers a dedicated segmented downloader with fine-grained control over parallelism, connection strategy, and protocol version, plus a reusable Go library for programmatic use.

Who it is for

  • Go developers needing segmented download capabilities
  • CLI users who want fast, resumable downloads of large files
  • System administrators optimizing bulk file transfers
  • Developers integrating download speed tests into applications

Use cases

  • Downloading large files faster by splitting into parallel range requests
  • Resuming interrupted downloads without restarting
  • Speed-testing download throughput by discarding output
  • Adding segmented download logic to Go programs with custom DNS and proxy

Strengths

  • Supports resume via .part and .part.resume files with ETag/Last-Modified validation
  • Offers multiple connection strategies (round-robin, fastest, sequential) and IP family control
  • Provides a Go library with Download, DownloadBytes, and reusable client for random-range reads
  • Accepts custom DNS resolvers (UDP, DoT, DoH) and proxy configurations, including environment variables

Considerations

  • Only works with servers that support HTTP range requests; for ordinary single-stream downloads curl is recommended
  • No built-in single-stream fallback mechanism (requires --no-fallback to disable adaptive concurrency)
  • Limited to HTTP/1.1 and HTTP/2; no mention of HTTP/3 or non-HTTP protocols

README quick start

piko

简体中文

A small segmented downloader for CLI and Go programs.

piko can save to a file, discard output for speed tests, or return downloaded bytes to your own code. It supports HTTP protocol selection, connection strategies, custom DNS resolvers, proxies, retries, and progress callbacks.

piko currently supports HTTP range/segmented downloads. For ordinary single-stream downloads, use curl instead.

Install

go install github.com/UruhaLushia/piko/cmd/piko@latest

Or download prebuilt binaries from GitHub Releases.

CLI

piko [flags]  [output]

Examples:

# Download with 32 range workers
piko -n 32 -o file.pkg https://example.com/file.pkg

# Always use all 32 workers without adaptive concurrency fallback
piko -n 32 --no-fallback -o file.pkg https://example.com/file.pkg

# Resume an interrupted download
piko -r -o file.pkg https://example.com/file.pkg

# Speed test without saving
piko -n 32 -o NUL https://example.com/file.pkg
piko -n 32 -o /dev/null https://example.com/file.pkg

# Force HTTP/2 or HTTP/1.1
piko --http h2 https://example.com/file.pkg
piko --http h1.1 https://example.com/file.pkg

# Custom request headers
piko -H "Authorization: Bearer token" -H "Accept: application/octet-stream" https://example.com/file.pkg

# Spread parallel dials across resolved IPs (default)
piko -n 32 --connect-strategy round-robin https://example.com/file.pkg

# Race resolved IPs and use the fastest connection
piko -n 32 --connect-strategy fastest https://example.com/file.pkg

# Limit or prefer an IP family
piko -n 32 --ip-family ipv4 https://example.com/file.pkg
piko -n 32 --ip-family prefer-ipv4 https://example.com/file.pkg

# Proxy
piko --proxy http://127.0.0.1:7890 https://example.com/file.pkg
piko --proxy env https://example.com/file.pkg
piko --proxy direct https://example.com/file.pkg

# Custom DNS
piko --dns udp://1.1.1.1 https://example.com/file.pkg
piko --dns dot://cloudflare-dns.com https://example.com/file.pkg
piko --dns https://cloudflare-dns.com/dns-query https://example.com/file.pkg

Config is loaded from ~/.config/piko first, then ~/.piko. Each directory supports config.yaml, config.yml, config.toml, or config.json. CLI flags and positional output override config values.

See examples/config.yaml for a complete config file.

Useful flags:

Related repositories

Similar projects matched by category, topics, and programming language.

nethical6
Featured
nethical6 GitHub avatar

conversation-steganography

A tool that hides encrypted secret messages inside innocent-looking AI-generated chat text for private communication over any messaging platform.

Go
1,149
programmersd21
Featured
programmersd21 GitHub avatar

flow

flow is a minimalist terminal dashboard that displays real-time network throughput with smooth animations, multiple responsive modes, and zero configuration.

Developer ToolsCLI & Terminal
277
MobAI-App
MobAI-App GitHub avatar

simslim

simslim reduces iOS simulator memory usage by 4x by disabling unnecessary background daemons, allowing many more simulators to run on a single Mac.

Go
248