sentry-cli icon indicating copy to clipboard operation
sentry-cli copied to clipboard

Structured output feature

Open seanhoughtonatvi opened this issue 1 year ago • 4 comments

The output of the CLI is in human-readable tabular format. I looked through the code and the docs and it appears that there is no way to get csv, json, yaml, or any other structured output. This makes using the CLI as part of a script much more challenging.

I would like to be able to provide an --output-format=json argument and get tabular data formatted as a json list of objects.

seanhoughtonatvi avatar Aug 25 '24 23:08 seanhoughtonatvi

Hi @seanhoughtonatvi, thank you for the suggestion. For which specific command(s) are you requesting this feature?

szokeasaurusrex avatar Aug 26 '24 07:08 szokeasaurusrex

I was looking in to using sentry-cli to create a weekly summary report that includes a list of unresolved issues rather than numerical totals like the built-in summary. This would use sentry-cli issues list --project xxxx.

Any command that uses https://github.com/getsentry/sentry-cli/blob/master/src/utils/formatting.rs#L27 would probably benefit from structured output so it can be piped into tools like jq.

I've since realized that there's no command to actually retrieve information about a specific issue (!) - so it looks like this tool isn't really intended as a general-purpose CRUD interface to Sentry. I'm going to change my approach and generate an SDK with swagger-codegen and write an application that uses the REST interface rather than a script. The CLI would have made a prototype easier.

seanhoughtonatvi avatar Aug 26 '24 15:08 seanhoughtonatvi

Ah understood. Yeah, the sentry-cli only performs a subset of the actions available from the Sentry web API.

If the structured output feature cannot help you anyways with what you are trying to accomplish, I will just leave the issue open on our backlog with low priority. If more folks request this feature, we can increase the priority.

If having the ability to query information about a single issue in the CLI would be helpful for you, you can feel free to open another feature request

szokeasaurusrex avatar Aug 27 '24 14:08 szokeasaurusrex

Structured output would also be helpful for the JavaScript bundler plugins – specifically, we would output to JSON

szokeasaurusrex avatar Oct 09 '24 12:10 szokeasaurusrex

Duplicate of #1416

szokeasaurusrex avatar Dec 10 '24 11:12 szokeasaurusrex