~ / zipp / docs
linux · darwin · windows Apache-2.0
v0.9.0 linux · darwin · windows Apache-2.0

$Small, sharp tools for zip archives.

zipp is a set of command-line utilities to work with zip files: list their contents, timestamp new archives, and add files to existing ones — including nested archives.

zero-config binaries nested archive support
zipls dist/zipp_linux_amd64.zip
exit 0
# list
zipls app.zip
app/            dir
app/bin/run     file

# timestamped archive
zipts testdata/
✓ testdata-20260708.zip

# add into an existing zip
zipw -f README.md -z app.zip

Three commands, one job each.

01 zipw

Add a file to an existing archive — including nested writes into a jar inside a war inside an ear. Interactive, flag-driven, or YAML-configured.

zipw -f README.md -i archive/readme.md -z app.zip
02 zipls

List a zip's contents with sizes, timestamps, grep/exclude filters and sorting — a quick, readable view into any archive.

zipls -s -t --sort size app.zip
03 zipts

Zip a directory into an archive whose name carries a timestamp suffix — handy for snapshots and backups, with exclude patterns.

zipts -x 'vendor/*' -o /tmp/backups .

Usage

Zip utilities:

  • zipls: lists zip contents
  • zipts: creates a zip file with a timestamp suffix in the name
  • zipw: add file to existing zip

Zipw

Add file to zip.

Add the file README.md to the zip dist/zipp-0.7.0-dev_linux_amd64.zip in the path zipp-0.7.0-dev_linux_amd64/myreadme.md:

$ zipw -f README.md -i 'zipp-0.7.0-dev_linux_amd64/myreadme.md' -z dist/zipp-0.7.0-dev_linux_amd64.zip
$ zipls dist/zipp-0.7.0-dev_linux_amd64.zip
zipp-0.7.0-dev_linux_amd64/myreadme.md
zipp-0.7.0-dev_linux_amd64/zipls
zipp-0.7.0-dev_linux_amd64/zipw
zipp-0.7.0-dev_linux_amd64/zipts

Nested write is supported.

Add the file README.md in the path com/example/readme.md into the file WEB-INF/lib/library.jar into the file webapp.war into the file corporate.ear:

$ zipw -f README.md -i 'webapp.war#WEB-INF/lib/library.jar#com/example/readme.md' -z corporate.ear

Parameters can also be passed via a YAML file:

$ zipw -p zipw.yml

If neither -f nor -p is provided, zipw enters interactive mode and prompts for the parameters.

Preview what would happen without modifying any file:

$ zipw -f README.md -i 'archive/readme.md' -z app.zip --dry-run

Available flags:

FlagDescription
-f, --fileFile to add to the archive
-z, --zipZip archive to update
-i, --innerInner path inside the archive (defaults to the source file path)
-p, --paramsYAML file containing parameters
-N, --dry-runPrint what would happen without modifying any file
--forceOverwrite existing entries without prompting
--no-overwriteAbort with an error if the entry already exists
-q, --quietQuiet mode
-V, --verboseVerbose mode

Zipls

List contents of a zip file.

$ zipls dist/zipp-0.7.0-dev_linux_amd64.zip
NAME                                  TYPE
--------------------------------------
zipp-0.7.0-dev_linux_amd64/          dir
zipp-0.7.0-dev_linux_amd64/zipls     file
zipp-0.7.0-dev_linux_amd64/zipw      file
zipp-0.7.0-dev_linux_amd64/zipts     file

Show file sizes and modification times:

$ zipls -s -t dist/zipp-0.7.0-dev_linux_amd64.zip

Filter entries by pattern (highlighted in output):

$ zipls --grep zipw dist/zipp-0.7.0-dev_linux_amd64.zip

Exclude entries matching a pattern:

$ zipls --exclude test dist/zipp-0.7.0-dev_linux_amd64.zip

Sort results:

$ zipls --sort size dist/zipp-0.7.0-dev_linux_amd64.zip
$ zipls --sort date --reverse dist/zipp-0.7.0-dev_linux_amd64.zip

Available flags:

FlagDescription
-g, --grepFilter entries containing pattern (highlighted in output)
-e, --excludeExclude entries containing pattern
-d, --dirShow only directories
-s, --sizeShow file size
-t, --timeShow modification time
--sortSort order: none (default), name, size, date
-r, --reverseReverse sort order

Zipts

Create a zip file with timestamp suffix:

$ zipts testdata/
Zipping  /home/enrico/Projects/zipp/testdata
Completed /home/enrico/Projects/zipp/testdata-20210227173843.zip

It is possible to exclude files from zip:

$ zipts -x '\.git/*' -x 'vendor/*' .

Write the archive to a specific output directory:

$ zipts -o /tmp/backups .

Preview the output path without creating the archive:

$ zipts -N .

Available flags:

FlagDescription
-x, --excludeExclude files matching pattern (repeatable)
-o, --outOutput directory (defaults to parent of input path)
-N, --noopPrint output path without creating the archive
-q, --quietQuiet mode
-V, --verboseVerbose mode

License

Apache License 2.0 — Copyright (C) 2016-TODAY zipp contributors.