What's your favorite alias you've made? #2618
Replies: 6 comments 4 replies
-
This one that I've made in response to a user question clones a repository into a predefined directory structure. gh alias set c '!gh repo view "$1" | awk "/^name:/{print \$2}" | xargs -I% gh repo clone "%" ~/src/%' Usage: gh c playground
#=> gh repo clone mislav/playground ~/src/mislav/playground |
Beta Was this translation helpful? Give feedback.
-
I used
|
Beta Was this translation helpful? Give feedback.
-
my favorite alias is actually a git cl gko/repo or git cl repo while keeping the default behaviour of |
Beta Was this translation helpful? Give feedback.
-
I have some very simple ones I use for issue triaging that have become indispensible for me: il: issue list
isearch: !gh issue list -L300 | ag $1 | cut -f1,3
iv: issue view
label: !jq -n "{\"labels\":[\"$2\"]}" | ghd api "repos/:owner/:repo/issues/$1/labels" --input -
triage: !gh api graphql --paginate -Fquery='query($endCursor:String){repository(owner:"cli",name:"cli"){issues(first:100,states:OPEN,after:$endCursor){pageInfo{hasNextPage endCursor}edges{node{number title labels(first:10){totalCount edges{node{name}}}}}}}}' | jq -r '.data.repository.issues.edges|map(.node)|map(select(any(.labels.edges[]; .node.name | test("p1|p2|p3|core|docs|help wanted|tracking issue|needs-design|blocked|needs-user-input")) | not))|map("\(.number)\t\(.title)")|.[]' The triaging one is long but not too complicated; it's using my flow for triaging is: $ gh triage # see what's come in
$ gh iv 123 # read a new issue, noting any comments
$ gh isearch # look for duplicates
$ gh label 123 core # mark as triaged with some label |
Beta Was this translation helpful? Give feedback.
-
(Not the most productive alias) $ gh alias set zen 'api zen'
$ gh zen |
Beta Was this translation helpful? Give feedback.
-
Don't know how useful it is but im using this one to see the latest output from a workflow run:
Which gives you something like this:
|
Beta Was this translation helpful? Give feedback.
-
GitHub CLI has two powerful commands:
gh alias
andgh api
. We'd love to see your favorite ways you've used them so far!Beta Was this translation helpful? Give feedback.
All reactions