Skip to content

Add --format flag for JSON and CSV output#59

Open
AshayK003 wants to merge 2 commits into
yankeexe:masterfrom
AshayK003:feat/json-csv-output-format
Open

Add --format flag for JSON and CSV output#59
AshayK003 wants to merge 2 commits into
yankeexe:masterfrom
AshayK003:feat/json-csv-output-format

Conversation

@AshayK003

@AshayK003 AshayK003 commented Jul 6, 2026

Copy link
Copy Markdown
screenshot ## Description

New --format / -f flag for the search command, supporting three output formats:

Format Behavior
table Existing fancy_grid tabulate output (default)
json Pretty-printed array of {title, url} — pipe into jq or other tools
csv Standard CSV with Title,Issue URL headers — open in spreadsheets

All formats print the remaining rate limit and "Happy Hacking" footer afterward.

Example

Testing

pytest tests/ — 19 passed
ruff check . — clean

Introduce --format / -f option to the search command supporting
table (default), json, and csv formats.

- JSON: pretty-printed array of {title, url} objects — pipe into jq
- CSV: standard CSV with Title and Issue URL headers — pipe into
  spreadsheet tools
- Table: existing fancy_grid output (unchanged)
@AshayK003

Copy link
Copy Markdown
Author

@maintainers Bumping this one \u2014 adds a --format flag for JSON/CSV output to the CLI. Useful for scripting and automation. Happy to make changes if needed.

@yankeexe

Copy link
Copy Markdown
Owner

@AshayK003 Can you please add a screenshot of this working?

@AshayK003

Copy link
Copy Markdown
Author

All three output formats working with --format / -f:

gfi format demo

Search: gfi search "AshayK003" --user --limit 3

Format Command Output
table (default) (no flag) Existing fancy_grid tabulate — unchanged
json --format json / -f json Pretty-printed [{title, url}] — pipeable into jq
csv --format csv / -f csv Standard CSV with Title,Issue URL headers

Rate-limit footer and "Happy Hacking" message print consistently across all three formats.

@yankeexe

Copy link
Copy Markdown
Owner

@AshayK003 please add the screenshot on the Pull Request description, not as a part of the change.

@AshayK003

Copy link
Copy Markdown
Author

@AshayK003 please add the screenshot on the Pull Request description, not as a part of the change.
Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants