Guides
Scripts and CI
peel keeps results on standard output and errors on standard error, with one exit code per failure kind, so a script never has to parse prose.
Conventions
-jputs JSON on standard output. Without it, output is for people and can change.- A failure is one JSON line on standard error when
-jor--ndjson-progressis set:{"error": "<kind>", "detail": "<text>"}. The kind is stable. The detail is for logs. -qsilences human output that is not an error. Use it when you only want the exit code.- The exit code names the failure. Errors and exit codes lists every kind. The ones you branch on most are 3 (password required), 4 (incorrect password), 5 (damaged), 11 (not found) and 13 (unsafe entry).
for f in demo.zip locked.zip damaged.zip missing.zip; do peel test -q "$f" 2>/dev/null; echo "$f: exit $?"; done
demo.zip: exit 0
locked.zip: exit 3
damaged.zip: exit 5
missing.zip: exit 11peel 1.4.0, recorded 2026-11-26.Pass -j and you get the error as data:
peel test -j damaged.zip{"error":"damaged","detail":"test damaged.zip: zip error: invalid Zip archive: Could not find EOCD: invalid Zip archive: Could not find EOCD"}The detail text changes between releases. Match on error
and the exit code.
peel
assess and peel find-originals report a finding, not
a failure. peel unlock exits 0 even when it recovered
nothing. Read the JSON field (feasibility,
entries_matched, recovered) for those. See the
recover guide.
JSON and jq
Most read commands take -j: list,
inspect, probe, test,
assess, find-originals, salvage,
repair and extract. These recipes were run
against the demo archives.
# Files only, one per line
peel l -j demo.zip | jq -r '.[] | select(.is_dir | not) | .name'
# Total uncompressed size of the files
peel l -j demo.zip | jq '[.[] | select(.is_dir | not) | .size] | add'
# One-line summary
peel inspect -j demo.zip | jq -c '{format, entries: (.entries | length), total_uncompressed_bytes, has_encrypted_entries}'
# Did every entry check out?
peel test -j demo.zip | jq -e '.ok'
# What was written
peel x demo.zip -o out -j | jq -r '.extracted[]'jq -e sets jq’s own exit status from the value, so
.ok works as a test in if. Locked archives get
the same treatment. This is the output of peel assess -j,
trimmed with jq:
peel assess -j locked.zip | jq '{feasibility, scheme: .encryption.scheme, verdict: .recovery_contract.verdict.class}'
{
"feasibility": "uncertain",
"scheme": "zip-aes",
"verdict": "no_practical_path"
}peel 1.4.0, recorded 2026-11-26.Progress events
--ndjson-progress writes one JSON event per line to
standard error during extract, at most about ten a second.
Standard output keeps the result.
peel x demo.zip -o events --ndjson-progress > /dev/null
{"phase":"extract","entries_done":0,"entries_total":11,"bytes_done":0,"bytes_total":null,"current_entry":null,"destination":"events"}
{"phase":"extract","entries_done":11,"entries_total":11,"bytes_done":32550,"bytes_total":32550,"current_entry":null}
{"phase":"extract","entries_done":11,"entries_total":11,"bytes_done":32550,"bytes_total":32550,"current_entry":null}
{"phase":"done","entries_done":11,"entries_total":11,"bytes_done":0,"bytes_total":null,"current_entry":null}peel 1.4.0, recorded 2026-11-26.The fields are phase (extract, then
done), entries_done,
entries_total, bytes_done,
bytes_total and current_entry. The first event
also carries destination. bytes_total can be
null while the total is unknown. The same event can repeat.
Treat the stream as a state, not a log.
A failure arrives on the same stream as {"error": …}.
Split the two with has("error"):
peel x -q "$archive" -o out --ndjson-progress 2>&1 >/dev/null \
| jq -r 'if has("error") then "error: \(.error)" else "\(.entries_done)/\(.entries_total)" end'2>&1 >/dev/null sends standard error down the
pipe and discards standard output. The order matters, and it is written
for bash. Add -q, as above, to keep the human summary off
standard error. Only extract emits progress today.
peel test --ndjson-progress prints its normal result and no
events.
Passwords
Give the password through a pipe, so no other process can read it:
# From the macOS keychain
security find-generic-password -s backup -w | peel x locked.zip -o out --password-stdin
# From a file descriptor
peel x locked.zip -o out --password-fd 3 3< <(security find-generic-password -s backup -w)printf 'correct horse battery staple' | peel test locked.zip --password-stdin
OK Zip 11 entries, 8 verified, 0 unchecked locked.zippeel 1.4.0, recorded 2026-11-26.Both drop one trailing newline. A wrong password exits 4, and a missing one exits 3, so a script can ask again instead of giving up:
peel x -q locked.zip -o out --password-stdin <<< "$guess"
[ $? -eq 4 ] && echo "wrong password, try the next one"Avoid the alternatives. -p and --password
show the password in the process list. PEEL_PASSWORD is
visible to other processes of the same user while peel runs
(ps eww). It is fine for a throwaway test and not for a
secret you care about. Never put a password in a CI log. Use the CI
system’s secret store and pipe it in.
Many archives
Test a set and keep going after the first failure, then fail the script at the end:
shopt -s nullglob
status=0
for f in release/*.zip release/*.7z; do
if ! peel test -q "$f"; then
echo "bad archive: $f" >&2
status=1
fi
done
exit $statusnullglob makes an unmatched pattern expand to nothing
instead of the literal text. Quote "$f" for names with
spaces. peel takes one archive per call, so loop. Collect a
report the same way:
for f in *.zip; do
peel assess -j "$f" | jq -c --arg f "$f" '{file: $f, feasibility, scheme: .encryption.scheme}'
done{"file":"demo.zip","feasibility":"plausible","scheme":"none"}
{"file":"locked.zip","feasibility":"uncertain","scheme":"zip-aes"}Test archives in CI
peel test reads every entry to the end and checks it
against the format’s own checksums. It writes nothing. Exit 0 means
every entry passed, 1 means some entries failed, 5 means the archive
cannot be read, and 3 and 4 are password errors.
peel test corrupt.zip; echo "exit $?"
BAD Zip 11 entries, 7 verified, 0 unchecked corrupt.zip
FAIL project/README.md: io error: corrupt deflate stream
peel: 1 of 8 entries failed
exit 1peel 1.4.0, recorded 2026-11-26.With -j, the failures are data:
{"ok": false, "verified": 7, "entries": 11, "failures": [{"name": "project/README.md", "error": "io error: corrupt deflate stream"}]}.
The counts say how much was verified: verified entries had
a checksum, and readable_only entries were read without
one.
GitHub Actions
name: archives
on:
pull_request:
paths: ["release/**"]
concurrency:
group: archives-${{ github.ref }}
cancel-in-progress: true
jobs:
test-archives:
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install peel
run: |
curl -fsSL https://filesunwrapped.com/developers/install.sh | sh -s -- --prefix "$HOME/.local"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Test every archive
env:
ARCHIVE_PASSWORD: ${{ secrets.ARCHIVE_PASSWORD }}
run: |
shopt -s nullglob
status=0
for f in release/*.zip release/*.7z; do
printf '%s' "$ARCHIVE_PASSWORD" | peel test "$f" --password-stdin || status=1
done
exit $statusWhat the install script does, from its source: it picks the release,
downloads the tarball, checks its SHA-256 and aborts on a mismatch
before extracting anything, then copies peel into
PREFIX/bin. It never calls sudo. With no
--prefix it uses /usr/local if writable,
otherwise ~/.local. If no Rind release exists yet, it
installs the peel binary from the newest Peel app release
on macOS. Use macOS runners: that is the platform Peel supports today.
--with-lib also installs libpeel and
peel.h.
An archive that is not password-protected ignores the piped password.
If your set mixes both, drop --password-stdin for the open
ones.
Completions and the man page
peel completions zsh > ~/.zfunc/_peel # fpath must include ~/.zfunc
peel completions bash > ~/.local/share/bash-completion/completions/peel
peel completions fish > ~/.config/fish/completions/peel.fish
peel man > peel.1 && man ./peel.1peel completions also takes elvish and
powershell. peel man prints the
peel(1) page as roff on standard output. The Mac app
bundles both.
Capabilities
peel reflect prints the engine’s capability index as one
JSON document in an rr-rsp-0.1 envelope. It has
schema_version, subject_id, a
provenance block naming the engine version, and a
body. The capability ids in this build are listed by:
peel reflect | jq -r '.body.descriptor.capabilities[].id'inspect list read_member probe assess find_originals extract repair diagnose formatsEach capability has a description,
endpoint, inputs and outputs. Use
it to check that a binary offers what a script needs before calling it.
--sign signs the document with an Ed25519 key for this
installation, and creates that key on first use.
Diagnose for bug reports
peel diagnose builds a report that is safe to share. It
says it contains no file names, paths or contents.
peel diagnose demo.zip
Peel diagnostic report — safe to share (no file names, paths, or contents)
Peel 1.4.0 · macOS 27.2.1
format zip · 2424 bytes · 11 entriespeel 1.4.0, recorded 2026-11-26.With -j it gives os, peel and
a report with format, size,
entries, error_kind and findings.
For an archive that will not open, error_kind is the same
kind as the exit code table, such as
damaged. Attach the output to the bug report.
peel assess Look at a locked archive and say whether recovery is realistic, without trying a single password: the encryption scheme, whether file names are hidden, multi-volume state, and a feasibility rating.peel completions Print a shell completion script for bash, zsh, fish, powershell or elvish.peel inspect The manifest: format, totals, and each entry with its type, size, compressed size and, where the format records them, mode, modified time, owner, symlink target, compression method and CRC-32.peel list List members, optionally filtered by patterns.peel test Read every entry to the end and report which fail.peel extract Extract everything, or only the members and globs you name.