Skip to content

Support --json in openshell policy get #1034

@jacobtomlinson

Description

@jacobtomlinson

Problem Statement

I want to be able to check for specific values in my policy easily. If I run openshell policy get <sandbox> --full I can get a YAML dump of the policy, but it would be more convenient to dump it in JSON so that I can use jq to filter and transform the output.

Proposed Design

Add an additional flag to select json output. Either --json to be consistent with other commands, or --output/-o json to be consistent with other tools like kubectl.

Alternatives Considered

I could use yq to filter the YAML, but it's not installed by default on many systems and would increase the complexity of instructions if users need to install it. jq is a much more standard tool.

Agent Investigation

No response

Checklist

  • I've reviewed existing issues and the architecture docs
  • This is a design proposal, not a "please build this" request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions