How to selective zipper vs cli glob filtering (zip / tar / 7z)
- Step 1Decide if you need rich glob semantics — If you need brace expansion (
*.{ts,tsx}), multiple include patterns, or negative excludes (-x '*.test.ts'), reach for the CLI — the Selective Zipper supports a single positive pattern with*,**,?only. For one straightforward pattern, the browser tool is faster to use. - Step 2Decide on output format — Need TAR.GZ or 7z? The CLI emits any format; the Selective Zipper emits ZIP only (
filtered.zip). If ZIP is fine, or you can post-convert with archive-format-converter, the browser tool works. - Step 3Check the size — Under a few hundred MB, fflate is fast and the browser tool is effortless. For multi-gigabyte trees, the CLI streams to disk without browser memory limits — and the Selective Zipper is capped at 2 GB even on the top tier.
- Step 4Open the tool (browser path) — Go to /archive-tools/selective-zipper, drop the folder, type the glob, click Process. The folder picker preserves relative paths, mirroring
zip -rbehaviour from the chosen root. - Step 5Translate your CLI pattern —
zip -i 'src/**/*.ts'→globPattern: src/**/*.ts.7z a -i!*.svg→globPattern: *.svg. Drop the quoting and the-i/-i!flag; keep the bare glob. Remember*does not cross/(use**). - Step 6Download and verify — Confirm the
Matchedcount matches whatfind ... | wc -lwould report, then downloadfiltered.zip. For a reproducible artifact, run it through timestamp-normalizer and checksum-generator.
Capability matrix: Selective Zipper vs CLI include-globs
What each path can do for building an archive from a pattern. CLI columns reflect typical Info-ZIP / GNU tar / 7-Zip behaviour; exact syntax varies by shell and version.
| Capability | Selective Zipper (browser) | zip / tar / 7z (CLI) |
|---|---|---|
Single positive glob (*, **, ?) | Yes | Yes |
Brace expansion *.{ts,tsx} | No (literal braces) — run two passes | Yes (shell or -i patterns) |
| Negative / exclude patterns | No — inverse via folder-to-zip + selective-extractor | Yes (-x, --exclude) |
| Multiple include patterns at once | No — one pattern per run | Yes (repeat -i / multiple find args) |
| Output formats | ZIP only (filtered.zip) | ZIP, TAR.GZ, 7z, and more |
| Install required | None (runs in browser) | Yes (binary on PATH) |
| Upload to a server | Never (in-tab via fflate) | Never (local) |
| Scales to multi-GB | Capped at 2 GB (top tier) | Yes (streams to disk) |
| Pre-download match count | Yes (Matched / Total considered) | Via dry-run / find | wc -l |
Pattern translation cheat-sheet
Convert common CLI include patterns to the Selective Zipper's globPattern. Strip the flag and quotes; keep the bare glob. Remember a single * never crosses /.
| CLI invocation | Selective Zipper globPattern | Notes |
|---|---|---|
zip -r out.zip . -i '*.svg' | *.svg | Basename fallback catches SVGs at any depth |
zip -r out.zip . -i 'src/**/*.ts' | src/**/*.ts | Prefix must match the dropped folder's relative root |
tar czf out.tgz src then filter | src/** | Output is ZIP, not tgz — convert after if needed |
7z a out.zip -i!docs\*.md | docs/*.md | Use forward slashes; * stays within docs/ |
zip ... -i '*.{js,css}' | two runs: **/*.js, **/*.css | No brace expansion — merge results with archive-merger |
zip ... -x '*.test.ts' | not supported | Exclude via folder-to-zip + selective-extractor inverse |
Cookbook
Side-by-side: the same task done with a CLI one-liner and with the Selective Zipper, so you can see exactly what transfers and what does not.
Ship all SVGs — CLI vs browser
The simplest case transfers cleanly. The CLI's -i '*.svg' becomes globPattern: *.svg. Both produce a ZIP of every SVG.
CLI: zip -r icons.zip icons -i '*.svg' Selective Zipper: Drop: icons/ globPattern: *.svg Download: filtered.zip Same contents; browser path needs no zip binary.
Two extensions — where the CLI wins
Brace expansion is a shell/CLI feature. The Selective Zipper has no braces, so the equivalent is two runs plus a merge.
CLI (one command): zip -r web.zip src -i '*.js' -i '*.css' Selective Zipper (two runs + merge): Run 1: globPattern **/*.js → js.zip Run 2: globPattern **/*.css → css.zip archive-merger: js.zip + css.zip → web.zip
Exclude test files — inverse workflow
There is no -x exclude in the browser tool. Replicate it by zipping everything, then extracting a keep-pattern.
CLI:
zip -r src.zip src -x '*.test.ts'
Selective Zipper inverse:
1. folder-to-zip → all.zip (whole src)
2. selective-extractor on all.zip
keep glob: src/**/*.ts (then drop tests manually)
-- or just curate the dropped folder first.Need a tar.gz — convert after
The Selective Zipper only writes ZIP. If your pipeline expects .tar.gz, build the ZIP first, then convert with a sibling tool.
Goal: src/**/*.ts as tar.gz 1. Selective Zipper: src/**/*.ts → filtered.zip 2. zip-to-tar-gz: filtered.zip → filtered.tar.gz CLI equivalent: tar czf out.tgz $(find src -name '*.ts')
Reproducible artifact parity
CLI builds can be made reproducible with --mtime and sorted input. The browser tool reaches parity by chaining normalisation tools after the zip.
CLI:
find src -name '*.ts' | sort | \
zip -X out.zip -@ ; touch -d @0 ...
Selective Zipper chain:
selective-zipper (src/**/*.ts)
-> timestamp-normalizer (fixed mtime)
-> checksum-generator (SHA-256 manifest)Edge cases and what actually happens
CLI brace `*.{ts,tsx}` has no direct equivalent
By designBrace expansion is a shell/CLI capability. The Selective Zipper compiles braces as literal characters, so *.{ts,tsx} matches nothing. Use two runs (**/*.ts, **/*.tsx) and merge, or widen to a directory glob.
CLI exclude `-x` / `--exclude` not supported
By designOnly one positive pattern is applied. Replicate excludes with the inverse workflow: folder-to-zip then selective-extractor with a keep-pattern.
CLI can emit tar.gz / 7z directly; browser cannot
ExpectedThe Selective Zipper writes ZIP only (filtered.zip via fflate). For other formats, post-convert with archive-format-converter, zip-to-tar-gz, or zip-to-7z (verify the latter's real output before relying on true 7z).
Multi-gigabyte trees
Tier limitCLI tools stream to disk and handle terabytes. The Selective Zipper holds matched files in browser memory and is capped at 2 GB even on the top tier (Free is 50 MB). For very large trees, the CLI wins.
`*` crosses directories in some shells but not here
ExpectedWith globstar enabled, some shells let * behave loosely. The Selective Zipper compiles * strictly to [^/]* (no /). Always use ** to cross directories.
Quoting differences
PreservedOn the CLI you must quote globs to stop the shell expanding them. In the browser there is no shell — paste the bare glob (src/**/*.ts) with no quotes. Stray quotes become literal characters and break the match.
Reproducible builds
SupportedCLI builds need --mtime, -X, and sorted input for determinism. The Selective Zipper reaches parity by chaining timestamp-normalizer after the zip; fflate output is otherwise deterministic for the same input order.
Locked-down machine, no binaries allowed
SupportedWhere you cannot install zip/7-Zip and cannot run unsigned binaries, the browser tool is the practical win — it needs only a browser tab and processes locally with no upload.
Frequently asked questions
Is the Selective Zipper as powerful as `zip -i`?
For a single positive pattern, yes — same outcome, no install. For richer needs (brace expansion, multiple includes, -x excludes, non-ZIP output), the CLI is more capable. The Selective Zipper trades glob power for zero-install, glance-able, in-browser convenience.
Does it support brace expansion like the shell?
No. *.{ts,tsx} is matched literally and finds nothing. Run two passes and combine with archive-merger, or use a directory glob like src/**.
Can I exclude files like `zip -x`?
Not directly — only one positive glob is applied. Replicate excludes by zipping everything with folder-to-zip, then extracting a keep-pattern with selective-extractor.
Can it output tar.gz or 7z like tar/7-Zip?
No — it outputs ZIP only. Convert afterward with zip-to-tar-gz, archive-format-converter, or zip-to-7z.
Is the browser tool slower than the CLI?
For small-to-medium folders, fflate is fast and the difference is negligible — and you save the install/scripting time. The CLI pulls ahead on multi-gigabyte inputs where it streams to disk and the browser hits memory and tier limits.
Is it as private as running zip locally?
Yes. Files are read with the File API and zipped in-tab by fflate; nothing is uploaded. There is no binary to vet, and the page works offline once loaded.
How do I translate my `zip` command?
Drop the -i/-i! flag and the quotes, and paste the bare glob into globPattern. zip -i 'src/**/*.ts' → src/**/*.ts. Use ** (not *) to cross directories.
Will the output extract identically to a CLI ZIP?
Yes — filtered.zip is a standard DEFLATE ZIP. unzip, Explorer, Finder, and ZIP libraries read it identically. Relative paths from the dropped folder are preserved, mirroring zip -r from that root.
What's the size ceiling versus the CLI?
Selective Zipper: Free 50 MB / 500 entries, Pro 500 MB / 50,000, Pro-media and Developer 2 GB / 500,000. The CLI has no such ceiling — it streams to disk. Choose the CLI for very large trees.
Can I script the Selective Zipper like a CLI?
Partly. GET /api/v1/tools/selective-zipper returns the schema, but direct server execution is unavailable (apiAvailable: false). Automation runs through the paired @jadapps/runner, which drives the browser tool locally — files never reach JAD servers. For true shell scripting, the CLI is the better fit.
Why use the browser tool at all then?
No install, nothing to configure, instant visual match count, and it works on locked-down machines where you cannot add zip/7-Zip to PATH. For a quick one-off subset ZIP, it is faster end-to-end than writing and debugging a CLI invocation.
Does it preserve file timestamps like `zip` does by default?
No — this build path writes default entry timestamps rather than original mtimes. If you need original or fixed timestamps (as zip preserves or tar --mtime sets), post-process with timestamp-normalizer.
Privacy first
Every JAD Archive tool runs entirely in your browser using fflate, @zip.js/zip.js, and the libarchive WASM bridge. Your archives never leave your device — verified by zero outbound network requests during processing.