Skip to content

Instantly share code, notes, and snippets.

@vilmibm
Last active September 30, 2020 15:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vilmibm/a1b9a405ac0d5153c614c9c646e37d13 to your computer and use it in GitHub Desktop.
Save vilmibm/a1b9a405ac0d5153c614c9c646e37d13 to your computer and use it in GitHub Desktop.
These can be copied and pasted into ~/.config/gh/config.yml in the aliases block.
approve: pr review -a
checklist: !gh issue list -l$1 | sed "s/^/- [ ] /" > checklist.md
clone: repo clone
co: pr checkout
cowments: !gh api "repos/:owner/:repo/issues/$1/comments" | jq "map(.body)[]" | while read c; do cowsay $c; done
heart: api -H Accept:application/vnd.github.squirrel-girl-preview+json -XPOST repos/:owner/:repo/issues/$1/reactions --raw-field content=heart
igrep: !gh issue list -l$1 | grep $2
il: issue list
immigrant-justice: gist view eb5f40f9ec892f22064804af90065726
next-slide: !clear; gh gist view a97cadf9722855a36d7e6458ab1e93db -f "slide`cat /tmp/ix`.md"; perl -e "print ((`cat /tmp/ix` + 1) % 5)" > /tmp/ix
prev-slide: !clear; gh gist view a97cadf9722855a36d7e6458ab1e93db -f "slide`cat /tmp/ix`.md"; perl -e "print ((`cat /tmp/ix` - 1) % 5)" > /tmp/ix
reset-slide: !echo 0 > /tmp/ix
top: !ghd api graphql --paginate -F"owner=:owner" -F"name=:repo" -F=query='query($endCursor:String, $name:String!, $owner:String!) { repository(owner: $owner, name:$name) { issues(first:100, after: $endCursor, states:OPEN) { pageInfo { hasNextPage endCursor } edges { node { title number state reactions(first:100){ totalCount }}}}}}' | jq -r ".data.repository.issues.edges|map(.node)|map(select(.reactions.totalCount > 0))|sort_by(.reactions.totalCount)|reverse|map(\"\(.title)\t#\(.number)\t\(.state)\t\(.reactions.totalCount)\")|.[]"
@matthewmccullough
Copy link

  1. Documentation for the GitHub CLI and its alias command
  2. Are these really saved in a file named alias.yml? Setting them with the CLI command puts them in ~/.config/gh/config.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment