Skip to content

feat(cli): add -o json/yaml output format to sandbox list#1422

Merged
TaylorMutch merged 1 commit into
NVIDIA:mainfrom
benoitf:add-output-sandbox-list
May 18, 2026
Merged

feat(cli): add -o json/yaml output format to sandbox list#1422
TaylorMutch merged 1 commit into
NVIDIA:mainfrom
benoitf:add-output-sandbox-list

Conversation

@benoitf
Copy link
Copy Markdown
Contributor

@benoitf benoitf commented May 18, 2026

Summary

Add -o json and -o yaml output format flags to openshell sandbox list, matching the pattern established for provider profile commands in #1170. This enables machine-readable output for scripting and automation.

Related Issue

fixes #1421

Changes

  • Rename ProviderProfileOutput enum to shared OutputFormat (Table/Yaml/Json), reused by both provider and sandbox commands.
  • Add -o/--output argument to SandboxCommands::List with conflicts_with_all for --ids/--names.
  • Implement JSON and YAML output branches in sandbox_list() via a sandbox_to_json() helper that serializes id, name, labels, created_at, phase, and current_policy_version.
  • Add serde_yml workspace dependency to the CLI crate for YAML serialization.
  • Add 5 CLI parse tests covering default output, -o json, -o yaml, and conflict with --ids/--names.
  • Update docs/sandboxes/manage-sandboxes.mdx with usage examples.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Support machine-readable output for `openshell sandbox list` via
`-o json` and `-o yaml` flags, matching the pattern established for
provider profile commands. Rename ProviderProfileOutput to shared
OutputFormat enum.

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 18, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@TaylorMutch TaylorMutch self-assigned this May 18, 2026
@TaylorMutch TaylorMutch added the test:e2e Requires end-to-end coverage label May 18, 2026
@github-actions
Copy link
Copy Markdown

Label test:e2e applied, but pull-request/1422 is at {"messa while the PR head is 0154f7c. A maintainer needs to comment /ok to test 0154f7c1b578956e328ada8f006f4dd61e43f9a5 to refresh the mirror. Once the mirror catches up, re-run Branch E2E Checks from the Actions tab.

@TaylorMutch
Copy link
Copy Markdown
Collaborator

/ok to test 0154f7c

@TaylorMutch
Copy link
Copy Markdown
Collaborator

/ok to test 0154f7c

Copy link
Copy Markdown
Collaborator

@TaylorMutch TaylorMutch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you!

@TaylorMutch TaylorMutch merged commit 0cbd2d6 into NVIDIA:main May 18, 2026
41 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add -o/--output flag to openshell sandbox list

2 participants