typst-gather
Gather Typst packages locally for offline/hermetic builds.
Install
Usage
Then set TYPST_PACKAGE_CACHE_PATH to the destination directory when running Typst.
TOML format
destination- Required. Directory where packages will be gathered.discover- Optional. Paths to scan for imports. Can be:A single string path
An array of paths
Each path can be a
.typfile or a directory (scans.typfiles non-recursively)
[preview]packages are downloaded from Typst Universe (cached - skipped if already present)[local]packages are copied from the specified directory (always fresh - version read fromtypst.toml)
Features
Recursively resolves
@previewdependencies from#importstatementsUses Typst's own parser for reliable import detection
Discover mode scans .typ files for imports
Local packages always overwrite (clean slate)
Preview packages skip if already cached
Quarto Integration
When used with Quarto extensions, you can run:
This will auto-detect .typ files from _extension.yml (template and template-partials) and gather their dependencies.