Created
December 1, 2024 14:35
-
-
Save veggiemonk/80c194e6fee07a425f364f9f38a912b8 to your computer and use it in GitHub Desktop.
Github Star management
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
## doc: https://cli.github.com/manual/gh_api | |
GH_USER="$USER" #TODO: CHANGE ME | |
function gh_star_download() { | |
set -x | |
gh api "users/$GH_USER/starred" --paginate --jq '.[] | { "name": .full_name, "desc": .description }' | \ | |
tee -a starred.jsonl | |
} | |
function gh_unstar_all() { | |
set -x | |
# check `xargs -P 4` for parallel mode | |
gh api "users/$GH_USER/starred" --paginate --jq '.[].full_name' | \ | |
xargs -I {} gh api -X DELETE "user/starred/{}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment