kpt icon indicating copy to clipboard operation
kpt copied to clipboard

Feature request: Ability to format `kpt pkg tree` output as json

Open grmoon opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Inability to output json makes the tree difficult to parse and render using different UI.

Describe the solution you'd like

If kpt pkg tree outputs the following:

Screen Shot 2021-05-25 at 12 22 36 PM

Then kpt pkg tree --format json outputs something like (incomplete, but captures the idea):

Success

{
  "success": true,
  "tree": {
    "name": "PKG",
    "description": "nginx",
    "children": [
      {
        "name": "Kptfile",
        "description": "Kptfile nginx",
        "children": []
      },
      {
        "name": "temp",
        "description": "",
        "children": [
          {
            "name": "deployment.yaml",
            "description": "Deployment my-nginx",
            "children": []
          },
        ]
      },
    ]
  }
}

grmoon avatar May 25 '21 16:05 grmoon

@grmoon when would you like this? Urgency? Deadlines?

mikebz avatar May 28 '21 19:05 mikebz

@grmoon when would you like this? Urgency? Deadlines?

apologies for missing this, this is not an urgent request at all I'm just anticipating that the IDEs will eventually want to be able to display the contents of a kpt package in a nicer way than just CLI output.

grmoon avatar Jun 10 '21 03:06 grmoon