Skip to main content

eXtractor Tool

xt is a one-shot command-line extractor built on the same xtractr engine as Unpackerr. Give it files or folders; it recursively decompresses archives it finds.

It is not a daemon and it does not poll Starr apps. Use Unpackerr when you want ongoing queue or folder watching. Use xt when you want to extract a path now.

GitHub: Unpackerr/xt

Install

Linux

Alpine and Arch packages are on the releases page. On Debian/Ubuntu and RedHat/Fedora, install the GoLift repo and xt:

curl -s https://golift.io/repo.sh | sudo bash -s - xt

macOS

brew install golift/mugs/xt

A binary is also on the releases page.

Windows

Download an exe from the releases page and put it in your PATH. It runs in a command or terminal window only.

FreeBSD

Download a FreeBSD binary from the releases page and extract it into your PATH. /usr/local/bin is a good location.

Go

go install golift.io/xt@latest

Usage

xt [options] [path [path] [path] ...]
xt --job-file /tmp/job1 -j /tmp/job2

Paths may be files to extract or directories to search.

FlagMeaning
-o, --outputDirectory to write extracted files. Default: current directory.
-S, --squash-rootIf the archive root is a single folder, move its contents up.
-d, --max-depthHow deep to recurse. 0 is unlimited; 1 disables recursion.
-m, --min-depthOnly extract archives this many subdirectories deep or deeper.
-P, --passwordPassword for encrypted RAR/7z. Repeat the flag for more passwords.
-e, --extensionOnly extract these extensions (include the leading dot). Repeatable.
-j, --job-fileExtra jobs from xml, json, toml, or yaml. TOML is the default.
-p, --preserve-pathsRecreate the input directory hierarchy under --output.
-V, --verbosePrint extracted file paths.
-D, --debugDebug output.
-v, --versionPrint version and supported extensions, then exit.
-h, --helpUsage.

-e values must match a supported extension. Unknown extensions are ignored. Run xt -v to print the live list.

Job files

CLI flags build one job. Job files define one or more jobs with their own paths, output, depths, and passwords. Formats: xml, json, toml, yaml (toml if the extension is missing).

If include_suffix is set, exclude_suffix is ignored.

Example TOML:

paths = [ '/path1', '/another/path' ]
output = '.'
passwords = [ 'password1', '''password"With'Specials!''', 'pass3']
exclude_suffix = ['.iso', '.gz']
include_suffix = ['.zip', '.rar', '.r00']
max_depth = 0
min_depth = 1
file_mode = 644
dir_mode = 755
squash_root = false
verbose = false
debug_log = false
preserve_paths = false

JSON and YAML use camelCase for some keys (excludeSuffix, debugLog, preservePaths). XML uses path / password (singular) for the lists.

Formats

Same xtractr engine as Unpackerr. Detected by file extension:

  • Zip: zip
  • RAR: rar, r00
  • 7-Zip: 7z, 7z.001
  • tar: tar, tar.gz, tgz, tar.bz2, tbz, tbz2, tar.xz, txz, tar.z, tz, tlz
  • gzip / bzip2 / xz / zstd: gz, gzip, bz2, xz, zst, zstd
  • Other compressors: lz4, lz, lzip, lzma, lzma2, z, br, brotli, s2, snappy, sz, zlib, zz
  • Packages and images: iso, cpio, cpio.gz, cpgz, ar, deb, rpm
  • Cue sheets (FLAC splits): cue, cue.txt

Multi-file and password-protected archives work with RAR and 7-Zip. ISO extraction is always available in xt; Unpackerr's extract_isos setting does not apply here. xt -v prints the extension list from the binary you have.