Skip to content

feat: add --sort time option to sort repos by starred_at#139

Open
Yzeph wants to merge 1 commit into
maguowei:mainfrom
Yzeph:feat/sort-by-star-time
Open

feat: add --sort time option to sort repos by starred_at#139
Yzeph wants to merge 1 commit into
maguowei:mainfrom
Yzeph:feat/sort-by-star-time

Conversation

@Yzeph

@Yzeph Yzeph commented Jun 17, 2026

Copy link
Copy Markdown

Summary

  • Extend --sort from a boolean flag to accept --sort alphabetical (existing behavior) or --sort time (new)
  • Add --sort time to sort repositories within each category by star time (newest first)
  • Fetch starredAt timestamp from GitHub GraphQL API via edges (was previously not collected)

Breaking change

--sort is no longer a boolean flag. Existing usage --sort must be changed to --sort alphabetical.

Test plan

  • Run starred --username <user> --token <token> --sort time and verify repos within each category are ordered newest-first
  • Run starred --username <user> --token <token> --sort alphabetical and verify categories are sorted alphabetically (existing behavior unchanged)

Changes:
- Modify GraphQL query to fetch starredAt via edges
- Store starred_at in Repository model
- Extend --sort from boolean flag to Choice(alphabetical|time)
- Sort repos within each category by star time when --sort time is used
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