Skip to content

Instantly share code, notes, and snippets.

@veggiemonk
Created December 1, 2024 14:35
Show Gist options
  • Save veggiemonk/80c194e6fee07a425f364f9f38a912b8 to your computer and use it in GitHub Desktop.
Save veggiemonk/80c194e6fee07a425f364f9f38a912b8 to your computer and use it in GitHub Desktop.
Github Star management
## 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