Skip to content

gitclonexx/uni-extract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

uni-extract (ext)

A robust universal archive extractor for zsh that focuses on safety, predictability, and clean extraction.

Unlike simple case *.zip aliases, ext is designed to handle real-world archives:

  • Path traversal protection
  • Clean output directories
  • Collision-free extraction
  • Fallback detection for wrong or missing file extensions
  • No cd hacks, no side effects

Features

  • Supports: tar, tar.gz, tar.xz, tar.zst, zip, 7z, rar, gz, bz2, xz, zst
  • Detects archive type even with incorrect or missing extensions (file fallback)
  • Path traversal (Zip-Slip) protection — blocks ../ and absolute paths
  • Automatically extracts into a dedicated directory
  • Collision-safe output (foo, foo_2, foo_3, …)
  • Optional flags:
    • --list → show archive contents without extracting
    • --no-dir → extract into the current directory
    • --flat → flatten directory structure (zip clean, 7z best-effort)
    • --force → reuse existing output directory
  • No global shell side effects (emulate -L zsh)
  • Clear error handling and exit codes

Installation

curl -fsSL https://raw.githubusercontent.com/gitclonexx/uni-extract/main/ext.zsh -o ~/.zsh/ext.zsh
echo 'source ~/.zsh/ext.zsh' >> ~/.zshrc

About

Secure universal archive extractor for zsh

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages