Describe the feature or problem you’d like to solve
I'd like commands such as gh pr list to be able to give me both JSON output and to be able to apply a template.
The comment at #3012 (comment) notes as an aside:
Since filter and template are mutually exclusive ...
I'm using gh pr list in a (Bash) script that both generates pretty output for the user, and also does some other processing of the PRs.
I'd like to avoid having to run gh pr list twice.
What doesn't really work for me: add {{ . }} in the template. This gives me output in Go syntax, which I can't otherwise use.
Proposed solution
I have no particular preference for a solution. Obvious thought: add an option to output the JSON to a file.
Or, a completely different approach: add a new command that takes JSON input (from stdin and/or a file) and applies a template.
Describe the feature or problem you’d like to solve
I'd like commands such as
gh pr listto be able to give me both JSON output and to be able to apply a template.The comment at #3012 (comment) notes as an aside:
I'm using
gh pr listin a (Bash) script that both generates pretty output for the user, and also does some other processing of the PRs.I'd like to avoid having to run
gh pr listtwice.What doesn't really work for me: add
{{ . }}in the template. This gives me output in Go syntax, which I can't otherwise use.Proposed solution
I have no particular preference for a solution. Obvious thought: add an option to output the JSON to a file.
Or, a completely different approach: add a new command that takes JSON input (from stdin and/or a file) and applies a template.