← 返回
未分类

Archive Tool

Extract, create, and list archive files (zip, tar, gz natively; rar, 7z with system tools) using batch or single operations with optional passwords.
提取、创建并列出压缩文件(原生支持 zip、tar、gz;rar、7z 需系统工具),支持批量或单文件操作,可选密码保护。
kexu9
未分类 clawhub v1.1.0 1 版本 99487.2 Key: 无需
★ 0
Stars
📥 194
下载
💾 0
安装
1
版本
#latest

概述

Archive Tool

Extract and create archive files (zip, rar, 7z, tar, gz).

When This Skill Activates

This skill triggers when user wants to extract, create, or list archive files.

Reasoning Framework

StepActionWhy
-------------------
1DETECTIdentify archive format (zip/tar/gz/rar/7z)
2CHECKVerify tools available for format
3EXECUTEExtract, create, or list
4VERIFYConfirm success, report errors

Install

# Optional (for rar/7z support)
brew install unar p7zip

Decision Tree

What are you trying to do?

├── Extract archive
│   └── Use: archive.py extract file.zip -o ./output
│
├── Create archive
│   └── Use: archive.py create output.zip ./folder
│
├── View contents
│   └── Use: archive.py list file.zip
│
└── Batch extract
    └── Use: archive.py extract "*.zip"

Features

FeatureDescription
----------------------
Extractzip, tar, tar.gz, tgz, gz, rar, 7z
Createzip, tar, tar.gz
ListView archive contents
BatchExtract multiple files

Extract

Command

python archive.py extract <file> [-o OUTPUT] [--password PASS]

Examples

# Extract to current folder
python archive.py extract archive.zip

# Extract to specific folder
python archive.py extract archive.zip -o ./extracted

# Extract with password
python archive.py extract archive.rar --password secret

# Extract to current directory
python archive.py extract archive.7z -o ./

# Batch extract all zip files
python archive.py extract "*.zip"

Create

Command

python archive.py create <output> <source> [--compression LEVEL]

Examples

# Create zip from folder
python archive.py create myfiles.zip ./myfolder

# Create tar from folder
python archive.py create backup.tar ./folder

# Create tar.gz
python archive.py create backup.tar.gz ./folder

List

Command

python archive.py list <file>

Examples

# List contents
python archive.py list archive.zip

# View without extracting
python archive.py list backup.tar.gz

Supported Formats

FormatExtractCreateNotes
--------------------------------
zipPython stdlib
tarPython stdlib
tar.gz / tgzPython stdlib
gzPython stdlib
rar⚠️Requires unar
7z⚠️Requires p7zip

⚠️ = requires system tools


Options

FlagDescriptionDefault
----------------------------
-o, --outputOutput directorycurrent dir
--passwordArchive passwordnone
--compression0-9 (zip only)6

Troubleshooting

Problem: "No module named 'zipfile'"

  • Cause: Using Python 2
  • Fix: Use python3 instead of python

Problem: "Unsupported archive format"

  • Cause: Unknown format or corrupted file
  • Fix: Verify file extension is correct

Problem: "Password required"

  • Cause: Encrypted archive
  • Fix: Use --password flag

Problem: "rar/7z extraction failed"

  • Cause: Tools not installed
  • Fix: brew install unar p7zip

Problem: "Permission denied"

  • Cause: No write permission in output folder
  • Fix: Check folder permissions or use different output path

Self-Check

  • [ ] Using correct Python (python3)
  • [ ] Archive file exists and is readable
  • [ ] For rar/7z: required tools installed
  • [ ] Output directory exists and is writable
  • [ ] Password correct (if encrypted)

Quick Reference

TaskCommand
---------------
Extract zippython archive.py extract file.zip
Extract to folderpython archive.py extract file.zip -o ./out
Extract rarpython archive.py extract file.rar
Create zippython archive.py create out.zip ./folder
Create tar.gzpython archive.py create out.tar.gz ./folder
List contentspython archive.py list file.zip

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-05-12 05:35 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

ImgBB API

kexu9
通过本地文件、URL或Base64上传图片至ImgBB,获取可分享的直接链接,支持批量上传及可选的过期设置。
★ 1 📥 574
productivity

Paper Compare

kexu9
并排比较学术论文,识别相似点、差异与研究空白。适用于通过 DOI 等方式比较 1‑5 篇论文。
★ 0 📥 669
data-analysis

Skill Maker

kexu9
从头创建新的代理技能。适用于:①构建特定功能;②将工作流转换为可复用技能;③设计技能结构……
★ 0 📥 745