warcraft-rs

Crates.iowarcraft-rs
lib.rswarcraft-rs
version0.3.2
created_at2025-06-29 06:58:28.810778+00
updated_at2025-08-29 04:03:00.031946+00
descriptionUnified CLI for World of Warcraft file format parsing, conversion, and validation
homepagehttps://github.com/wowemulation-dev/warcraft-rs
repositoryhttps://github.com/wowemulation-dev/warcraft-rs
max_upload_size
id1730465
size380,416
Daniel S. Reichenbach (danielsreichenbach)

documentation

README

warcraft-rs CLI

Unified command-line tool for working with World of Warcraft file formats.

Crates.io Version docs.rs

Installation

From crates.io

# Install with all features
cargo install warcraft-rs --features full

# Or install with specific features only
cargo install warcraft-rs --features "mpq dbc"

From Source

# Clone the repository
git clone https://github.com/wowemulation-dev/warcraft-rs
cd warcraft-rs/warcraft-rs

# Build with all features
cargo build --release --features full

# Or build with specific features only
cargo build --release --features "mpq dbc"

# The binary will be at target/release/warcraft-rs

Using Cargo Install (Local)

# Install with all formats
cargo install --path . --features full

# Or with specific formats only
cargo install --path . --features "mpq blp"

Usage

The warcraft-rs CLI provides subcommands for each supported file format:

warcraft-rs <format> <command> [options]

Available Formats

  • mpq - MPQ archive operations (implemented)
  • dbc - DBC database operations (implemented)
  • blp - BLP texture operations (planned)
  • m2 - M2 model operations (planned)
  • wmo - WMO object operations (implemented)
  • adt - ADT terrain operations (implemented)
  • wdt - WDT map operations (implemented)
  • wdl - WDL world operations (implemented)

MPQ Commands

# List files in an archive
warcraft-rs mpq list archive.mpq
warcraft-rs mpq list archive.mpq --long
warcraft-rs mpq list archive.mpq --filter "*.dbc"

# Extract files
warcraft-rs mpq extract archive.mpq
warcraft-rs mpq extract archive.mpq --output ./extracted
warcraft-rs mpq extract archive.mpq file1.txt file2.dat

# Create a new archive
warcraft-rs mpq create new.mpq --add file1.txt --add file2.dat
warcraft-rs mpq create new.mpq --add *.txt --version v2 --compression zlib

# Show archive information
warcraft-rs mpq info archive.mpq
warcraft-rs mpq info archive.mpq --show-hash-table

# Validate archive integrity
warcraft-rs mpq validate archive.mpq

Global Options

  • -v, --verbose - Increase verbosity (can be repeated)
  • -q, --quiet - Suppress all output except errors
  • --help - Show help for any command

Shell Completions

Generate shell completions for your shell:

# Bash
warcraft-rs completions bash > ~/.local/share/bash-completion/completions/warcraft-rs

# Zsh
warcraft-rs completions zsh > ~/.zfunc/_warcraft-rs

# Fish
warcraft-rs completions fish > ~/.config/fish/completions/warcraft-rs.fish

# PowerShell
warcraft-rs completions powershell > _warcraft-rs.ps1

Features

The CLI can be built with different feature flags to include only the formats you need:

  • default - Includes MPQ support only
  • full - Includes all format support
  • mpq - MPQ archive support
  • dbc - DBC database support
  • blp - BLP texture support
  • m2 - M2 model support
  • wmo - WMO object support
  • adt - ADT terrain support
  • wdt - WDT map support
  • wdl - WDL world support

Examples

Working with MPQ Archives

# Extract all DBC files from an MPQ
warcraft-rs mpq list patch.mpq --filter "*.dbc" | \
  xargs warcraft-rs mpq extract patch.mpq --output ./dbc_files

# Create a new MPQ with compressed files
warcraft-rs mpq create my_mod.mpq \
  --add data/*.txt \
  --add scripts/*.lua \
  --compression zlib \
  --with-listfile

# Validate multiple archives
for mpq in *.mpq; do
  echo "Checking $mpq..."
  warcraft-rs mpq validate "$mpq"
done

Future Format Support

Once implemented, other formats will follow similar patterns:

# Convert BLP textures to PNG
warcraft-rs blp convert texture.blp --to png

# Export DBC to JSON
warcraft-rs dbc export Items.dbc --format json --output items.json

# Get model information
warcraft-rs m2 info character.m2

Development

See the main warcraft-rs repository for development information.

Commit count: 125

cargo fmt