You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1ddf04e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: crates/socket-patch-cli/CLI_CONTRACT.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,11 +64,11 @@ uppercase letter settles on its exact-case package among case-distinct ones
64
64
65
65
`get <name>` searches every installed version of the matched name (within
66
66
`--ecosystems`) and prints `Matched: …` on stderr. With no exact match in a
67
-
nonempty inventory it is `no_match` (exit 0, no patch-search API call) and, in
67
+
nonempty inventory it is `noMatch` (exit 0, no patch-search API call) and, in
68
68
human mode, suggests up to five near names (`Did you mean: …?`) without acting on
69
-
them. An empty inventory is `no_packages` (exit 0). `--ecosystems` also filters
69
+
them. An empty inventory is `noPackages` (exit 0). `--ecosystems` also filters
70
70
advisory/purl search results and UUID selection before any patch is written; a
71
-
UUID outside the selected ecosystems is `not_found` (exit 0).
71
+
UUID outside the selected ecosystems is `notFound` (exit 0).
72
72
73
73
`remove` / `rollback` accept the same names and versionless purls against manifest
74
74
records, vendor-ledger entries and hosted pins; CVE/GHSA ids match no record
@@ -1248,7 +1248,11 @@ The v3.0 legacy names `SOCKET_PATCH_PROXY_URL`, `SOCKET_PATCH_DEBUG` and `SOCKET
1248
1248
1249
1249
## JSON output shapes
1250
1250
1251
-
Every `--json` invocation emits a single JSON object that follows the **unified envelope** below. The envelope was introduced in v3.0; older per-command shapes are deprecated. See `src/json_envelope.rs` for the source of truth; its unit tests pin the serialized names, and each command's e2e tests assert the envelope it emits. The `tests/cli_parse_*.rs` files pin the parsed clap arguments, not this shape (a few, such as `cli_parse_list.rs`, also spot-check `list`'s envelope).
1251
+
Every command's `--json` output is a single object using the envelope below.
1252
+
v5 removes the older per-command shapes. Argument-parsing errors and invalid
1253
+
`--cwd`, `--global-prefix`, or `--manifest-path` values still exit 2 with stderr
1254
+
output and no JSON. `src/json_envelope.rs` defines the serialized names; each
1255
+
command's integration tests check its output.
1252
1256
1253
1257
**One error shape (v5.0, MAJOR).** On every command, every `--json` failure is a full envelope (`command`, `status: "error"`, `dryRun`, `events`, `summary`) whose top-level `error` is a `{code, message}` object — the envelope's `EnvelopeError`. `code` is a stable snake_case tag (see [Top-level `EnvelopeError` codes](#top-level-envelopeerror-codes)); `message` is for humans. No command prints a top-level `errorCode` any more (it moved into `error.code`). Per-event keys are unchanged: `events[*].error` / `events[*].errorCode` stay strings.
0 commit comments