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
Structured success output is rolling out command by command. Currently migrated commands are `account`, `du`, `ls`, `search`, `revs`, `cp`, `mv`, `put`, `get`, `share-link create`, `share-link list`, `share-link info`, `share-link update`, `share-link revoke`, `share-link download`, `mkdir`, `rm`, and `restore`. Commands that have not been migrated return a JSON error whose `error.message` is `structured output is not supported for this command yet` when used with `--output=json`.
163
+
Structured success output is rolling out command by command. Currently migrated commands are `version`, `account`, `du`, `ls`, `search`, `revs`, `cp`, `mv`, `put`, `get`, `share-link create`, `share-link list`, `share-link info`, `share-link update`, `share-link revoke`, `share-link download`, `share list folder`, `mkdir`, `rm`, and `restore`. Commands that have not been migrated return a JSON error whose `error.message` is `structured output is not supported for this command yet` when used with `--output=json`.
162
164
163
165
Command results and JSON errors are written to stdout. Status, progress, human-facing warnings, diagnostics, and verbose logs are written to stderr. JSON errors include a `warnings` array for machine-actionable warnings; it is `[]` when no warnings are present. Successful JSON payloads use the same `warnings` field.
164
166
@@ -308,7 +310,25 @@ Entry-list commands such as `ls`, `search`, and `revs` use the operation-style w
308
310
}
309
311
```
310
312
311
-
Account and usage commands use the operation-style wrapper with a single result:
313
+
Version, account, and usage commands use the operation-style wrapper with a single result:
314
+
315
+
```json
316
+
{
317
+
"input": {},
318
+
"results": [
319
+
{
320
+
"kind": "version",
321
+
"input": {},
322
+
"result": {
323
+
"version": "3.4.0",
324
+
"sdk_version": "6.0.5",
325
+
"spec_version": "c36ba27"
326
+
}
327
+
}
328
+
],
329
+
"warnings": []
330
+
}
331
+
```
312
332
313
333
```json
314
334
{
@@ -377,6 +397,31 @@ Shared-link commands use the same operation-style wrapper. `share-link create`,
377
397
378
398
`share-link revoke` uses `revoked` results whose `result` contains the revoked URL and, when available, the shared-link metadata. `share-link download` uses `downloaded` results whose `result` contains the local `target` and `link` metadata.
379
399
400
+
The legacy `share list folder` command also supports operation-style JSON. It uses `listed` results with `shared_folder` metadata:
`get --output=json <source> -` and `share-link download --output=json <url> -` are not supported because stdout is reserved for downloaded file bytes when the target is `-`.
381
426
382
427
In JSON mode, command errors are written to stdout as JSON, including errors from commands that do not yet support structured success output. The process still exits with a non-zero status. Detailed diagnostics may also be written to stderr:
0 commit comments