微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

archive-extractor

archive-extractor · v1.0.1
安全 unknown 级 作者 qiliangzhao20241028 公开目录收录
1k 下载 1 安装 3.3k 收藏 1 浏览

简介

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...

通过你的 Agent 添加

安装目录:smart-archive-extractor/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/archive-extractor/
Codex CLI~/.codex/skills/archive-extractor/
DeepSeek Harness~/.agents/skills/archive-extractor/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: smart-archive-extractor description: | A robust tool for recursively extracting various archive formats (zip, tar, tar.gz, rar, 7z, gz). Use this skill when the user wants to "unzip", "unpack", or "extract" files, especially when dealing with nested archives, bulk extraction, or when operation stability (idempotency) is required. It automatically handles dependency installation (patool) and prevents redundant extractions via marker files.

version: 1.0.1

Smart Archive Extractor

This skill provides a reliable way to recursively extract archives. It supports complex logic like avoiding re-extraction of already processed files and handling nested archives (e.g., a zip containing a tar.gz).

Capabilities

  • Recursive Extraction: Automatically detects archives inside extracted folders and extracts them (up to 20 levels deep).
  • Idempotency: Skips extraction if a success marker (.extracted_success) is found, unless forced.
  • Smart Format Support: Handles standard formats (.zip, .tar) and complex ones (.rar, .7z) by auto-installing dependencies.
  • Gzip Handling: Special handling for single .gz files (e.g., data.txt.gz -> data.txt/data.txt).

Usage

Run the python script located in scripts/extract.py.

Command Syntax

python3 scripts/extract.py <PATH> [OPTIONS]

Arguments

  • <PATH>: The target file or directory pattern to process.
    • Examples: data.zip, downloads/, "*.tar.gz" (glob patterns supported).

Options

  • -f, --force: Force re-extraction even if the success marker exists. Use this if the user says "retry", "overwrite", or "force".
  • -d, --dest <DIR>: Specify a root output directory. If omitted, archives are extracted alongside the source files.

Examples

1. Basic Extraction

Extract a single file or a directory of archives.

python3 scripts/extract.py downloads/archive.zip
# OR for a directory
python3 scripts/extract.py downloads/

2. Force Re-extraction

Use when the user suspects corruption or explicitly requests a clean start.

python3 scripts/extract.py downloads/archive.zip -f

3. Extract to Specific Folder

Use when the user wants to organize output in a separate location.

python3 scripts/extract.py downloads/ -d ./extracted_output

Error Handling

  • If patool is missing, the script will attempt to pip install it automatically.
  • If an archive is corrupt, it will be skipped, and the error will be logged without crashing the entire process.
  • If recursion depth exceeds 20, it will stop digging deeper to prevent infinite loops.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill