ngdp-client

Crates.iongdp-client
lib.rsngdp-client
version0.4.3
created_at2025-06-29 07:06:09.635725+00
updated_at2025-08-11 12:12:53.620139+00
descriptionCommand-line interface for Blizzard's NGDP with product queries, certificate management, and key operations
homepagehttps://github.com/wowemulation-dev/cascette-rs
repositoryhttps://github.com/wowemulation-dev/cascette-rs
max_upload_size
id1730473
size505,166
Daniel S. Reichenbach (danielsreichenbach)

documentation

README

ngdp-client

Command-line interface for interacting with Blizzard's NGDP (Next Generation Distribution Pipeline) services.

Features

  • 📦 Query product information from Ribbit protocol
  • 📂 Manage local CASC storage (placeholder)
  • ⬇️ Download content using TACT protocol (placeholder)
  • 🔍 Inspect NGDP data structures
  • 🔐 Download certificates by SKI/hash
  • ⚙️ Configuration management
  • 💾 Built-in caching for API responses
  • 🔄 Automatic fallback from Ribbit to TACT on failures
  • 📊 View historical build data from Wago Tools API

Installation

Install from crates.io

cargo install ngdp-client

Install with Script (Unix/Linux/macOS)

curl -fsSL https://raw.githubusercontent.com/wowemulation-dev/cascette-rs/main/install.sh | bash

Install with Script (Windows PowerShell)

irm https://raw.githubusercontent.com/wowemulation-dev/cascette-rs/main/install.ps1 | iex

Build from source

git clone https://github.com/wowemulation-dev/cascette-rs
cd cascette-rs
cargo install --path ngdp-client

Usage

Basic Commands

# Show help
ngdp --help

# List all products
ngdp products list

# Filter products by name
ngdp products list --filter wow

# Show product versions
ngdp products versions wow

# Show all regions for a product
ngdp products versions wow --all-regions

# Get product information (specific region)
ngdp products info wow --region eu

# Get product information (all regions)
ngdp products info wow

# Show CDN configuration for a specific region
ngdp products cdns wow --region us

# Show all historical builds for a product
ngdp products builds wow

# Filter builds by version pattern
ngdp products builds wow --filter "11.1.7"

# Show only builds from last 7 days
ngdp products builds wow --days 7

# Limit results to 10 most recent builds
ngdp products builds wow --limit 10

# Show only background download builds
ngdp products builds wow --bgdl-only

Output Formats

The CLI supports multiple output formats:

# Default text output
ngdp products list

# JSON output
ngdp products list -o json

# Pretty-printed JSON
ngdp products list -o json-pretty

# Raw BPSV format
ngdp products list -o bpsv

Inspect Commands

# Parse and display BPSV data
ngdp inspect bpsv data.bpsv

# Show raw BPSV data
ngdp inspect bpsv data.bpsv --raw

# Inspect from URL
ngdp inspect bpsv https://example.com/data.bpsv

Certificate Commands

# Download a certificate by SKI/hash
ngdp certs download 5168ff90af0207753cccd9656462a212b859723b

# Download and show certificate details
ngdp certs download 5168ff90af0207753cccd9656462a212b859723b --details

# Save certificate to file
ngdp certs download 5168ff90af0207753cccd9656462a212b859723b --output cert.pem

# Download certificate in DER format
ngdp certs download 5168ff90af0207753cccd9656462a212b859723b --output cert.der --cert-format der

# Get certificate details as JSON
ngdp certs download 5168ff90af0207753cccd9656462a212b859723b --details -o json

Configuration

# Show current configuration
ngdp config show

# Get a specific config value
ngdp config get default_region

# Set a config value
ngdp config set default_region eu

# Reset configuration to defaults
ngdp config reset --yes

Available Configuration Settings:

  • default_region - Default region for API requests (default: us)
  • cache_dir - Directory for cached data (default: ~/.cache/ngdp)
  • cache_enabled - Enable/disable caching (default: true)
  • cache_ttl - Cache time-to-live in seconds (default: 1800)
  • timeout - General request timeout in seconds (default: 30)
  • ribbit_timeout - Ribbit-specific timeout (default: 30)
  • tact_timeout - TACT-specific timeout (default: 30)
  • max_concurrent_downloads - Max parallel downloads (default: 4)
  • retry_attempts - Number of retry attempts (default: 3)
  • user_agent - HTTP User-Agent string (default: ngdp-client/0.1.2)
  • verify_certificates - SSL certificate verification (default: true)
  • proxy_url - HTTP proxy URL (default: empty)
  • log_file - Log output file (default: empty)
  • color_output - Enable colored terminal output (default: true)
  • fallback_to_tact - Auto-fallback from Ribbit to TACT (default: true)
  • use_community_cdn_fallbacks - Use community CDN mirrors (default: true)
  • custom_cdn_fallbacks - Comma-separated list of custom CDN hosts (default: empty)

Caching and Fallback

The CLI includes built-in caching for both Ribbit and TACT API responses with automatic fallback:

# Disable caching for a single command
ngdp products list --no-cache

# Clear all cached data before running command
ngdp products list --clear-cache

Fallback Behavior:

  • Primary: Ribbit protocol (TCP-based, official)
  • Fallback: TACT HTTP protocol (when Ribbit fails)
  • Both protocols return identical BPSV data
  • Caching works transparently for both protocols
  • SG region automatically falls back to US for TACT

CDN Fallback Order:

When downloading content from CDNs, the client tries hosts in this order:

  1. Primary CDNs - Blizzard's official CDN servers
  2. Community CDNs - Public mirrors (if use_community_cdn_fallbacks is true):
    • cdn.arctium.tools
    • tact.mirror.reliquaryhq.com
  3. Custom CDNs - User-configured hosts from custom_cdn_fallbacks

To configure custom CDN fallbacks:

# Set custom CDN fallbacks (comma-separated)
ngdp config set custom_cdn_fallbacks "my-cdn1.example.com,my-cdn2.example.com"

# Disable community CDN fallbacks
ngdp config set use_community_cdn_fallbacks false

Library Usage

The ngdp-client can also be used as a library:

use ngdp_client::{handle_products, OutputFormat, ProductsCommands};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cmd = ProductsCommands::List {
        filter: Some("wow".to_string()),
        region: "us".to_string(),
    };

    handle_products(cmd, OutputFormat::Json).await?;
    Ok(())
}

Examples

See the examples/ directory for more usage examples.

Development

Running Tests

cargo test

Running Benchmarks

cargo bench

📄 License

This project is dual-licensed under either:

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

🫶 Acknowledgments

This crate is part of the cascette-rs project, providing tools for World of Warcraft emulation development.

Commit count: 0

cargo fmt