-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Usage and Training
The moezip command-line executable provides tools for compressing text, decompressing archives, decoding hex strings directly in the terminal, and training custom router matrices on domain-specific text corpora.
moezip COMMAND [options]
| Command | Alias | Description |
|---|---|---|
compress |
c |
Compresses a text file or input string into a .moe binary archive. |
decompress |
d |
Decompresses a .moe archive back into plain text. |
hexdec |
hd |
Decompresses a hex-encoded string directly from the command line. |
train |
t |
Trains the 32x32 state router transition matrix on a text dataset. |
| Flag | Description | Default |
|---|---|---|
-o, --output FILE |
Specifies output file path (- outputs to stdout). |
Auto-generated |
--vocab FILE |
Path to a custom vocabulary wordlist on disk. |
words_final.txt (or embedded) |
--router FILE |
Path to a custom router state JSON file on disk. |
router_stateless_v4.json (or embedded) |
--corpus FILE |
Input text corpus file (required for train command). |
None |
-q, --quiet |
Mutes informational logs and progress metrics. | False |
Compresses a text file to a .moe archive:
# Basic compression
moezip compress input.txt -o archive.moe
# Mute diagnostic output
moezip compress input.txt -o archive.moe --quietRestores a .moe binary archive to its original plain text:
# Basic decompression
moezip decompress archive.moe -o restored.txt
# Decompress to stdout stream
moezip decompress archive.moe -o -Decompresses a hex-encoded string payload without saving an intermediate .moe file:
moezip hexdec 880A090A20202020414243... -o restored.txtmoezip supports I/O redirection using - as the input or output filename. Diagnostic logs are routed to stderr to keep stdout clean for binary data transfers.
On Windows platforms, standard input and output streams are automatically initialized in binary mode (_O_BINARY) to prevent newline translation (0x0A to 0x0D 0x0A) from corrupting binary compressed streams.
# Compress string from standard input and pipe to file
echo "Sample text to compress." | moezip compress - -o archive.moe
# Pipe decompressed output directly to another command
moezip decompress archive.moe -o - | grep "SearchTerm"moezip uses a
If you are compressing specialized domains (such as medical records, legal documents, or source code), you can train a custom router matrix to improve compression ratios.
Feed a raw text corpus (.txt) to the train command:
moezip train --corpus path/to/domain_corpus.txt --router router_stateless_v4.jsonThis processes the corpus tokens and saves the updated state transitions to router_stateless_v4.json.
Run make.py to convert the updated router_stateless_v4.json into C++ array chunks in embedded_assets.hpp:
python make.pyRebuild the executable to generate a self-contained binary containing your domain-specific weights:
# Windows
cmake --build build --config Release
# Linux
cmake --build build_linux --parallelmoezip • C++20 Learning-Augmented Text Compression Engine
Released under the MIT License • Embedded MoE Router + rANS Arithmetic Coding
Main Repository • Report an Issue • Releases • Back to Top #home
- Home
- Architecture & Design
- Building & Compilation
- CLI Usage & Training
- API Reference
- Performance & Benchmarks
-
Windows (MSVC):
-
moezip.exe(CLI) -
moezip.dll(Shared Lib) -
moezip.pyd(Python)
-
-
Linux (GCC):
-
moezip(CLI) -
libmoezip.so(Shared Lib) -
moezip.so(Python)
-