← Back to Skills Marketplace
turinfohlen

Text Directory Archiver

by TurinFohlen · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
70
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install text-directory-archiver
Description
Package directory structures into a single plain text file, or restore directory structures from text files. Ideal for transferring projects across sessions,...
README (SKILL.md)

Text Directory Archiver

Serialize any directory structure into copyable plain text, or restore directories from text content. It can be operated automatically via scripts, and also acts as a multi-file delivery protocol between AI and users.

Quick Reference for Use Cases

Scenario Recommended Method Local directory ↔ Text file (with terminal access) archive.py script Request AI to generate a multi-file project AI outputs content following the protocol format Migrate projects across sessions (no direct file transfer) Package to text → Paste into new session → Unpack Share code repositories via instant messaging or forums Package to text; recipients unpack the content

Method 1: Automated Script (Terminal Environment Required)

Requirements: Python 3.6 or above; no extra packages required.

# Pack: Compress a directory into a text file
python archive.py pack \x3Csource_directory> \x3Coutput_file.txt>

# Unpack: Restore a text file to a directory
python archive.py unpack \x3Cinput_file.txt> \x3Coutput_directory>

The script will automatically complete the following tasks:

· Embed plain text files (UTF-8 decodable) as raw content · Encode binary files with Base64 · Record target paths for symbolic links (converted to placeholder files for cross-platform use) · Generate a random separator to avoid content conflicts

Method 2: Direct AI Protocol Output (Pure Chat Environment)

Use this method when you need the AI to output a complete project structure during conversations.

Prompt Template for AI Output:

Output this project following the Text Directory Archiver protocol. Set the separator to 'v1', and include the files listed below: [List your files here]

Protocol Specifications

  1. JSON Header (Must be placed at the very start)
{
  "separator": "v1",
  "files": {
    "src/main.py":   { "type": "text" },
    "README.md":     { "type": "text" },
    "data/model.bin":{ "type": "base64" },
    "logs/":         { "type": "dir" }
  }
}

· separator: A space‑free string for building delimiters to prevent conflicts with file content. A short random string is recommended. · files: Declare all file paths. Valid type values: text, base64, dir, symlink.

  1. File Content Blocks (Immediately after the JSON header)
---file_v1: src/main.py (text)
print("Hello, world!")

---file_v1: README.md (text)
# My Project
This is the documentation.

---file_v1: data/model.bin (base64)
SGVsbG8gV29ybGQ=

Format Rules:

· Each block starts with ---file_\x3Cseparator>: \x3Cfile_path> (\x3Ctype>) on an independent line · Content continues until the next delimiter or the end of the text · For symbolic links: Use ---symlink_\x3Cseparator>: \x3Cpath> -> \x3Ctarget_path> · The dir type is only declared in the JSON header, with no corresponding content block

Minimal Example

{
  "separator": "x1",
  "files": {
    "hello.py": { "type": "text" },
    "assets/": { "type": "dir" }
  }
}
---file_x1: hello.py (text)
print("hi")

Notes

When Packing

· Large binary files (videos, model weights, etc.) will expand in size by approximately 33% due to Base64 encoding overhead. Exclude such files as appropriate. · The script will skip symbolic links with missing targets and output a warning.

When Unpacking

· The target directory will be created automatically if it does not exist. · Administrator privileges are required to create symbolic links on Windows. If creation fails, a placeholder file storing the link target path will be generated instead.

When Generating Content via AI

· Long outputs from AI may be truncated. Please check the integrity of the last file. · For large projects, request the AI to output content in batches by directories.

Script Resources

scripts/archive.py: Core script that supports full packing and unpacking workflows, including processing for binary files and symbolic links. Run the script directly to view usage instructions.

Usage Guidance
Use this only with archives you trust, and unpack into a new empty temporary directory first. Before running the unpack command, inspect the manifest for absolute paths, '..' path segments, symlinks, executable files, and unexpected destinations; do not execute restored code until reviewed. The clean static scan and absent VirusTotal telemetry do not remove the local file-write risks shown in the script.
Capability Assessment
Purpose & Capability
Packing and restoring directory trees is coherent with the stated purpose, but the restore implementation accepts archive-controlled paths and symlink targets, so crafted input can write outside the intended output directory.
Instruction Scope
The instructions encourage unpacking project text from AI chats, messages, or forums, but do not clearly warn users to treat that text as untrusted or to inspect paths, symlinks, and overwrite behavior before restoring.
Install Mechanism
The artifact contains a markdown skill file and a Python script with no declared dependencies, API keys, install hooks, or background setup.
Credentials
Local filesystem writes are expected for a directory restoration tool, but the script lacks path normalization, output-root confinement, dry-run behavior, and conflict prompts, making the mutation authority broader than users may expect.
Persistence & Privilege
There is no evidence of privilege escalation, network exfiltration, or background persistence, but unpacking creates persistent files or symlinks and may remove an existing path before recreating a symlink.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install text-directory-archiver
  3. After installation, invoke the skill by name or use /text-directory-archiver
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
No functional or content changes detected for version 1.0.1. - No file changes were made in this release. - Documentation (SKILL.md) changed from Chinese to English, but features remain the same. - Usage scenarios, protocol, and instructions are now available in English for broader accessibility.
v1.0.0
- Initial release of text-directory-archiver. - Allows packaging any directory structure into a single plain text file or restoring a directory structure from such a file. - Supports use cases such as project transfer across sessions, codebase snapshots, and sharing complete projects in plain text environments. - Provides a Python 3.6+ script (`archive.py`) for automated packing/unpacking, handling text, binary files (via Base64), and symlinks. - Defines a standard text protocol for both script and AI interaction scenarios. - Includes clear documentation and usage examples for both local and AI-assisted workflows.
Metadata
Slug text-directory-archiver
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Text Directory Archiver?

Package directory structures into a single plain text file, or restore directory structures from text files. Ideal for transferring projects across sessions,... It is an AI Agent Skill for Claude Code / OpenClaw, with 70 downloads so far.

How do I install Text Directory Archiver?

Run "/install text-directory-archiver" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Text Directory Archiver free?

Yes, Text Directory Archiver is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Text Directory Archiver support?

Text Directory Archiver is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Text Directory Archiver?

It is built and maintained by TurinFohlen (@turinfohlen); the current version is v1.0.1.

💬 Comments