socket-patch vendor

Move hosted patches into .socket/vendor/

socket-patch vendor turns a project's hosted patches into vendored ones. It reads the patch links in the lockfiles, downloads each patched package, stores it under .socket/vendor/, and repoints the lockfile at the copy in your repository.

  • What to commit. .socket/vendor/, including its ledger state.json, and every dependency file the command reports. After that, installs need nothing from Socket.
  • Only patched packages are vendored. Your other dependencies still come from their usual registry, mirror or cache.
  • To find and vendor patches in one run, use socket-patch scan --mode vendored.
  • --check verifies the committed packages and their wiring without changing anything and without network access. Run it in CI.
  • --revert undoes vendoring and removes .socket/vendor/.
  • Downloading a package needs network access to patch.socket.dev. Packages already committed keep working offline.
socket-patch vendor --dry-run     # preview
socket-patch vendor               # vendor every hosted patch
socket-patch vendor --check       # audit the committed packages offline
socket-patch vendor --revert      # go back to the upstream releases

The result looks like this for an npm project:

.socket/vendor/
├── state.json                         # ledger
└── npm/
    └── <patch uuid>/
        ├── minimist-1.2.2.tgz         # patched package
        └── socket-patch.vendor.json   # record for this patch

socket-patch vendor -h

-h prints the common options shown here. socket-patch vendor --help prints every option.

$ socket-patch vendor -h

Download hosted patches from lockfiles into .socket/vendor/

Usage: socket-patch vendor [OPTIONS]

Options:
  -f, --force      Bypass the installed-variant probe for multi-release ecosystems (vendor every
                   recorded release variant, not just the one whose bytes match the installed copy).
                   Vendoring never reads the installed files' content: it commits the patch server's
                   verified artifact, so a missing or locally edited file needs no flag
      --revert     Undo vendoring: restore the recorded original lockfile fragments and remove the
                   `.socket/vendor/` artifacts. Works without a manifest [env:
                   SOCKET_VENDOR_REVERT=]
      --check      Verify committed artifacts and JVM wiring offline without changing files
      --vex <VEX>  Write OpenVEX to this path after a successful run [env: SOCKET_VEX=]
  -h, --help       Print help (see more with '--help')
  -V, --version    Print version

Global options:
      --cwd <CWD>                Working directory [env: SOCKET_CWD=] [default: .]
  -e, --ecosystems <ECOSYSTEMS>  Restrict to these ecosystems (comma-separated): npm, pypi, cargo,
                                 gem, golang, maven, composer, nuget, deno [env: SOCKET_ECOSYSTEMS=]
      --offline                  Disable network access; fail if remote data is needed [env:
                                 SOCKET_OFFLINE=]
  -j, --json                     Emit machine-readable JSON output [env: SOCKET_JSON=]
      --dry-run                  Preview the operation without making any mutations [env:
                                 SOCKET_DRY_RUN=]

Did this page help you?