Repository navigation
Commit 98aaf92
committed
feat(cli): add --output json/yaml to sandbox get, status, and sandbox create
Add structured output support to three commands that previously only
supported human-readable table output:
- `sandbox get --output json/yaml`: emits sandbox detail including
policy source, revision, and active policy content via a new
`sandbox_detail_to_json` converter.
- `status --output json/yaml`: emits gateway connection state via a new
`status_to_json` converter with conditional fields (auth, version,
error, http_status) matching the human output.
- `sandbox create --output json/yaml`: emits sandbox metadata after the
sandbox reaches Ready phase, suppressing spinners and ANSI chrome
from stdout. Uploads and port forwarding still execute before output.
Clap rejects `--output` combined with `--editor` or trailing commands.
All three commands reuse the existing `OutputFormat` enum and
`print_output_single` helper. Default output (no --output flag) is
byte-identical to current behavior. Unit tests cover both converters.
Closes NVIDIA#1964
Signed-off-by: Roland Huß <[email protected]>1 parent a5161d0 commit 98aaf92
5 files changed
Lines changed: 370 additions & 67 deletions
File tree
- crates/openshell-cli
- src
- tests
- docs/sandboxes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
537 | 541 | | |
538 | 542 | | |
539 | 543 | | |
| |||
1336 | 1340 | | |
1337 | 1341 | | |
1338 | 1342 | | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
1339 | 1347 | | |
1340 | 1348 | | |
1341 | 1349 | | |
| |||
1349 | 1357 | | |
1350 | 1358 | | |
1351 | 1359 | | |
1352 | | - | |
| 1360 | + | |
1353 | 1361 | | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
1354 | 1366 | | |
1355 | 1367 | | |
1356 | 1368 | | |
| |||
2083 | 2095 | | |
2084 | 2096 | | |
2085 | 2097 | | |
2086 | | - | |
| 2098 | + | |
2087 | 2099 | | |
2088 | 2100 | | |
2089 | 2101 | | |
2090 | | - | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
2091 | 2109 | | |
2092 | 2110 | | |
2093 | 2111 | | |
| |||
2618 | 2636 | | |
2619 | 2637 | | |
2620 | 2638 | | |
| 2639 | + | |
2621 | 2640 | | |
2622 | 2641 | | |
2623 | 2642 | | |
| |||
2704 | 2723 | | |
2705 | 2724 | | |
2706 | 2725 | | |
| 2726 | + | |
2707 | 2727 | | |
2708 | 2728 | | |
2709 | 2729 | | |
| |||
2777 | 2797 | | |
2778 | 2798 | | |
2779 | 2799 | | |
2780 | | - | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
2781 | 2805 | | |
2782 | | - | |
| 2806 | + | |
| 2807 | + | |
2783 | 2808 | | |
2784 | 2809 | | |
2785 | 2810 | | |
| |||
3463 | 3488 | | |
3464 | 3489 | | |
3465 | 3490 | | |
3466 | | - | |
| 3491 | + | |
3467 | 3492 | | |
3468 | 3493 | | |
3469 | 3494 | | |
| |||
0 commit comments