gh-issues: add --csv - #9
Merged
Merged
Conversation
The table truncates titles at 70 columns and renders timestamps as "3 days ago", which is right for reading and wrong for keeping. --csv writes the same query to ~/gh-issues-YYYY-MM-DD.csv instead: whole titles, ISO 8601 CREATED and UPDATED, and a bare issue number so a spreadsheet reads it as a number. --csv=FILE picks the path. Bare --csv takes no argument, so `--csv --limit 10` cannot swallow the next flag as a filename. The destination directory is checked before any search runs, so a bad path costs no API calls. The two output shapes share their jq helpers rather than duplicating timeago and friends, and both now draw from one search_all_scopes function, so a scope can never be gathered for one form and missed by the other. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGe9mWC6FvUjT6p1HCVjba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The table truncates titles at 70 columns and renders timestamps as "3 days ago" — right for reading, wrong for keeping.
--csvwrites the same query to~/gh-issues-YYYY-MM-DD.csvinstead, and--csv=FILEpicks the path.The CSV is the archival form: whole titles, ISO 8601
CREATEDandUPDATED, and a bare issue number so a spreadsheet reads it as one.Notes:
--csvtakes no argument, so--csv --limit 10cannot swallow the next flag as a filename.gh-issues: no such directory: /nope, exit 2).search_all_scopes, so a scope cannot be gathered for one form and missed by the other.Verified:
bin/scripts-checkgreen, table output unchanged, and the 130-row CSV round-trips through Pythoncsvwith 8 fields on every row (titles containing commas quoted correctly).There is a companion moshcode pit alias on this box,
issues-csv->gh-issues-all --csv, already in~/.moshcode/aliases.json. It only works once~/scriptsis pulled, since~/.local/bin/gh-issuessymlinks into the working tree.🤖 Generated with Claude Code
https://claude.ai/code/session_01XGe9mWC6FvUjT6p1HCVjba