Closed timotheecour closed 2 years ago
Any chance a JSON output option could be considered? I received a request to add a crome-cli
parser to jc
to convert the output to JSON, but it would be nice if this was done natively.
I just released 1.8.0 (available via brew) which has support for json output.
It can be enabled with the OUTPUT_FORMAT
env variable (this was the easiest way to implement it – I really should port chrome-cli to Swift one day...).
Usage example:
OUTPUT_FORMAT="json" brave-cli info
{
"id" : 2785,
"loading" : false,
"title" : "feature: every command should support `--json` for json output, for reliable scripting · Issue #55 · prasmussen/chrome-cli",
"url" : "https://github.com/prasmussen/chrome-cli/issues/55",
"windowId" : 26
}
eg:
chrome-cli --json info
should dump as jsonchrome-cli --json open http://www.google.com
same thingthis makes for reliable scripting (analog to git's porcelain vs plumbing mode) that won't break in case output adds new fields etc