socket-patch remove

Roll back and forget the patches for one package or patch UUID

socket-patch remove restores one package to its upstream release and removes its patches from the project. It is rollback for a single target.

  • Identifier. Pass a patch UUID, a package URL or an exact package name. A name or a versionless package URL selects every patched version of the package.
  • --preserve-state restores the dependency but keeps the vendored package or agent record for later reuse.
  • --skip-rollback removes the record without restoring the installed files. It can't be combined with --preserve-state.
  • CVE and GHSA IDs don't select patches here.
socket-patch remove pkg:npm/[email protected]       # one exact version
socket-patch remove minimist                     # every patched version of the package
socket-patch remove your-patch-uuid              # one patch
socket-patch remove minimist --dry-run           # preview

socket-patch remove -h

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

$ socket-patch remove -h

Restore and remove patches matching a package, PURL, or UUID

Usage: socket-patch remove [OPTIONS] <IDENTIFIER>

Arguments:
  <IDENTIFIER>  Patch UUID, package PURL (`pkg:npm/[email protected]`, or versionless for every
                version), or exact package name (`lodash`)

Options:
      --skip-rollback   Skip rolling back files before removing (only update the manifest) [env:
                        SOCKET_SKIP_ROLLBACK=]
      --preserve-state  Restore the system (files and lockfiles) but PRESERVE the local patch state
                        for a later re-apply: the manifest entry is kept, vendored artifacts and
                        their ledger entries are kept (only the lockfile wiring is reverted), and no
                        blob/archive cleanup runs — the single-patch twin of `rollback
                        --preserve-state`. Conflicts with `--skip-rollback` (keeping the tree AND
                        the state would be a no-op) [env: SOCKET_PRESERVE_STATE=]
  -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=]
  -y, --yes                      Skip interactive prompts [env: SOCKET_YES=]

Did this page help you?