home / skills / aidotnet / moyucode / file-archiver

file-archiver skill

/skills/tools/file-archiver

This skill creates and extracts ZIP, TAR, and GZIP archives with optional password protection to manage compressed files efficiently.

npx playbooks add skill aidotnet/moyucode --skill file-archiver

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1001 B
---
name: file-archiver
description: 创建和解压ZIP、TAR和GZIP压缩包,支持密码保护。
metadata:
  short-description: 创建和解压压缩包
source:
  repository: https://docs.python.org/3/library/zipfile.html
  license: PSF
---

# File Archiver Tool

## Description
Create and extract compressed archives (ZIP, TAR, GZIP) with optional password protection.

## Trigger
- `/archive` command
- User requests file compression
- User needs to extract archives

## Usage

```bash
# Create ZIP archive
python scripts/file_archiver.py create --input folder/ --output archive.zip

# Extract archive
python scripts/file_archiver.py extract --input archive.zip --output extracted/

# Create with password
python scripts/file_archiver.py create --input folder/ --output secure.zip --password secret123

# List archive contents
python scripts/file_archiver.py list --input archive.zip
```

## Tags
`zip`, `archive`, `compress`, `extract`, `tar`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill creates and extracts ZIP, TAR, and GZIP archives with optional password protection. It provides command-style operations to compress folders and files, list archive contents, and securely produce encrypted ZIP files for transport or backup. The implementation is concise and suitable for automation or integration into workflows.

How this skill works

You invoke commands to create, extract, or list archives. The tool reads files and directories, selects the requested archive format (ZIP, TAR, or GZIP), applies optional password-based encryption for ZIP outputs, and writes the resulting archive to the target path. For extraction it detects the format, validates passwords when required, and restores files to the specified output folder.

When to use it

  • Bundling a project directory for distribution or backup
  • Reducing transfer size when uploading or sending files
  • Encrypting sensitive files for secure sharing using password-protected ZIP
  • Unpacking archives received from others or downloaded from the web
  • Scripting repeatable archive workflows in CI/CD or automation

Best practices

  • Use TAR/GZIP for Unix-style preservation of permissions and metadata when compressing on Linux/macOS
  • Use ZIP when cross-platform compatibility or password protection is required
  • Choose strong, unique passwords for encrypted ZIPs and manage them securely (do not embed in public scripts)
  • Verify archive contents with the list operation before extracting to avoid surprises
  • Automate checksums or signing for archives containing critical releases

Example use cases

  • Create a ZIP of a build output to upload as a single artifact
  • Produce a password-protected ZIP before sending confidential reports to a partner
  • Compress log directories into GZIP or TAR.GZ for long-term storage
  • Extract downloaded archives into a clean workspace during deployment
  • List archive contents in a CI job to confirm expected files are present

FAQ

Which formats support password protection?

Password protection is supported for ZIP archives. TAR and GZIP do not provide built-in password encryption.

Can I preserve file permissions and ownership?

Yes. Use TAR or TAR.GZ to preserve Unix permissions, ownership, and symbolic links. ZIP preserves basic attributes but may not retain all metadata across platforms.

How do I handle large archives in automation?

Stream creation and extraction where possible, split large archives if needed, and verify available disk space before extracting to avoid failures.