MKZ(1)

NAME
mkz - reversible columnar pre-pass + zstd archiver

SYNOPSIS
mkz -c [-zlevel] [-v] -f archive file ...
mkz -x [-v] -f archive [destdir]
mkz [-hV]

DESCRIPTION
mkz is a tar-style archiver whose backend is a reversible, schema-free auto-columnar transform followed by zstd(1). It is not a new compressor but a structural pre-pass that makes a general compressor smaller on structured, line-oriented data (logs, CSV, JSONL, telemetry) and never worse anywhere else.

For each block of input, mkz discovers record structure with no schema, gathers the varying fields into per-column streams, delta-codes numeric columns, and dedups repeated values through a shared dictionary, producing a packed blob. It then compresses both the raw block and the transformed blob with zstd(1) and keeps whichever is smaller (the never-worse gate), so the transform can only help or no-op. Every archive carries a SHA-256 of the reconstructed original; extraction verifies this SHA-256 over the whole stream and reports corruption on a mismatch. Extraction is not yet atomic, so a corrupt trailer can leave already-written files in place; a future release will extract via a temporary path and rename.

Both creation and extraction stream line-oriented input in bounded memory for typical text and logs: peak memory is roughly one block. Only one input file is open at a time. Pathological newline-free input is the exception: a block is read up to the next newline, so a file with no newlines is buffered whole and is not yet bounded.

This is the pure-C build; it is byte-compatible with the reference implementation in both directions.

OPTIONS

-c  Create an archive from the given files and directories.

-x  Extract an archive. The optional destdir defaults to the current directory.

-zlevel
    Set the zstd(1) compression level (1 to 22, default 12). The level attaches to the flag with no space and may be clustered with -c, e.g. -cz19f.

-f archive
    The archive file to create or read (required).

-v  Verbose: list each entry as it is processed.

-h  Print a usage summary and exit.

-V  Print the version and exit.

ENVIRONMENT

PSRC_AC_ZSTD_LEVEL
    Default zstd(1) level when z is not given (default 12).

PSRC_AC_BLOCK_MB
    Block size in mebibytes for create (default 16).

EXIT STATUS
On extract, mkz fails (nonzero) if the archive is malformed, truncated, or fails its SHA-256 integrity check.

EXAMPLES
Create a compressed archive of /var/log:

    $ mkz -czf logs.mkz /var/log

Create at zstd(1) level 19, verbosely:

    $ mkz -cz19vf data.mkz data/

Extract into out/:

    $ mkz -xvf logs.mkz out/

SEE ALSO
tar(1), zstd(1)

STANDARDS
The archive format is the PAS1 container: a magic, a sequence of framed zstd(1) blocks (each flagged raw or auto-columnar), and a trailing SHA-256 of the reconstructed original.

AUTHORS
Matthew Klein.

CAVEATS
Symbolic links and special files are skipped. Stored paths are normalized to be relocatable; extraction rejects absolute paths and ‘..’ traversal.