Skip to content

gh-issues: add --csv - #9

Merged
ralyodio merged 1 commit into
mainfrom
worktree-gh-issues-csv
Aug 29, 2026
Merged

gh-issues: add --csv#9
ralyodio merged 1 commit into
mainfrom
worktree-gh-issues-csv

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The table truncates titles at 70 columns and renders timestamps as "3 days ago" — right for reading, wrong for keeping. --csv writes the same query to ~/gh-issues-YYYY-MM-DD.csv instead, and --csv=FILE picks the path.

The CSV is the archival form: whole titles, ISO 8601 CREATED and UPDATED, and a bare issue number so a spreadsheet reads it as one.

gh-issues-all --csv
gh-issues: wrote 130 issue(s) to /home/anthony/gh-issues-2026-08-29.csv

Notes:

  • Bare --csv takes no argument, so --csv --limit 10 cannot swallow the next flag as a filename.
  • The destination directory is validated before any search runs, so a bad path costs no API calls (gh-issues: no such directory: /nope, exit 2).
  • Both output shapes now share their jq helpers and draw from one search_all_scopes, so a scope cannot be gathered for one form and missed by the other.

Verified: bin/scripts-check green, table output unchanged, and the 130-row CSV round-trips through Python csv with 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 ~/scripts is pulled, since ~/.local/bin/gh-issues symlinks into the working tree.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XGe9mWC6FvUjT6p1HCVjba

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
@ralyodio
ralyodio merged commit 136cbab into main Aug 29, 2026
4 checks passed
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.

1 participant