View on GitHub

KGet

A modern, lightweight wget clone written in Rust for fast and reliable file downloads from the command line.

KGet Banner

KGet v1.7.0

A fast, modern download manager written in Rust.
HTTP/HTTPS · FTP/SFTP · WebDAV · BitTorrent · Metalink · yt-dlp · CLI · GUI · Library

English Português Español

Why KGet?

Most download tools are either too simple (single-connection wget-clones) or too bloated (full Electron apps). KGet is a Rust-native download engine that gives you:


Features

Download Protocols

| Protocol | Flag | Notes | |———-|——|——-| | HTTP / HTTPS | (auto) | Multi-connection, resume, gzip/brotli/lz4, proxy | | FTP | --ftp | Authenticated or anonymous | | SFTP | --sftp | Password or key-based; host-key verification | | WebDAV | --webdav or webdav:// | HTTP Basic auth embedded in URL | | Magnet / BitTorrent | (auto-detected) | Built-in torrent client (torrent-native feature) | | Metalink .meta4 | --metalink | Multi-mirror fallback, SHA-256 verified (RFC 5854) | | Video sites | --ytdlp or (auto-detected) | YouTube, Vimeo, Twitch, TikTok, Instagram… via yt-dlp |

Download Engine

Integrity & Security

History & Persistence

GUIs

Library


Screenshots

macOS App CLI Interactive

image

Installation

Homebrew (macOS / Linux)

brew tap davimf721/kget
brew install kget                           # CLI only
brew install kget --with-gui                # with egui graphical interface
brew install kget --with-torrent            # with native BitTorrent client
brew install kget --with-gui --with-torrent # all optional features

Pre-built binaries

Download the latest release from Releases:

From crates.io

cargo install Kget --features gui   # with egui GUI
cargo install Kget                  # CLI only

From source

# Rust toolchain: https://rustup.rs

# Linux dependencies (Debian/Ubuntu)
sudo apt install -y libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
                    libxkbcommon-dev libssl-dev pkg-config

git clone https://github.com/davimf721/KGet.git
cd KGet
cargo build --release --features gui
./target/release/kget --gui

Usage

Basic downloads

# HTTP/HTTPS
kget https://example.com/file.zip

# Save to a specific location
kget -O ~/Downloads/myfile.zip https://example.com/file.zip

# Turbo mode — parallel connections, resumable
kget -a https://releases.ubuntu.com/24.04/ubuntu-24.04-desktop-amd64.iso

# Quiet mode
kget -q https://example.com/file.zip

Protocols

# FTP (anonymous or authenticated)
kget --ftp ftp://ftp.gnu.org/gnu/emacs/emacs-28.2.tar.gz
kget --ftp ftp://user:pass@server/file.zip

# SFTP (password or key-based)
kget --sftp sftp://user:pass@server/path/to/file.dat
kget --sftp sftp://user@server/path/to/file.dat

# WebDAV (auto-detected from scheme)
kget webdav://files.myserver.com/share/report.pdf
kget webdavs://user:pass@nas.local/backups/db.tar.gz

# Magnet link (auto-detected)
kget "magnet:?xt=urn:btih:HASH&dn=filename"

# Metalink — tries mirrors in priority order, verifies SHA-256
kget --metalink ubuntu-24.04.meta4
kget https://releases.ubuntu.com/ubuntu.meta4

Video downloads

# Auto-detected from URL host
kget https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Explicit flag with quality
kget --ytdlp --quality 1080p https://vimeo.com/123456
kget --ytdlp --quality audio https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Qualities: best, 1080p, 720p, 480p, 360p, audio

Batch & scheduling

# Batch — one URL per line, # = comment
kget --batch urls.txt -O ~/Downloads/

# Schedule for tonight at 11pm
kget --at "23:00" -a https://example.com/large-file.iso

Checksums & verification

# Verify against expected SHA-256
kget --sha256 abc123def456... https://example.com/file.iso

# Auto-extract after download
kget --extract https://example.com/archive.tar.gz

# Custom headers (useful for authenticated APIs)
kget -H "Authorization: Bearer token123" -H "Accept: application/json" https://api.example.com/export

History

kget --history                    # list last 50 downloads
kget --history-clear              # remove all entries
kget --history-clear completed    # remove only completed/cancelled

Interactive REPL

kget --interactive
kget> download -a -o ~/Downloads/ubuntu.iso https://releases.ubuntu.com/...
kget> download --sftp sftp://user@server/backups/db.sql.gz
kget> download --ytdlp --quality 720p https://youtube.com/watch?v=...
kget> config set connections 8
kget> config set speed-limit 1048576
kget> history
kget> help

JSONL events (for scripts and agents)

kget --jsonl -a https://example.com/file.iso | jq '.percent'

All CLI flags

Flag Description
-a, --advanced Turbo mode — parallel connections, resumable
-O <path> Output file or directory
-q, --quiet Minimal output
-p <proxy> HTTP/SOCKS5 proxy
-l <bytes/s> Speed limit in bytes per second
-H "Name: Value" Extra HTTP header (repeatable)
--sha256 <hash> Verify SHA-256 after download
--extract Auto-extract archives after download
--at "HH:MM" Schedule download for a specific local time
--batch <file> Download all URLs from a file
--ftp Use FTP protocol
--sftp Use SFTP protocol
--webdav Use WebDAV protocol
--ytdlp Route through yt-dlp (auto-detected for video sites)
--quality <q> yt-dlp quality: best, 1080p, 720p, 480p, 360p, audio
--metalink Download from a Metalink manifest
--history Show download history
--history-clear [completed] Clear history
--jsonl Emit JSON Lines events to stdout
--gui Launch egui graphical interface
-i, --interactive Interactive REPL mode

Library Usage

KGet is also a reusable Rust library. Add it to your project:

[dependencies]
Kget = "1.7.0"

# Optional: torrent client
Kget = { version = "1.7.0", features = ["torrent-native"] }

# Optional: async API
Kget = { version = "1.7.0", features = ["async"] }
use kget::KgetError;

// Simple download
kget::builder("https://example.com/file.zip")
    .output("./downloads/")
    .connections(8)
    .sha256("abc123...")
    .download()?;

// Parallel batch with event channel
let results = kget::batch([
    "https://mirror1.example.com/file.iso",
    "https://mirror2.example.com/other.tar.gz",
])
.concurrency(4)
.output_dir("./downloads/")
.download_all();

for r in results {
    match r.result {
        Ok(d) => println!("✓ {} — {:.1} MB/s avg", r.url, d.avg_speed_bps as f64 / 1e6),
        Err(e) => eprintln!("✗ {}: {}", r.url, e),
    }
}

// Event channel
let (handle, rx) = kget::builder("https://example.com/large.iso")
    .connections(4)
    .spawn()?;

for event in rx {
    match event {
        kget::DownloadEvent::Progress { percent, .. } => print!("\r{:.1}%", percent),
        kget::DownloadEvent::Completed { path, .. } => println!("\nSaved to {}", path),
        kget::DownloadEvent::Error(e) => eprintln!("Error: {}", e),
        _ => {}
    }
}
handle.join().ok();

See LIB.md for the complete library reference.


Building

# CLI only (no GUI)
cargo build --release

# With egui GUI (Linux/Windows/macOS)
cargo build --release --features gui

# With native torrent client
cargo build --release --features torrent-native

# All features
cargo build --release --features gui,torrent-native,torrent-transmission

# Native macOS app + DMG (requires Xcode)
./build-native-macos.sh

# Cross-compile Linux/Windows from macOS (requires zig)
brew install zig && cargo install cargo-zigbuild
./build-cross.sh

Testing

cargo test                          # all tests
cargo test --lib --test unit_tests  # unit tests only
cargo test --test mock_server_tests # HTTP mock server tests
./run-tests.sh                      # full suite with lint and format check

Platform Support

Platform CLI egui GUI Native App
macOS ✅ SwiftUI DMG
Linux
Windows

License

MIT — see LICENSE