4 releases
Uses new Rust 2024
| 0.3.2 | Aug 29, 2025 |
|---|---|
| 0.3.1 | Aug 11, 2025 |
| 0.3.0 | Aug 7, 2025 |
| 0.2.0 | Jun 29, 2025 |
#464 in Game dev
248 downloads per month
1.5MB
27K
SLoC
warcraft-rs CLI
Unified command-line tool for working with World of Warcraft file formats.
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 onlyfull- Includes all format supportmpq- MPQ archive supportdbc- DBC database supportblp- BLP texture supportm2- M2 model supportwmo- WMO object supportadt- ADT terrain supportwdt- WDT map supportwdl- 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.
Dependencies
~36–54MB
~899K SLoC