socket-patch repair

Restore vendored packages or agent patch data that are missing or damaged

socket-patch repair puts back patch files that are missing or damaged, and removes ones nothing uses any more. It works from the records the project already has.

  • Hosted mode has nothing to repair: the patched packages are not stored in the project.
  • Vendored mode. It downloads a missing or corrupt package again and checks it against the ledger before replacing it. It can't rebuild a lost ledger: restore .socket/vendor/state.json from version control.
  • Agent mode. It downloads missing patch data into .socket/blobs/.
  • --download-only downloads what is missing and skips the cleanup.
  • --offline runs the cleanup only.
  • It never changes which patches the project uses. To add or update patches, use socket-patch scan.
socket-patch repair --dry-run     # preview
socket-patch repair
socket-patch repair --download-only

socket-patch repair -h

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

$ socket-patch repair -h

Restore agent or vendored patch artifacts and clean up unused ones

Usage: socket-patch repair [OPTIONS]

Options:
      --download-only  Only download missing artifacts; skip the cleanup phase. Incompatible with
                       `--offline` [env: SOCKET_DOWNLOAD_ONLY=]
  -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?