Skip to content

Instantly share code, notes, and snippets.

Last active Sep 30, 2020
What would you like to do?
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/^/- [ ] /" >
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)\")|.[]"
Copy link

matthewmccullough commented Sep 28, 2020

  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