apm unpack
Synopsis
Section titled “Synopsis”apm unpack BUNDLE_PATH [OPTIONS]Description
Section titled “Description”apm unpack extracts an APM bundle (a .tar.gz archive or an already-unpacked bundle directory) into a target project. It runs the built-in security scan against the bundle contents before writing any files, and — unless --skip-verify is set — checks that every entry in the bundle’s apm.lock.yaml deployed_files list is actually present in the archive.
Extraction is additive-only: only files listed in the bundle’s lockfile are written. Existing project files at colliding paths are overwritten by the bundle version. Files outside the bundle’s manifest are never touched, and the bundle’s apm.lock.yaml is treated as metadata — it is not copied into the output directory.
BUNDLE_PATH accepts either a .tar.gz archive produced by apm pack or the directory form of an unpacked bundle.
Options
Section titled “Options”| Flag | Default | Description |
|---|---|---|
-o, --output PATH | . | Target project directory. Created if it does not exist. |
--skip-verify | off | Skip the bundle completeness check against the bundle’s apm.lock.yaml. Useful for partial bundles. |
--dry-run | off | List files that would be unpacked without writing anything. |
--force | off | Deploy despite critical hidden-character findings from the security scan. Use only after independent verification. |
--verbose, -v | off | Show per-file paths and full diagnostic context. |
Examples
Section titled “Examples”Unpack an archive into the current directory:
apm unpack ./build/my-pkg-1.0.0.tar.gzUnpack into a specific project directory:
apm unpack bundle.tar.gz --output /path/to/projectPreview the extraction plan without writing files:
apm unpack bundle.tar.gz --dry-runSkip verification when working with a partial bundle:
apm unpack bundle.tar.gz --skip-verifyOverride a critical hidden-character finding after manual review:
apm unpack bundle.tar.gz --forceBehavior
Section titled “Behavior”- Bundle formats.
apm installdeploys only plugin-format bundles. Legacy--format apmtarballs (whole-project bundles produced by olderapm packinvocations) are deployed viaapm unpackand have no equivalentinstallpath. - Additive writes only. Files not listed in the bundle’s lockfile are left alone; the bundle never deletes project files.
- Overwrite on collision. When a bundle file shares a path with a local file, the bundle file wins.
- Security scan. Bundle contents are scanned before deployment. Critical hidden-character findings block extraction unless
--forceis passed (exit code1). Non-critical warnings are surfaced with a hint to runapm audit. - Verification. By default, every entry in the bundle’s
deployed_filesmust exist inside the archive.--skip-verifydisables this check; missing files are then reported as skipped. - Target mismatch warning. If the bundle was packed for a different harness target than the output project’s detected target,
apm unpackwarns and — with--verbose— suggests theapm pack --targetcommand the publisher should run. - Lockfile is metadata. The bundle’s
apm.lock.yamlis read for verification and target metadata but is never written to the output directory. - Exit codes.
0on success (including--dry-run);1on missing bundle, invalid bundle, or critical security findings without--force.
Related
Section titled “Related”apm pack— produce the bundles thatapm unpackextracts.apm install— the preferred deploy path for plugin-format bundles.apm audit— inspect hidden-character findings flagged during extraction.- Pack a bundle — producer guide covering bundle formats and distribution.