Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for --jq or --format=jsonpath='$.store.id' #395

Open
jcchavezs opened this issue Sep 10, 2024 · 0 comments
Open

Add support for --jq or --format=jsonpath='$.store.id' #395

jcchavezs opened this issue Sep 10, 2024 · 0 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@jcchavezs
Copy link

CLI can output result in JSON format but it does not provide means to transform the output which is handy in more standardized environments like Kubernetes. For example in the readme of the CLI the suggestion to obtain the store ID is

export FGA_STORE_ID=$(fga store create --model model.fga | jq -r .store.id)

which is fine when you are in local but it imposes difficulties in container environments because e.g. the container that includes cli does not include JQ so doing this transformation would require either 2 init containers or create an image that has both cli and jq.

This is not a new issue, that is why tools like kubectl or gh include output transformations support.

For example:

  • kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{end}"
  • gh pr list --json author --jq '.[].author.login'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
Status: Backlog
Development

No branches or pull requests

3 participants