← 返回 Skills 市场
qiliangzhao20241028

archive-extractor

作者 leon388 · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
387
总下载
1
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (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"
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install archive-extractor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /archive-extractor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug archive-extractor
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 387 次。

如何安装 archive-extractor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install archive-extractor」即可一键安装,无需额外配置。

archive-extractor 是免费的吗?

是的,archive-extractor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

archive-extractor 支持哪些平台?

archive-extractor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 archive-extractor?

由 leon388(@qiliangzhao20241028)开发并维护,当前版本 v1.1.0。

💬 留言讨论