XZ Utils
$ xz Official Med Riskxz (XZ Utils) delivers high-ratio LZMA2 compression and multi-threaded execution (-T0). It offers read-only integrity testing (-t) and machine-parsable --robot -l listings, but like gzip/pigz, bare xz file deletes the source file unless -k (--keep) or -c (--stdout) is passed.
brew install xz Native local xz compression and --robot -l inspection require no MCP server.
Agent-Readiness Checklist
Local Probe EvidenceFCRS-1.0 6-Dimension Breakdown
Non-interactive CLI with dedicated --robot -l tab-delimited machine output and -t testing, though no --json flag.
--robot -lemits stable tab-delimited fields for scripts- No
--jsonoutput mode
Read-only -l and -t modes are safe, but default compression/decompression deletes the input file unless -k or -c is supplied.
- Deletes input file by default unless
-k(--keep) or-cis used
Pre-installed or trivially packaged (brew install xz) across macOS, Linux, and Windows.
- Universal availability across desktop and server OSes
Industry-standard high-ratio LZMA2 compression with -T0 multi-core scaling.
- High compression ratio and
-T0thread auto-detection
Official Tukaani Project upstream maintenance (tukaani-project/xz).
- Official upstream repository and releases
Comprehensive xz(1) man page and -H (--long-help) documenting --robot, -k, and -T.
- Detailed
--long-helpand man page
Security, Auth & Guardrails
None required; operates purely on local files or stdin/stdout.
100% free, offline, and open-source (0BSD / GPL-2.0-or-later).
# xz Agent Rules - ALWAYS pass `-k` (`--keep`) or `-c` (`--stdout`)—bare `xz <file>` DELETES the original file on success. - Use `xz --robot -l` for deterministic script-friendly size and integrity metadata.
Agent-Ready Command Recipes
Safe Read-Only Queries
xz --robot -l archive.tar.xz
Outputs tab-delimited fields (--robot) for streams, compressed/uncompressed bytes, and check type read-only.
xz -t archive.tar.xz
Tests compressed stream checksums read-only and exits 0 only if valid.
Controlled Writes & Previews
xz -T0 -k bundle.tar
Uses all CPU cores (-T0) to create bundle.tar.xz while preserving bundle.tar via -k (--keep).
Strengths for Agents
- +
xz --robot -lprovides stable, locale-independent tab-delimited metadata for scripts. - + Multi-threaded
-T0LZMA2 compression pre-installed or packaged everywhere.
Caveats & Pitfalls
- ! Deletes original input file by default unless
-k(--keep) or-cis passed. - ! High presets (
-7..-9) consume significant RAM during compression and decompression.