Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - arichyx/autoarc: A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets. · GitHub
Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - arichyx/autoarc: A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets. · GitHub
Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - arichyx/autoarc: A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets. · GitHub
Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - arichyx/autoarc: A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets. · GitHub
Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - arichyx/autoarc: A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets. · GitHub
Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - arichyx/autoarc: A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets. · GitHub
Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - arichyx/autoarc: A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets. · GitHub
Skip to content

Repository files navigation

autoarc

A concurrent, multi-format archive extractor for batch unpacking encrypted archives with a list of candidate passwords.

autoarc walks a target directory, recursively unpacks every supported archive it finds, automatically tries each password from -p / --password (or AUTOARC_PASSWORDS as a fallback), and shows live progress for each task with a final summary.

Platform support

⚠️Only tested on macOS. The author develops on macOS and does not own a Windows machine, so Windows is not tested and not guaranteed to work. Linux should work since all dependencies are cross-platform, but has not been exercised regularly. Bug reports / PRs from Linux and Windows users are very welcome.

Prerequisites

ToolRequired?PurposeInstall
Rust toolchain (cargo, edition 2024, rustc ≥ 1.85)yesBuild & install autoarchttps://rustup.rs
unar + lsaryes for split archives (.z01, .001), SFX .exe archives, and the autoarc lsar subcommandSubprocess fallback backendmacOS: brew install unar
Debian/Ubuntu: sudo apt install unar
Arch: sudo pacman -S unarchiver
fileoptionalFallback MIME sniffer for MPEG-TS detection and plain-text classification (infer doesn't cover those)preinstalled on macOS / most Linux distros

The ZIP, RAR, and 7z backends are pure-Rust crates — they have no external runtime dependency, so if you only deal with single-volume archives in those formats you can skip installing unar entirely.

Installation

From crates.io (once published):

cargo install autoarc

From source:

git clone https://github.com/arichyx/autoarc.git
cd autoarc
cargo install --path .

cargo install only pulls the Rust binary. You still need unar / lsar on your PATH for multi-volume and SFX archives — see Prerequisites above.

Configuration

autoarc tries candidate passwords for encrypted archives in this order:

  1. The -p / --password CLI flag (repeatable, comma-separated).
  2. The AUTOARC_PASSWORDS environment variable (comma-separated) when the flag is not given.
  3. The empty password only — which is also always tried first, regardless of source, so unencrypted archives extract cleanly without any setup.

Password values are preserved exactly, including leading and trailing whitespace; only empty comma-separated fields are ignored.

For long-lived secrets, the most convenient source is a .env file at the project root; see .env.example:

cp .env.example .env
# then edit .env and add your candidate passwords

For one-off runs, pass them on the command line:

autoarc <DIR> -p hunter2 -p "correct horse" -p s3cret
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'

Security note: passwords on the command line may be visible to other processes via ps(1) and end up in your shell history. Prefer AUTOARC_PASSWORDS via .env for long-lived secrets.

VariableRequiredDescription
AUTOARC_PASSWORDSnoFallback password list when -p / --password is not given. Unset = try no-password only.
RUST_LOGnoTracing filter (info, debug, ...). Defaults to warn.

Parallelism (-j / --jobs) is intentionally a CLI-only knob — it's a per-invocation setting, not a persistent secret, so it does not read from .env or any environment variable.

Usage

CLI

# Extract every supported archive in <DIR> (top level only)
autoarc <DIR># Recurse into subdirectories up to N levels
autoarc <DIR> --depth 3
# Recurse without limit
autoarc <DIR> --recursive
autoarc <DIR> -r
# Skip paths matching a glob during the initial scan (repeatable)
autoarc <DIR> --ignore scratch # skip top-level scratch/ subtree
autoarc <DIR> -i '**/node_modules'# skip node_modules/ at any depth
autoarc <DIR> -i '*.tmp' -i '*.bak'# skip top-level temp/backup files# Preview the plan without touching anything (dry-run)
autoarc <DIR> --dry-run
autoarc <DIR> -n
# Skip the interactive [Y/n] confirmation prompt
autoarc <DIR> --yes
autoarc <DIR> -y
# Cap parallelism (useful when extraction pins too many cores)
autoarc <DIR> --jobs 4
autoarc <DIR> -j 1 # strictly sequential# Pass candidate passwords on the command line (repeatable + comma-separated)
autoarc <DIR> -p hunter2 -p "correct horse"
autoarc <DIR> -p 'hunter2,"correct horse",s3cret'# Inspect a single file's detected type
autoarc type ./mystery.bin
# List the entries of an archive (uses `lsar`)
autoarc lsar ./bundle.zip

Recursion modes

FlagMeaning
(none)--depth 1 — only the immediate contents of <DIR>
--depth N / -d NWalk up to N directory levels (N ≥ 1)
--depth 0Unlimited recursion (alias for --recursive)
--recursive / -rUnlimited recursion

Ignoring paths

--ignore / -i takes a glob pattern and skips any matching path during the initial scan. Repeatable; a path is ignored if it matches any pattern. Patterns are matched against the path relative to <DIR> and are fully anchored (the whole relative path must match), with shell-style globbing where * stays within one path component:

  • * matches within a single path segment (never crosses /)
  • ** crosses any number of directory separators
  • {a,b} alternation and [abc] character classes are supported
PatternEffect
scratchSkip the top-level scratch/ folder and its entire subtree
**/node_modulesSkip any node_modules/ directory, at any depth
*.tmpSkip *.tmp files at the top level only
**/*.tmpSkip *.tmp files at any depth
**/*.{tmp,bak}Skip *.tmp or *.bak at any depth (one pattern)

Matching a directory prunes its whole subtree. Only the initial scan is affected — archives produced by extraction are still queued recursively, regardless of --ignore (same scoping rule as --depth). Patterns use / as the separator; comma-separated lists are not split (each --ignore is exactly one pattern, so {a,b} alternation works). At the default --depth 1 the scanner never enters subdirectories, so directory patterns have no effect there — raise --depth (or pass -r) for directory ignoring to apply.

Plan preview & confirmation

Before extracting, autoarc prints an extraction plan:

Plan: 5 archives (2 multi-volume), 12.4 GiB total — /tmp/in (depth=3)
[zip ] movie.zip (1.2 GiB)
[multi] big.z01 (8.1 GiB, 2 parts)
[rar ] sub/photos.rar (340.0 MiB)
[7z ] sub/data.7z (980.0 MiB)
[multi] sub/seven.7z.001 (2.4 GiB, 3 parts)
Note: 4 video file(s) will be renamed in place.
Continue? [Y/n]
  • Multi-volume archives (foo.z01 + foo.zip + foo.z02…, or foo.7z.001 + foo.7z.002…) are fused into a single plan row with a N parts annotation, so each logical archive shows up exactly once.
  • --dry-run (-n) prints the plan and exits without modifying anything.
  • --yes (-y) skips the prompt; useful for automation.
  • The prompt is automatically skipped when stdin is not a TTY (e.g. when the output is piped or run in CI), so existing scripts keep working.

When depth == 1 (the default), only the immediate contents of <DIR> are scanned. When depth > 1 (or --recursive), autoarc descends into subdirectories while pruning its own _out/ output folders from the walk to avoid re-processing previous runs. In either mode, archives are extracted in place — each archive gets a sibling directory whose name is the full filename plus the _out suffix (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/), and the original archive is never moved.

just recipes

A justfile provides shortcuts; extra args are forwarded to the binary:

just run # uses default ./archives
just run /path/to/archives # custom dir, depth=1
just run /path/to/archives -r # custom dir, unlimited recursion
just run /path/to/archives -d 3 # custom dir, depth=3
just run /path/to/archives -n # dry-run preview
just run /path/to/archives -y # skip confirmation
just debug /path/to/archives -r # same with RUST_LOG=debug
just type ./mystery.bin
# Development helpers
just fmt # apply rustfmt to every source file
just fmt-check # verify the tree is rustfmt-clean (CI-friendly)
just lint # strict clippy: every warning is an error
just check # one-shot: fmt-check + lint + release build

Features

  • Concurrent extraction powered by [tokio]
  • Native handling of zip, rar, and 7z
  • Subprocess fallback to unar / lsar for split archives (.z01, .001) and SFX .exe payloads
  • Recursive: nested archives produced by extraction are queued automatically
  • Multi-password trial-and-error per archive (stops on first match)
  • Live indicatif progress bars + a coloured run summary
  • Archives are extracted in place next to the originals — each archive gets a sibling _out/ directory by appending the suffix to the complete filename (so foo.zipfoo.zip_out/, foo.7zfoo.7z_out/). Names that differ only by dots versus underscores remain distinct, and originals are never moved.
  • Detected videos (.mp4, .mov, .ts) inside archives get their extension corrected in-place; audio / PDF / Office / text files are counted and reported but never modified

Supported formats

ExtensionBackend
.zipzip crate
.rarunrar crate
.7zsevenz_rust2
.z01, .001unar subprocess
.exe (SFX)unar subprocess

Behaviour

Given autoarc /tmp/in (default --depth 1):

/tmp/in/
├── foo.zip # original, untouched
├── foo.zip_out/... # extracted contents, sibling of the archive
├── bar.rar
└── bar.rar_out/...

If foo.zip and foo.7z both live in the same directory, they get foo.zip_out/ and foo.7z_out/ respectively — no collision.

With --depth N > 1 or --recursive, subdirectories are walked too; the layout inside each directory is the same:

/tmp/in/
├── sub/foo.zip
├── sub/foo.zip_out/...
└── sub/nested/bar.rar
└── bar.rar_out/...
  • Archives are always extracted in place — autoarc never moves or backs up your originals. If you want a safety copy, make it yourself before running.
  • Existing destination files or output directories are never replaced. A collision fails that archive task and leaves the existing data untouched.
  • The depth limit only applies to the initial scan. Archives produced by extraction itself are always queued recursively, regardless of --depth.
  • Multi-volume archives are handled as a single logical unit and extracted in place so their .z02, .z03, ... siblings remain reachable.
  • Videos found during the scan are renamed in-place to enforce the canonical extension.
  • During recursive scans, directories named *_out are skipped to avoid re-processing previous runs' artefacts, and any path matching a --ignore glob is pruned in the same pass (a matched directory takes its whole subtree with it).
  • If any archive task fails, the diagnostic and summary are printed even when stderr is redirected, and the process exits with a non-zero status.

Logging

The default log level is warn; set RUST_LOG=info (or debug) to see more. Log lines are routed above the live progress bars so the UI never tears.

License

Dual-licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

About

A concurrent Rust CLI that extracts ZIP / RAR / 7z archives in place — including multi-volume splits, SFX .exe payloads, and password-protected sets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages