Skip to content

Commit 1641fdf

Browse files
committed
feat: add GitHub CLI justfile with common gh
commands
1 parent 67d3f79 commit 1641fdf

2 files changed

Lines changed: 249 additions & 0 deletions

File tree

.just/gh.justfile

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
# GitHub CLI (gh) commands
2+
# https://cli.github.com/manual/
3+
4+
5+
# show repository info
6+
[group: 'gh']
7+
gh-repo-view:
8+
gh repo view
9+
10+
11+
# list pull requests
12+
[group: 'gh']
13+
gh-pr-list limit="10":
14+
gh pr list --limit {{limit}}
15+
16+
17+
# list all pull requests (including closed)
18+
[group: 'gh']
19+
gh-pr-list-all limit="10":
20+
gh pr list --state all --limit {{limit}}
21+
22+
23+
# view specific pull request
24+
[group: 'gh']
25+
gh-pr-view pr_number:
26+
gh pr view {{pr_number}}
27+
28+
29+
# create a new pull request
30+
[group: 'gh']
31+
gh-pr-create:
32+
gh pr create
33+
34+
35+
# checkout a pull request locally
36+
[group: 'gh']
37+
gh-pr-checkout pr_number:
38+
gh pr checkout {{pr_number}}
39+
40+
41+
# list issues
42+
[group: 'gh']
43+
gh-issue-list limit="10":
44+
gh issue list --limit {{limit}}
45+
46+
47+
# view specific issue
48+
[group: 'gh']
49+
gh-issue-view issue_number:
50+
gh issue view {{issue_number}}
51+
52+
53+
# create a new issue
54+
[group: 'gh']
55+
gh-issue-create:
56+
gh issue create
57+
58+
59+
# list workflow runs
60+
[group: 'gh']
61+
gh-run-list limit="10":
62+
gh run list --limit {{limit}}
63+
64+
65+
# list runs for specific workflow
66+
[group: 'gh']
67+
gh-run-list-workflow workflow limit="10":
68+
gh run list --workflow "{{workflow}}" --limit {{limit}}
69+
70+
71+
# view specific workflow run
72+
[group: 'gh']
73+
gh-run-view run_id:
74+
gh run view {{run_id}}
75+
76+
77+
# watch a workflow run in real-time
78+
[group: 'gh']
79+
gh-run-watch run_id:
80+
gh run watch {{run_id}}
81+
82+
83+
# list GitHub Actions caches
84+
[group: 'gh']
85+
gh-cache-list limit="20":
86+
gh cache list --limit {{limit}}
87+
88+
89+
# delete a specific cache
90+
[group: 'gh']
91+
gh-cache-delete cache_id:
92+
gh cache delete {{cache_id}}
93+
94+
95+
# delete all caches (requires confirmation)
96+
[group: 'gh']
97+
gh-cache-delete-all:
98+
gh cache delete --all
99+
100+
101+
# list workflow files
102+
[group: 'gh']
103+
gh-workflow-list:
104+
gh workflow list
105+
106+
107+
# view workflow file
108+
[group: 'gh']
109+
gh-workflow-view workflow:
110+
gh workflow view "{{workflow}}"
111+
112+
113+
# enable a workflow
114+
[group: 'gh']
115+
gh-workflow-enable workflow:
116+
gh workflow enable "{{workflow}}"
117+
118+
119+
# disable a workflow
120+
[group: 'gh']
121+
gh-workflow-disable workflow:
122+
gh workflow disable "{{workflow}}"
123+
124+
125+
# trigger a workflow manually (workflow_dispatch)
126+
[group: 'gh']
127+
gh-workflow-run workflow:
128+
gh workflow run "{{workflow}}"
129+
130+
131+
# list releases
132+
[group: 'gh']
133+
gh-release-list limit="10":
134+
gh release list --limit {{limit}}
135+
136+
137+
# view latest release
138+
[group: 'gh']
139+
gh-release-view-latest:
140+
gh release view --latest
141+
142+
143+
# create a new release
144+
[group: 'gh']
145+
gh-release-create tag:
146+
gh release create {{tag}}
147+
148+
149+
# list repository secrets
150+
[group: 'gh']
151+
gh-secret-list:
152+
gh secret list
153+
154+
155+
# set a repository secret
156+
[group: 'gh']
157+
gh-secret-set name value:
158+
echo "{{value}}" | gh secret set {{name}}
159+
160+
161+
# delete a repository secret
162+
[group: 'gh']
163+
gh-secret-delete name:
164+
gh secret delete {{name}}
165+
166+
167+
# view repository status (checks, deployments, etc)
168+
[group: 'gh']
169+
gh-status:
170+
gh status
171+
172+
173+
# list repository collaborators
174+
[group: 'gh']
175+
gh-api-collaborators:
176+
gh api repos/{owner}/{repo}/collaborators
177+
178+
179+
# view rate limit status
180+
[group: 'gh']
181+
gh-api-rate-limit:
182+
gh api rate_limit
183+
184+
185+
# clone repository
186+
[group: 'gh']
187+
gh-repo-clone repo:
188+
gh repo clone {{repo}}
189+
190+
191+
# fork repository
192+
[group: 'gh']
193+
gh-repo-fork:
194+
gh repo fork
195+
196+
197+
# sync fork with upstream
198+
[group: 'gh']
199+
gh-repo-sync:
200+
gh repo sync
201+
202+
203+
# browse repository in browser
204+
[group: 'gh']
205+
gh-browse:
206+
gh browse
207+
208+
209+
# browse pull requests in browser
210+
[group: 'gh']
211+
gh-browse-pr:
212+
gh browse --pulls
213+
214+
215+
# browse issues in browser
216+
[group: 'gh']
217+
gh-browse-issues:
218+
gh browse --issues
219+
220+
221+
# browse actions in browser
222+
[group: 'gh']
223+
gh-browse-actions:
224+
gh browse --actions
225+
226+
227+
# browse wiki in browser
228+
[group: 'gh']
229+
gh-browse-wiki:
230+
gh browse --wiki
231+
232+
233+
# list dependabot PRs
234+
[group: 'gh']
235+
gh-pr-list-dependabot limit="10":
236+
gh pr list --author app/dependabot --limit {{limit}}
237+
238+
239+
# list all dependabot PRs (including closed)
240+
[group: 'gh']
241+
gh-pr-list-dependabot-all limit="20":
242+
gh pr list --state all --author app/dependabot --limit {{limit}}
243+
244+
245+
# view GitHub Actions usage (billing)
246+
[group: 'gh']
247+
gh-api-actions-usage:
248+
gh api repos/{owner}/{repo}/actions/billing/usage

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ set shell := ["bash", "-uc"]
3636

3737
import '.just/dir-structure.justfile'
3838
import '.just/dotenv.justfile'
39+
import '.just/gh.justfile'
3940
import '.just/git.justfile'
4041
import '.just/ipython.justfile'
4142
import '.just/pre-commit.justfile'

0 commit comments

Comments
 (0)