Skip to content
Latchkey

unzstd: Decompress .zst Cache Files in CI

unzstd decompresses .zst files and is equivalent to zstd -d, restoring the original by stripping the .zst suffix.

unzstd is the restore side of a zstd build cache. It keeps the source by default and streams cleanly into tar.

What it does

unzstd reads a .zst file and decompresses the Zstandard stream, writing the original name without the suffix and keeping the compressed file by default. It is the same binary as zstd in decompress mode.

Common usage

Terminal
unzstd deps.tar.zst            # -> deps.tar
unzstd -c cache.zst | tar -x  # stream into tar
unzstd --long=31 big.tar.zst  # allow a large window
unzstd -o out.bin data.zst    # explicit output path

Options

FlagWhat it does
-c / --stdoutWrite to stdout
-k / --keepKeep the .zst file (default for zstd)
--long[=<n>]Set the window log to decode --long files
-o <file>Explicit output path
-f / --forceOverwrite existing output
-t / --testTest integrity only

Common errors in CI

"zstd: /*stdin*\\: unsupported format" means the input is not zstd. "Frame requires too much memory for decoding" means the file used a large --long window; re-run with --long=31. "command not found" means the zstd package is not installed. A truncated cache download shows "Read error" or "Src size incorrect".

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →