| Crates.io | exarch-cli |
| lib.rs | exarch-cli |
| version | 0.2.2 |
| created_at | 2026-01-01 05:28:29.058196+00 |
| updated_at | 2026-01-03 18:35:05.433658+00 |
| description | Command-line utility for secure archive extraction and creation |
| homepage | https://github.com/bug-ops/exarch |
| repository | https://github.com/bug-ops/exarch |
| max_upload_size | |
| id | 2015787 |
| size | 132,373 |
Command-line utility for secure archive extraction and creation. Built on exarch-core, providing memory-safe archive handling with built-in protection against path traversal, zip bombs, and symlink escape attacks.
../ escape attemptscargo install exarch-cli
git clone https://github.com/bug-ops/exarch
cd exarch
cargo install --path crates/exarch-cli
[!TIP] Use
cargo binstall exarch-clifor faster installation without compilation.
Download from GitHub Releases:
| Platform | Architecture | Download |
|---|---|---|
| Linux | x86_64 | exarch-x86_64-unknown-linux-gnu.tar.gz |
| Linux | aarch64 | exarch-aarch64-unknown-linux-gnu.tar.gz |
| macOS | x86_64 | exarch-x86_64-apple-darwin.tar.gz |
| macOS | aarch64 | exarch-aarch64-apple-darwin.tar.gz |
| Windows | x86_64 | exarch-x86_64-pc-windows-msvc.zip |
After downloading:
# Linux/macOS
tar -xzf exarch-*.tar.gz
chmod +x exarch
sudo mv exarch /usr/local/bin/
# Windows - extract zip and add to PATH
[!IMPORTANT] Requires Rust 1.89.0 or later for building from source.
exarch [OPTIONS] <COMMAND>
| Command | Description |
|---|---|
extract |
Extract archive contents |
create |
Create a new archive |
list |
List archive contents |
verify |
Verify archive integrity |
| Option | Short | Description |
|---|---|---|
--verbose |
-v |
Enable verbose output |
--quiet |
-q |
Suppress non-error output |
--json |
-j |
Output results in JSON format |
--help |
-h |
Print help |
--version |
-V |
Print version |
exarch extract [OPTIONS] <ARCHIVE> [OUTPUT_DIR]
# Extract archive to current directory
exarch extract archive.tar.gz
# Extract to specific directory
exarch extract archive.zip /tmp/output
# Extract with JSON output for scripting
exarch extract --json archive.tar.xz | jq '.data.files_extracted'
# Extract with verbose output
exarch extract --verbose archive.tar.gz
# Increase security limits for large archives
exarch extract --max-files 50000 --max-total-size 50G large-archive.tar.gz
# Allow symlinks for trusted archives
exarch extract --allow-symlinks trusted-source.tar
| Option | Default | Description |
|---|---|---|
--max-files |
10000 | Maximum number of files to extract |
--max-total-size |
- | Maximum total extracted size (supports K/M/G/T suffixes) |
--max-file-size |
- | Maximum single file size |
--max-compression-ratio |
100 | Maximum compression ratio (zip bomb protection) |
--allow-symlinks |
false | Allow symlinks (within extraction directory) |
--allow-hardlinks |
false | Allow hardlinks (within extraction directory) |
--preserve-permissions |
false | Preserve file permissions from archive |
--force |
false | Overwrite existing files |
[!CAUTION] Only use
--allow-symlinksand--allow-hardlinkswith archives from trusted sources. These options can be exploited by malicious archives.
Create archives from files and directories:
exarch create [OPTIONS] <OUTPUT> <SOURCES>...
# Create tar.gz from directory
exarch create backup.tar.gz ./src
# Create from multiple sources
exarch create project.tar.gz src/ Cargo.toml README.md
# Create ZIP with maximum compression
exarch create -l 9 archive.zip ./data
# Exclude patterns
exarch create backup.tar.gz ./project --exclude "*.log" --exclude "target/"
# Include hidden files
exarch create backup.tar.gz ./project --include-hidden
# Overwrite existing archive
exarch create -f backup.tar.gz ./src
| Option | Short | Description |
|---|---|---|
--compression-level |
-l |
Compression level (1-9, default: 6) |
--follow-symlinks |
Follow symbolic links | |
--include-hidden |
Include hidden files | |
--exclude |
-x |
Exclude pattern (repeatable) |
--strip-prefix |
Strip path prefix | |
--force |
-f |
Overwrite existing file |
--quiet |
-q |
Suppress output |
--json |
Output JSON format |
[!TIP] Archive format is detected from the output file extension. Supported formats:
.tar,.tar.gz,.tar.bz2,.tar.xz,.tar.zst,.zip
Extraction complete
Files extracted: 1,523
Directories: 87
Total size: 42.3 MB
--json){
"operation": "extract",
"status": "success",
"data": {
"files_extracted": 1523,
"directories_created": 87,
"symlinks_created": 0,
"bytes_written": 44396032
}
}
[!TIP] Use JSON output with
jqfor scripting:exarch extract --json archive.tar.gz | jq '.data.files_extracted'
exarch is designed with security as a primary concern, protecting against common archive vulnerabilities:
| Vulnerability | Protection |
|---|---|
| Path traversal (CVE-2025-4517) | Blocks ../ and absolute paths by default |
| Symlink escape (CVE-2024-12905) | Validates symlink targets stay within extraction dir |
| Hardlink attacks (CVE-2025-48387) | Validates hardlink targets |
| Zip bombs (42.zip) | Configurable compression ratio limit (default: 100:1) |
| Resource exhaustion | File count and size quotas |
| Permission escalation | Permission sanitization by default |
[!NOTE] All security checks are enabled by default. Use
--allow-*flags only for trusted archives.
| Format | Extension | Extraction | Creation |
|---|---|---|---|
| TAR | .tar |
✅ | ✅ |
| TAR + gzip | .tar.gz, .tgz |
✅ | ✅ |
| TAR + bzip2 | .tar.bz2, .tbz2 |
✅ | ✅ |
| TAR + xz | .tar.xz, .txz |
✅ | ✅ |
| TAR + zstd | .tar.zst, .tzst |
✅ | ✅ |
| ZIP | .zip |
✅ | ✅ |
| 7z | .7z |
✅ | — |
[!NOTE] 7z creation is not yet supported. Solid and encrypted 7z archives are rejected for security reasons.
# Build
cargo build -p exarch-cli
# Run tests
cargo nextest run -p exarch-cli
# Run CLI directly
cargo run -p exarch-cli -- extract tests/fixtures/sample.tar.gz
# Check formatting and lints
cargo +nightly fmt --all -- --check
cargo clippy -p exarch-cli -- -D warnings
Licensed under MIT OR Apache-2.0 - see LICENSE-MIT or LICENSE-APACHE.