cli icon indicating copy to clipboard operation
cli copied to clipboard

RFE: add machine readable output to the CLI

Open delabassee opened this issue 7 years ago • 5 comments
trafficstars

As a user (Dev and/or Ops), I want to easily script and automate Fn without necessarily having to rely on an API.

A new flag could make the CLI to generate a machine readable output (JSON comes to mind) instead of the regular human friendly (and colourful) output.

A good existing example is fn inspect app myappas it spits out a json document.

delabassee avatar Oct 18 '18 08:10 delabassee

Are there specific commands that you would most want this for, e.g. lists, or were you wanting it universally throughout the CLI?

harryjsmith avatar Oct 19 '18 09:10 harryjsmith

It depends on the cost of making this a global option. If it's too costly, list would be a needed one. I have to think for others, maybe get?

delabassee avatar Oct 25 '18 15:10 delabassee

For get, does the current ‘inspect’ and ‘inspect ’ fit ?

zootalures avatar Oct 25 '18 15:10 zootalures

'inspect' and 'inspect '?? Not sure about get calls and get logs, might maybe be useful too?!

delabassee avatar Oct 25 '18 16:10 delabassee

While chatting with @shaunsmith, I discovered that this might already be available! https://github.com/fnproject/cli/search?q=%22Output+format+%28json%29%22&unscoped_q=%22Output+format+%28json%29%22 I'll check to see if there's any gap before closing.

delabassee avatar Oct 26 '18 04:10 delabassee