MCPcopy Index your code
hub / github.com/davimf721/KGet

github.com/davimf721/KGet @v1.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.7.0 ↗ · + Follow
464 symbols 919 edges 33 files 140 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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:

  • Turbo multi-connection downloads — splits files into parallel byte ranges (up to 32× speed on fast connections)
  • Full protocol coverage — HTTP/HTTPS, FTP/SFTP, WebDAV, magnet links, and yt-dlp in one binary
  • Three frontends, one engine — native macOS SwiftUI app, cross-platform egui GUI (Linux/Windows), and a polished CLI
  • A reusable Rust library — embed the download engine in your own app with a fluent builder API, typed errors, and event channels

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

  • Turbo mode (-a) — parallel byte-range connections, resumable after interruption
  • Batch download (--batch urls.txt) — one URL per line, # = comment, all run in parallel
  • Download scheduling (--at "HH:MM") — sleep until a specific local wall-clock time
  • Speed limiting (-l <bytes/s>) — global token-bucket throttle across all parallel threads
  • Custom HTTP headers (-H "Name: Value") — inject arbitrary headers into any request
  • Auto-extract archives (--extract) — unzip/tar/7z after download (.zip, .tar.gz, .7z, …)
  • SHA-256 verification (--sha256 <hash>) — hard-error on mismatch; never silently accepts corrupt files
  • Sidecar checksum files — verifies against GNU/BSD .sha256sum files
  • Content-Disposition — uses server-suggested filenames automatically
  • Filename safety — rejects null bytes, path traversal, Windows reserved names, and >255-byte filenames

Integrity & Security

  • Multi-algorithm checksums — SHA-256, SHA-512, SHA-1, MD5, BLAKE3
  • SFTP host-key verification — checks ~/.ssh/known_hosts; hard-errors on mismatch
  • Retry policy — retries on 5xx and network errors only; fails immediately on 4xx
  • JSONL events (--jsonl) — machine-readable progress for scripts and agents

History & Persistence

  • Download history — every download recorded to history.json; --history / --history-clear
  • Interactive REPL (--interactive) — full command history, all protocols, live config editing

GUIs

  • Native macOS app — SwiftUI, NavigationSplitView sidebar, clipboard monitor, drag-and-drop URLs, speed sparkline, history tab, Share Extension, menu bar
  • Cross-platform egui GUI (--gui) — Apple-inspired design, system-adaptive dark/light, sidebar navigation, shimmer progress bar

Library

  • Fluent builder APIkget::builder(url).connections(8).sha256("…").download()?
  • Typed errorsKgetError enum with From impls for reqwest::Error, io::Error
  • Event channel.spawn() returns (JoinHandle, Receiver<DownloadEvent>)
  • Async API.download_async() / .download_all_async() behind --features async
  • In-memory download.download_to_bytes() and .download_to_reader()
  • Batch builderkget::batch([…]).concurrency(4).download_all()

Screenshots

macOS App CLI

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: - macOSKGet-1.7.0-macOS-Native.dmg (native SwiftUI app, no Rust needed) - Linux/Windows — CLI binary or GUI binary (see release assets)

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"] }

Builder API (recommended)

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

Links

Community

License

MIT — see LICENSE

Core symbols most depended-on inside this repo

label
called by 46
src/gui.rs
get_filename_from_url_or_default
called by 23
src/utils.rs
download
called by 16
src/builder.rs
print
called by 14
src/utils.rs
spawn
called by 13
src/builder.rs
resolve_output_path
called by 12
src/utils.rs
create_progress_bar
called by 12
src/progress.rs
path
called by 12
src/queue.rs

Shape

Function 232
Method 180
Class 39
Enum 13

Languages

Rust99%
Ruby1%

Modules by API surface

tests/torrent_tests.rs53 symbols
src/gui.rs50 symbols
tests/unit_tests.rs49 symbols
src/builder.rs48 symbols
tests/cli_tests.rs28 symbols
src/advanced_download.rs25 symbols
src/torrent/native.rs24 symbols
src/queue.rs20 symbols
tests/mock_server_tests.rs16 symbols
src/optimization.rs13 symbols
src/config.rs13 symbols
src/metalink/mod.rs12 symbols

For agents

$ claude mcp add KGet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page