← Back to Skills Marketplace
qiliangzhao20241028

archive-extractor

by leon388 · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
387
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install archive-extractor
Description
Recursively extract archive files from a file or directory. Supports zip, tar, tar.gz, tar.bz2, tar.xz, tgz, rar, 7z, gz, bz2, xz. Works on Windows, Linux, m...
README (SKILL.md)

Archive Extractor

Extracts archives recursively using scripts/extract.py.

Zero local-software dependency — works on any machine with Python 3.8+.
.rar and .7z formats use pure-Python libraries (rarfile, py7zr) that are auto-installed on first use via pip. No 7-Zip, WinRAR, or unrar binary needed.

How to run

python scripts/extract.py \x3CPATH> [OPTIONS]

Always use the absolute path to the script when calling from a different working directory:

# Windows
python "C:\Users\\x3Cuser>\.workbuddy\skills\archive-extractor\scripts\extract.py" "\x3CPATH>"

# Linux / macOS
python ~/.workbuddy/skills/archive-extractor/scripts/extract.py "\x3CPATH>"

Options

Flag Description
-f / --force Re-extract even if a .extracted_success marker already exists
-d DIR / --dest DIR Write all output under a custom root directory

Supported formats

Format Backend
.zip Python stdlib zipfile
.tar .tar.gz .tar.bz2 .tar.xz .tgz .tbz2 Python stdlib tarfile
.gz .bz2 .xz (single-file) Python stdlib gzip / bz2 / lzma
.rar rarfile (pure-Python, auto-installed)
.7z py7zr (pure-Python, auto-installed)

Key behaviours

  • Idempotent: skips archives that already have a .extracted_success marker; use -f to override.
  • Recursive: after extracting an archive, immediately scans the output for nested archives (up to 20 levels deep).
  • Auto-deps: rarfile and py7zr are installed automatically via pip on first use — no manual setup needed.
  • Fault-tolerant: corrupted or unsupported archives are logged as [FAIL] and skipped; remaining archives continue.

Examples

# Extract everything in a directory (including sub-archives)
python extract.py "D:\jira\TICKET-123"

# Force clean re-extraction of a single file
python extract.py report.zip -f

# Extract to a separate output folder
python extract.py "D:\jira\TICKET-123" -d "D:\extracted"

# Glob pattern — extract all zips in current directory
python extract.py "*.zip"
Usage Guidance
This skill appears to do what it claims, but review the tradeoffs before installing/using: (1) The script will call pip to install rarfile/py7zr on first use — this requires network access and will modify the Python environment; consider running the skill in a virtualenv or container. (2) Extraction writes files to disk and can delete extracted directories when run with --force or on error; avoid running it with root privileges or on system-critical directories. (3) The code lacks explicit path-sanitization for archive entries (zip-slip risk); do not run it on untrusted archives unless you accept that risk or run in an isolated environment. If you want extra assurance, inspect the full script locally and test it on sample archives in a disposable environment before running on important data.
Capability Analysis
Type: OpenClaw Skill Name: archive-extractor Version: 1.1.0 The skill provides recursive archive extraction but includes high-risk behaviors such as automatically installing Python packages ('rarfile', 'py7zr') via 'pip' using 'subprocess.check_call' in 'scripts/extract.py'. While these capabilities are plausibly needed for the stated purpose of 'zero local-software dependency', they represent a significant attack surface. Additionally, while the script implements 'tarfile.data_filter' for security on newer Python versions, it uses standard 'extractall()' for ZIP and other formats, which remains vulnerable to path traversal (Zip Slip) attacks if processing untrusted archives.
Capability Assessment
Purpose & Capability
Name/description match the delivered code: the included script implements recursive extraction for the listed formats, including auto-installing 'rarfile' and 'py7zr' when needed. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
Instructions tell the agent to run the included Python script on a path/glob and to allow pip installs for optional backends. The script performs filesystem operations (create dirs, extract files, remove extracted dirs on force/failure) which are expected for this purpose. One security note: extraction uses zipfile.extractall and tarfile.extractall (with a best-effort data_filter for Python 3.12+), but there is no explicit path-sanitization to protect against zip-slip/path traversal in archives—so extracting untrusted archives could write files outside the intended output. Recommend running on trusted data or in an isolated environment.
Install Mechanism
No platform install spec is provided; the script auto-installs Python packages via subprocess pip install at runtime when .rar or .7z handling is needed. This is coherent with the stated zero-local-binary goal but does involve network access and will modify the interpreter's site-packages (or the environment running the agent).
Credentials
The skill declares no required environment variables or credentials and the code does not access environment secrets or unrelated config paths.
Persistence & Privilege
Skill is not always-enabled and does not request elevated platform privileges or modify other skills/configs. It runs on demand and has no persistent background components.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install archive-extractor
  3. After installation, invoke the skill by name or use /archive-extractor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
- Renamed skill from "smart-archive-extractor" to "archive-extractor". - Updated description and documentation for clarity and conciseness. - Added more detailed platform compatibility and dependency notes. - Clarified exact supported archive formats and their backends. - Stressed zero external software dependency—works with just Python 3.8+. - Added new metadata files for skill indexing.
v1.0.1
- Version bump from 1.0.0 to 1.0.1. - No user-visible changes; content and features remain the same.
v1.0.0
Initial release of smart-archive-extractor. - Recursively extracts various archive formats (zip, tar, tar.gz, rar, 7z, gz), including support for nested archives up to 20 levels deep. - Avoids redundant extractions using success marker files; supports forcing re-extraction. - Automatically installs required dependencies (patool) if missing. - Handles single-file gzip extraction and flexible output directory options. - Robust error handling: skips corrupt archives and prevents infinite recursion.
Metadata
Slug archive-extractor
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is archive-extractor?

Recursively extract archive files from a file or directory. Supports zip, tar, tar.gz, tar.bz2, tar.xz, tgz, rar, 7z, gz, bz2, xz. Works on Windows, Linux, m... It is an AI Agent Skill for Claude Code / OpenClaw, with 387 downloads so far.

How do I install archive-extractor?

Run "/install archive-extractor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is archive-extractor free?

Yes, archive-extractor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does archive-extractor support?

archive-extractor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created archive-extractor?

It is built and maintained by leon388 (@qiliangzhao20241028); the current version is v1.1.0.

💬 Comments