{"skill":{"slug":"archive-tool","displayName":"Archive Tool","summary":"Extract, create, and list archive files (zip, tar, gz natively; rar, 7z with system tools) using batch or single operations with optional passwords.","description":"---\nname: archive-tool\ndescription: Extract and create archive files (zip, rar, 7z, tar, gz). Use when: (1) Extracting zip/rar/7z files, (2) Creating zip archives, (3) Viewing archive contents, (4) Batch extracting files.\nversion: 1.1.0\nchangelog: \"v1.1.0: Added reasoning framework, decision tree, troubleshooting, self-checks\"\nmetadata:\n  openclaw:\n    requires:\n      bins:\n        - python3\n    emoji: \"📦\"\n    category: \"utility\"\n    homepage: https://github.com/KeXu9/archive-skill\n---\n\n# Archive Tool\n\nExtract and create archive files (zip, rar, 7z, tar, gz).\n\n## When This Skill Activates\n\nThis skill triggers when user wants to extract, create, or list archive files.\n\n## Reasoning Framework\n\n| Step | Action | Why |\n|------|--------|-----|\n| 1 | **DETECT** | Identify archive format (zip/tar/gz/rar/7z) |\n| 2 | **CHECK** | Verify tools available for format |\n| 3 | **EXECUTE** | Extract, create, or list |\n| 4 | **VERIFY** | Confirm success, report errors |\n\n---\n\n## Install\n\n```bash\n# Optional (for rar/7z support)\nbrew install unar p7zip\n```\n\n---\n\n## Decision Tree\n\n### What are you trying to do?\n\n```\n├── Extract archive\n│   └── Use: archive.py extract file.zip -o ./output\n│\n├── Create archive\n│   └── Use: archive.py create output.zip ./folder\n│\n├── View contents\n│   └── Use: archive.py list file.zip\n│\n└── Batch extract\n    └── Use: archive.py extract \"*.zip\"\n```\n\n---\n\n## Features\n\n| Feature | Description |\n|---------|-------------|\n| Extract | zip, tar, tar.gz, tgz, gz, rar, 7z |\n| Create | zip, tar, tar.gz |\n| List | View archive contents |\n| Batch | Extract multiple files |\n\n---\n\n## Extract\n\n### Command\n\n```bash\npython archive.py extract <file> [-o OUTPUT] [--password PASS]\n```\n\n### Examples\n\n```bash\n# Extract to current folder\npython archive.py extract archive.zip\n\n# Extract to specific folder\npython archive.py extract archive.zip -o ./extracted\n\n# Extract with password\npython archive.py extract archive.rar --password secret\n\n# Extract to current directory\npython archive.py extract archive.7z -o ./\n\n# Batch extract all zip files\npython archive.py extract \"*.zip\"\n```\n\n---\n\n## Create\n\n### Command\n\n```bash\npython archive.py create <output> <source> [--compression LEVEL]\n```\n\n### Examples\n\n```bash\n# Create zip from folder\npython archive.py create myfiles.zip ./myfolder\n\n# Create tar from folder\npython archive.py create backup.tar ./folder\n\n# Create tar.gz\npython archive.py create backup.tar.gz ./folder\n```\n\n---\n\n## List\n\n### Command\n\n```bash\npython archive.py list <file>\n```\n\n### Examples\n\n```bash\n# List contents\npython archive.py list archive.zip\n\n# View without extracting\npython archive.py list backup.tar.gz\n```\n\n---\n\n## Supported Formats\n\n| Format | Extract | Create | Notes |\n|--------|---------|--------|-------|\n| zip | ✅ | ✅ | Python stdlib |\n| tar | ✅ | ✅ | Python stdlib |\n| tar.gz / tgz | ✅ | ✅ | Python stdlib |\n| gz | ✅ | ❌ | Python stdlib |\n| rar | ⚠️ | ❌ | Requires `unar` |\n| 7z | ⚠️ | ❌ | Requires `p7zip` |\n\n⚠️ = requires system tools\n\n---\n\n## Options\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `-o, --output` | Output directory | current dir |\n| `--password` | Archive password | none |\n| `--compression` | 0-9 (zip only) | 6 |\n\n---\n\n## Troubleshooting\n\n### Problem: \"No module named 'zipfile'\"\n\n- **Cause:** Using Python 2\n- **Fix:** Use `python3` instead of `python`\n\n### Problem: \"Unsupported archive format\"\n\n- **Cause:** Unknown format or corrupted file\n- **Fix:** Verify file extension is correct\n\n### Problem: \"Password required\"\n\n- **Cause:** Encrypted archive\n- **Fix:** Use `--password` flag\n\n### Problem: \"rar/7z extraction failed\"\n\n- **Cause:** Tools not installed\n- **Fix:** `brew install unar p7zip`\n\n### Problem: \"Permission denied\"\n\n- **Cause:** No write permission in output folder\n- **Fix:** Check folder permissions or use different output path\n\n---\n\n## Self-Check\n\n- [ ] Using correct Python (python3)\n- [ ] Archive file exists and is readable\n- [ ] For rar/7z: required tools installed\n- [ ] Output directory exists and is writable\n- [ ] Password correct (if encrypted)\n\n---\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Extract zip | `python archive.py extract file.zip` |\n| Extract to folder | `python archive.py extract file.zip -o ./out` |\n| Extract rar | `python archive.py extract file.rar` |\n| Create zip | `python archive.py create out.zip ./folder` |\n| Create tar.gz | `python archive.py create out.tar.gz ./folder` |\n| List contents | `python archive.py list file.zip` |\n\n---\n","tags":{"latest":"1.1.0"},"stats":{"comments":0,"downloads":229,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":2},"createdAt":1772551398674,"updatedAt":1778491703663},"latestVersion":{"version":"1.1.0","createdAt":1772632416003,"changelog":"v1.1.0: Adds reasoning, troubleshooting, and self-check features for improved usability\n\n- Introduced a reasoning framework and decision tree for clear, step-by-step usage guidance.\n- Added comprehensive troubleshooting section to help resolve common user issues.\n- Included self-checklist for user setup and environment validation.\n- Expanded documentation with options, quick reference, and enhanced descriptions.\n- Updated metadata with category field for better classification.","license":null},"metadata":null,"owner":{"handle":"kexu9","userId":"s177fq1kmnfz4mhm2xyw0c9kt183ga2b","displayName":"KeXu9","image":"https://avatars.githubusercontent.com/u/147953862?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089756449}}