@olegkoval/agent-skills 1.16.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +5 -3
  3. package/.cursor-plugin/index.json +5 -0
  4. package/.grok-plugin/index.json +120 -0
  5. package/.kiro/steering/crash-course.md +259 -0
  6. package/.windsurf/rules/crash-course.md +258 -0
  7. package/README.md +27 -3
  8. package/catalog/skills.json +83 -21
  9. package/package.json +3 -2
  10. package/packages/marketing/search-console-indexing-audit/adapters/grok/plugin.json +6 -0
  11. package/packages/marketing/search-console-indexing-audit/adapters/grok/skills/search-console-indexing-audit/SKILL.md +69 -0
  12. package/packages/marketing/search-console-indexing-audit/adapters/grok/skills/search-console-indexing-audit/scripts/summarize_gsc_coverage.py +151 -0
  13. package/packages/marketing/viral-launch/adapters/grok/plugin.json +6 -0
  14. package/packages/marketing/viral-launch/adapters/grok/skills/viral-launch/SKILL.md +105 -0
  15. package/packages/music/fill-music-player/adapters/grok/plugin.json +6 -0
  16. package/packages/music/fill-music-player/adapters/grok/skills/fill-music-player/SKILL.md +111 -0
  17. package/packages/photography/gallery/adapters/grok/plugin.json +6 -0
  18. package/packages/photography/gallery/adapters/grok/skills/gallery/SKILL.md +237 -0
  19. package/packages/software-development/apple-store-submit/adapters/grok/plugin.json +6 -0
  20. package/packages/software-development/apple-store-submit/adapters/grok/skills/apple-store-submit/SKILL.md +158 -0
  21. package/packages/software-development/cloudflare-block-countries/adapters/grok/plugin.json +6 -0
  22. package/packages/software-development/cloudflare-block-countries/adapters/grok/skills/cloudflare-block-countries/SKILL.md +177 -0
  23. package/packages/software-development/crash-course/SKILL.md +270 -0
  24. package/packages/software-development/crash-course/adapters/claude/plugin.json +5 -0
  25. package/packages/software-development/crash-course/adapters/claude/skills/crash-course/SKILL.md +271 -0
  26. package/packages/software-development/crash-course/adapters/codex/README.md +3 -0
  27. package/packages/software-development/crash-course/adapters/cursor/plugin.json +6 -0
  28. package/packages/software-development/crash-course/adapters/cursor/skills/crash-course/SKILL.md +271 -0
  29. package/packages/software-development/crash-course/adapters/grok/plugin.json +6 -0
  30. package/packages/software-development/crash-course/adapters/grok/skills/crash-course/SKILL.md +271 -0
  31. package/packages/software-development/crash-course/adapters/kiro/steering/crash-course.md +259 -0
  32. package/packages/software-development/crash-course/adapters/windsurf/rules/crash-course.md +258 -0
  33. package/packages/software-development/docs-index-keeper/adapters/grok/plugin.json +6 -0
  34. package/packages/software-development/docs-index-keeper/adapters/grok/skills/docs-index-keeper/SKILL.md +65 -0
  35. package/packages/software-development/gh-cli/adapters/grok/plugin.json +6 -0
  36. package/packages/software-development/gh-cli/adapters/grok/skills/gh-cli/SKILL.md +2200 -0
  37. package/packages/software-development/git-commit/adapters/grok/plugin.json +6 -0
  38. package/packages/software-development/git-commit/adapters/grok/skills/git-commit/SKILL.md +133 -0
  39. package/packages/software-development/macos-menubar-app/adapters/grok/plugin.json +6 -0
  40. package/packages/software-development/macos-menubar-app/adapters/grok/skills/macos-menubar-app/SKILL.md +238 -0
  41. package/packages/software-development/mvp-oneshot/adapters/grok/plugin.json +6 -0
  42. package/packages/software-development/mvp-oneshot/adapters/grok/skills/mvp-oneshot/SKILL.md +176 -0
  43. package/packages/software-development/obsidian-pr-sync/adapters/grok/plugin.json +6 -0
  44. package/packages/software-development/obsidian-pr-sync/adapters/grok/skills/obsidian-pr-sync/SKILL.md +154 -0
  45. package/packages/software-development/obsidian-task-rollover/adapters/grok/plugin.json +6 -0
  46. package/packages/software-development/obsidian-task-rollover/adapters/grok/skills/obsidian-task-rollover/SKILL.md +198 -0
  47. package/packages/software-development/open-source-publisher/adapters/grok/plugin.json +6 -0
  48. package/packages/software-development/open-source-publisher/adapters/grok/skills/open-source-publisher/SKILL.md +471 -0
  49. package/packages/software-development/product-builder/adapters/grok/plugin.json +6 -0
  50. package/packages/software-development/product-builder/adapters/grok/skills/product-builder/SKILL.md +224 -0
  51. package/packages/software-development/promptctl/adapters/grok/plugin.json +6 -0
  52. package/packages/software-development/promptctl/adapters/grok/skills/promptctl/SKILL.md +90 -0
  53. package/packages/software-development/relay/adapters/claude/plugin.json +5 -0
  54. package/packages/software-development/relay/adapters/claude/skills/relay/SKILL.md +117 -0
  55. package/packages/software-development/relay/adapters/grok/plugin.json +6 -0
  56. package/packages/software-development/relay/adapters/grok/skills/relay/SKILL.md +117 -0
  57. package/packages/software-development/review-past-performance/adapters/grok/plugin.json +6 -0
  58. package/packages/software-development/review-past-performance/adapters/grok/skills/review-past-performance/SKILL.md +212 -0
  59. package/packages/software-development/self-critique/adapters/grok/plugin.json +6 -0
  60. package/packages/software-development/self-critique/adapters/grok/skills/self-critique/SKILL.md +149 -0
  61. package/packages/software-development/self-critique/adapters/grok/skills/self-critique/scripts/critique-nudge.mjs +57 -0
  62. package/packages/software-development/semantic-release-beta/adapters/grok/plugin.json +6 -0
  63. package/packages/software-development/semantic-release-beta/adapters/grok/skills/semantic-release-beta/SKILL.md +59 -0
  64. package/packages/software-development/skill-budget-audit/adapters/grok/plugin.json +6 -0
  65. package/packages/software-development/skill-budget-audit/adapters/grok/skills/skill-budget-audit/SKILL.md +146 -0
  66. package/packages/software-development/starter-rules/adapters/grok/plugin.json +6 -0
  67. package/packages/software-development/starter-rules/adapters/grok/skills/starter-rules/SKILL.md +73 -0
  68. package/scripts/build-adapters.sh +47 -4
  69. package/scripts/validate-catalog.sh +10 -0
@@ -0,0 +1,2200 @@
1
+ ---
2
+ name: gh-cli
3
+ description: GitHub CLI (gh) comprehensive reference for repositories, issues, pull requests, Actions, projects, releases, gists, codespaces, organizations, extensions, and all GitHub operations from the command line.
4
+ license: MIT
5
+ allowed-tools: Bash
6
+ compatibility: Codex, Claude Code, Cursor, GitHub Copilot, Windsurf, Kiro, and other Agent Skills compatible tools. Requires the GitHub CLI and valid GitHub authentication.
7
+ metadata:
8
+ targets: [_source-only]
9
+ author: Oleg Koval
10
+ tags:
11
+ - github
12
+ - gh
13
+ - cli
14
+ - pull-requests
15
+ - actions
16
+ ---
17
+ <!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
18
+
19
+ # GitHub CLI (gh)
20
+
21
+ Comprehensive reference for GitHub CLI (gh) - work seamlessly with GitHub from the command line.
22
+
23
+ **Version:** 2.85.0 (current as of January 2026)
24
+
25
+ ## Prerequisites
26
+
27
+ ### Installation
28
+
29
+ ```bash
30
+ # macOS
31
+ brew install gh
32
+
33
+ # Linux
34
+ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
35
+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
36
+ sudo apt update
37
+ sudo apt install gh
38
+
39
+ # Windows
40
+ winget install --id GitHub.cli
41
+
42
+ # Verify installation
43
+ gh --version
44
+ ```
45
+
46
+ ### Authentication
47
+
48
+ ```bash
49
+ # Interactive login (default: github.com)
50
+ gh auth login
51
+
52
+ # Login with specific hostname
53
+ gh auth login --hostname enterprise.internal
54
+
55
+ # Login with token
56
+ gh auth login --with-token < mytoken.txt
57
+
58
+ # Check authentication status
59
+ gh auth status
60
+
61
+ # Switch accounts
62
+ gh auth switch --hostname github.com --user username
63
+
64
+ # Logout
65
+ gh auth logout --hostname github.com --user username
66
+ ```
67
+
68
+ ### Setup Git Integration
69
+
70
+ ```bash
71
+ # Configure git to use gh as credential helper
72
+ gh auth setup-git
73
+
74
+ # View active token
75
+ gh auth token
76
+
77
+ # Refresh authentication scopes
78
+ gh auth refresh --scopes write:org,read:public_key
79
+ ```
80
+
81
+ ## CLI Structure
82
+
83
+ ```
84
+ gh # Root command
85
+ ├── auth # Authentication
86
+ │ ├── login
87
+ │ ├── logout
88
+ │ ├── refresh
89
+ │ ├── setup-git
90
+ │ ├── status
91
+ │ ├── switch
92
+ │ └── token
93
+ ├── browse # Open in browser
94
+ ├── codespace # GitHub Codespaces
95
+ │ ├── code
96
+ │ ├── cp
97
+ │ ├── create
98
+ │ ├── delete
99
+ │ ├── edit
100
+ │ ├── jupyter
101
+ │ ├── list
102
+ │ ├── logs
103
+ │ ├── ports
104
+ │ ├── rebuild
105
+ │ ├── ssh
106
+ │ ├── stop
107
+ │ └── view
108
+ ├── gist # Gists
109
+ │ ├── clone
110
+ │ ├── create
111
+ │ ├── delete
112
+ │ ├── edit
113
+ │ ├── list
114
+ │ ├── rename
115
+ │ └── view
116
+ ├── issue # Issues
117
+ │ ├── create
118
+ │ ├── list
119
+ │ ├── status
120
+ │ ├── close
121
+ │ ├── comment
122
+ │ ├── delete
123
+ │ ├── develop
124
+ │ ├── edit
125
+ │ ├── lock
126
+ │ ├── pin
127
+ │ ├── reopen
128
+ │ ├── transfer
129
+ │ ├── unlock
130
+ │ └── view
131
+ ├── org # Organizations
132
+ │ └── list
133
+ ├── pr # Pull Requests
134
+ │ ├── create
135
+ │ ├── list
136
+ │ ├── status
137
+ │ ├── checkout
138
+ │ ├── checks
139
+ │ ├── close
140
+ │ ├── comment
141
+ │ ├── diff
142
+ │ ├── edit
143
+ │ ├── lock
144
+ │ ├── merge
145
+ │ ├── ready
146
+ │ ├── reopen
147
+ │ ├── revert
148
+ │ ├── review
149
+ │ ├── unlock
150
+ │ ├── update-branch
151
+ │ └── view
152
+ ├── project # Projects
153
+ │ ├── close
154
+ │ ├── copy
155
+ │ ├── create
156
+ │ ├── delete
157
+ │ ├── edit
158
+ │ ├── field-create
159
+ │ ├── field-delete
160
+ │ ├── field-list
161
+ │ ├── item-add
162
+ │ ├── item-archive
163
+ │ ├── item-create
164
+ │ ├── item-delete
165
+ │ ├── item-edit
166
+ │ ├── item-list
167
+ │ ├── link
168
+ │ ├── list
169
+ │ ├── mark-template
170
+ │ ├── unlink
171
+ │ └── view
172
+ ├── release # Releases
173
+ │ ├── create
174
+ │ ├── list
175
+ │ ├── delete
176
+ │ ├── delete-asset
177
+ │ ├── download
178
+ │ ├── edit
179
+ │ ├── upload
180
+ │ ├── verify
181
+ │ ├── verify-asset
182
+ │ └── view
183
+ ├── repo # Repositories
184
+ │ ├── create
185
+ │ ├── list
186
+ │ ├── archive
187
+ │ ├── autolink
188
+ │ ├── clone
189
+ │ ├── delete
190
+ │ ├── deploy-key
191
+ │ ├── edit
192
+ │ ├── fork
193
+ │ ├── gitignore
194
+ │ ├── license
195
+ │ ├── rename
196
+ │ ├── set-default
197
+ │ ├── sync
198
+ │ ├── unarchive
199
+ │ └── view
200
+ ├── cache # Actions caches
201
+ │ ├── delete
202
+ │ └── list
203
+ ├── run # Workflow runs
204
+ │ ├── cancel
205
+ │ ├── delete
206
+ │ ├── download
207
+ │ ├── list
208
+ │ ├── rerun
209
+ │ ├── view
210
+ │ └── watch
211
+ ├── workflow # Workflows
212
+ │ ├── disable
213
+ │ ├── enable
214
+ │ ├── list
215
+ │ ├── run
216
+ │ └── view
217
+ ├── agent-task # Agent tasks
218
+ ├── alias # Command aliases
219
+ │ ├── delete
220
+ │ ├── import
221
+ │ ├── list
222
+ │ └── set
223
+ ├── api # API requests
224
+ ├── attestation # Artifact attestations
225
+ │ ├── download
226
+ │ ├── trusted-root
227
+ │ └── verify
228
+ ├── completion # Shell completion
229
+ ├── config # Configuration
230
+ │ ├── clear-cache
231
+ │ ├── get
232
+ │ ├── list
233
+ │ └── set
234
+ ├── extension # Extensions
235
+ │ ├── browse
236
+ │ ├── create
237
+ │ ├── exec
238
+ │ ├── install
239
+ │ ├── list
240
+ │ ├── remove
241
+ │ ├── search
242
+ │ └── upgrade
243
+ ├── gpg-key # GPG keys
244
+ │ ├── add
245
+ │ ├── delete
246
+ │ └── list
247
+ ├── label # Labels
248
+ │ ├── clone
249
+ │ ├── create
250
+ │ ├── delete
251
+ │ ├── edit
252
+ │ └── list
253
+ ├── preview # Preview features
254
+ ├── ruleset # Rulesets
255
+ │ ├── check
256
+ │ ├── list
257
+ │ └── view
258
+ ├── search # Search
259
+ │ ├── code
260
+ │ ├── commits
261
+ │ ├── issues
262
+ │ ├── prs
263
+ │ └── repos
264
+ ├── secret # Secrets
265
+ │ ├── delete
266
+ │ ├── list
267
+ │ └── set
268
+ ├── ssh-key # SSH keys
269
+ │ ├── add
270
+ │ ├── delete
271
+ │ └── list
272
+ ├── status # Status overview
273
+ └── variable # Variables
274
+ ├── delete
275
+ ├── get
276
+ ├── list
277
+ └── set
278
+ ```
279
+
280
+ ## Configuration
281
+
282
+ ### Global Configuration
283
+
284
+ ```bash
285
+ # List all configuration
286
+ gh config list
287
+
288
+ # Get specific configuration value
289
+ gh config list git_protocol
290
+ gh config get editor
291
+
292
+ # Set configuration value
293
+ gh config set editor vim
294
+ gh config set git_protocol ssh
295
+ gh config set prompt disabled
296
+ gh config set pager "less -R"
297
+
298
+ # Clear configuration cache
299
+ gh config clear-cache
300
+ ```
301
+
302
+ ### Environment Variables
303
+
304
+ ```bash
305
+ # GitHub token (for automation)
306
+ export GH_TOKEN=ghp_xxxxxxxxxxxx
307
+
308
+ # GitHub hostname
309
+ export GH_HOST=github.com
310
+
311
+ # Disable prompts
312
+ export GH_PROMPT_DISABLED=true
313
+
314
+ # Custom editor
315
+ export GH_EDITOR=vim
316
+
317
+ # Custom pager
318
+ export GH_PAGER=less
319
+
320
+ # HTTP timeout
321
+ export GH_TIMEOUT=30
322
+
323
+ # Custom repository (override default)
324
+ export GH_REPO=owner/repo
325
+
326
+ # Custom git protocol
327
+ export GH_ENTERPRISE_HOSTNAME=hostname
328
+ ```
329
+
330
+ ## Authentication (gh auth)
331
+
332
+ ### Login
333
+
334
+ ```bash
335
+ # Interactive login
336
+ gh auth login
337
+
338
+ # Web-based authentication
339
+ gh auth login --web
340
+
341
+ # With clipboard for OAuth code
342
+ gh auth login --web --clipboard
343
+
344
+ # With specific git protocol
345
+ gh auth login --git-protocol ssh
346
+
347
+ # With custom hostname (GitHub Enterprise)
348
+ gh auth login --hostname enterprise.internal
349
+
350
+ # Login with token from stdin
351
+ gh auth login --with-token < token.txt
352
+
353
+ # Insecure storage (plain text)
354
+ gh auth login --insecure-storage
355
+ ```
356
+
357
+ ### Status
358
+
359
+ ```bash
360
+ # Show all authentication status
361
+ gh auth status
362
+
363
+ # Show active account only
364
+ gh auth status --active
365
+
366
+ # Show specific hostname
367
+ gh auth status --hostname github.com
368
+
369
+ # Show token in output
370
+ gh auth status --show-token
371
+
372
+ # JSON output
373
+ gh auth status --json hosts
374
+
375
+ # Filter with jq
376
+ gh auth status --json hosts --jq '.hosts | add'
377
+ ```
378
+
379
+ ### Switch Accounts
380
+
381
+ ```bash
382
+ # Interactive switch
383
+ gh auth switch
384
+
385
+ # Switch to specific user/host
386
+ gh auth switch --hostname github.com --user monalisa
387
+ ```
388
+
389
+ ### Token
390
+
391
+ ```bash
392
+ # Print authentication token
393
+ gh auth token
394
+
395
+ # Token for specific host/user
396
+ gh auth token --hostname github.com --user monalisa
397
+ ```
398
+
399
+ ### Refresh
400
+
401
+ ```bash
402
+ # Refresh credentials
403
+ gh auth refresh
404
+
405
+ # Add scopes
406
+ gh auth refresh --scopes write:org,read:public_key
407
+
408
+ # Remove scopes
409
+ gh auth refresh --remove-scopes delete_repo
410
+
411
+ # Reset to default scopes
412
+ gh auth refresh --reset-scopes
413
+
414
+ # With clipboard
415
+ gh auth refresh --clipboard
416
+ ```
417
+
418
+ ### Setup Git
419
+
420
+ ```bash
421
+ # Setup git credential helper
422
+ gh auth setup-git
423
+
424
+ # Setup for specific host
425
+ gh auth setup-git --hostname enterprise.internal
426
+
427
+ # Force setup even if host not known
428
+ gh auth setup-git --hostname enterprise.internal --force
429
+ ```
430
+
431
+ ## Browse (gh browse)
432
+
433
+ ```bash
434
+ # Open repository in browser
435
+ gh browse
436
+
437
+ # Open specific path
438
+ gh browse script/
439
+ gh browse main.go:312
440
+
441
+ # Open issue or PR
442
+ gh browse 123
443
+
444
+ # Open commit
445
+ gh browse 77507cd94ccafcf568f8560cfecde965fcfa63
446
+
447
+ # Open with specific branch
448
+ gh browse main.go --branch bug-fix
449
+
450
+ # Open different repository
451
+ gh browse --repo owner/repo
452
+
453
+ # Open specific pages
454
+ gh browse --actions # Actions tab
455
+ gh browse --projects # Projects tab
456
+ gh browse --releases # Releases tab
457
+ gh browse --settings # Settings page
458
+ gh browse --wiki # Wiki page
459
+
460
+ # Print URL instead of opening
461
+ gh browse --no-browser
462
+ ```
463
+
464
+ ## Repositories (gh repo)
465
+
466
+ ### Create Repository
467
+
468
+ ```bash
469
+ # Create new repository
470
+ gh repo create my-repo
471
+
472
+ # Create with description
473
+ gh repo create my-repo --description "My awesome project"
474
+
475
+ # Create public repository
476
+ gh repo create my-repo --public
477
+
478
+ # Create private repository
479
+ gh repo create my-repo --private
480
+
481
+ # Create with homepage
482
+ gh repo create my-repo --homepage https://example.com
483
+
484
+ # Create with license
485
+ gh repo create my-repo --license mit
486
+
487
+ # Create with gitignore
488
+ gh repo create my-repo --gitignore python
489
+
490
+ # Initialize as template repository
491
+ gh repo create my-repo --template
492
+
493
+ # Create repository in organization
494
+ gh repo create org/my-repo
495
+
496
+ # Create without cloning locally
497
+ gh repo create my-repo --source=.
498
+
499
+ # Disable issues
500
+ gh repo create my-repo --disable-issues
501
+
502
+ # Disable wiki
503
+ gh repo create my-repo --disable-wiki
504
+ ```
505
+
506
+ ### Clone Repository
507
+
508
+ ```bash
509
+ # Clone repository
510
+ gh repo clone owner/repo
511
+
512
+ # Clone to specific directory
513
+ gh repo clone owner/repo my-directory
514
+
515
+ # Clone with different branch
516
+ gh repo clone owner/repo --branch develop
517
+ ```
518
+
519
+ ### List Repositories
520
+
521
+ ```bash
522
+ # List all repositories
523
+ gh repo list
524
+
525
+ # List repositories for owner
526
+ gh repo list owner
527
+
528
+ # Limit results
529
+ gh repo list --limit 50
530
+
531
+ # Public repositories only
532
+ gh repo list --public
533
+
534
+ # Source repositories only (not forks)
535
+ gh repo list --source
536
+
537
+ # JSON output
538
+ gh repo list --json name,visibility,owner
539
+
540
+ # Table output
541
+ gh repo list --limit 100 | tail -n +2
542
+
543
+ # Filter with jq
544
+ gh repo list --json name --jq '.[].name'
545
+ ```
546
+
547
+ ### View Repository
548
+
549
+ ```bash
550
+ # View repository details
551
+ gh repo view
552
+
553
+ # View specific repository
554
+ gh repo view owner/repo
555
+
556
+ # JSON output
557
+ gh repo view --json name,description,defaultBranchRef
558
+
559
+ # View in browser
560
+ gh repo view --web
561
+ ```
562
+
563
+ ### Edit Repository
564
+
565
+ ```bash
566
+ # Edit description
567
+ gh repo edit --description "New description"
568
+
569
+ # Set homepage
570
+ gh repo edit --homepage https://example.com
571
+
572
+ # Change visibility
573
+ gh repo edit --visibility private
574
+ gh repo edit --visibility public
575
+
576
+ # Enable/disable features
577
+ gh repo edit --enable-issues
578
+ gh repo edit --disable-issues
579
+ gh repo edit --enable-wiki
580
+ gh repo edit --disable-wiki
581
+ gh repo edit --enable-projects
582
+ gh repo edit --disable-projects
583
+
584
+ # Set default branch
585
+ gh repo edit --default-branch main
586
+
587
+ # Rename repository
588
+ gh repo rename new-name
589
+
590
+ # Archive repository
591
+ gh repo archive
592
+ gh repo unarchive
593
+ ```
594
+
595
+ ### Delete Repository
596
+
597
+ ```bash
598
+ # Delete repository
599
+ gh repo delete owner/repo
600
+
601
+ # Confirm without prompt
602
+ gh repo delete owner/repo --yes
603
+ ```
604
+
605
+ ### Fork Repository
606
+
607
+ ```bash
608
+ # Fork repository
609
+ gh repo fork owner/repo
610
+
611
+ # Fork to organization
612
+ gh repo fork owner/repo --org org-name
613
+
614
+ # Clone after forking
615
+ gh repo fork owner/repo --clone
616
+
617
+ # Remote name for fork
618
+ gh repo fork owner/repo --remote-name upstream
619
+ ```
620
+
621
+ ### Sync Fork
622
+
623
+ ```bash
624
+ # Sync fork with upstream
625
+ gh repo sync
626
+
627
+ # Sync specific branch
628
+ gh repo sync --branch feature
629
+
630
+ # Force sync
631
+ gh repo sync --force
632
+ ```
633
+
634
+ ### Set Default Repository
635
+
636
+ ```bash
637
+ # Set default repository for current directory
638
+ gh repo set-default
639
+
640
+ # Set default explicitly
641
+ gh repo set-default owner/repo
642
+
643
+ # Unset default
644
+ gh repo set-default --unset
645
+ ```
646
+
647
+ ### Repository Autolinks
648
+
649
+ ```bash
650
+ # List autolinks
651
+ gh repo autolink list
652
+
653
+ # Add autolink
654
+ gh repo autolink add \
655
+ --key-prefix JIRA- \
656
+ --url-template https://jira.example.com/browse/<num>
657
+
658
+ # Delete autolink
659
+ gh repo autolink delete 12345
660
+ ```
661
+
662
+ ### Repository Deploy Keys
663
+
664
+ ```bash
665
+ # List deploy keys
666
+ gh repo deploy-key list
667
+
668
+ # Add deploy key
669
+ gh repo deploy-key add ~/.ssh/id_rsa.pub \
670
+ --title "Production server" \
671
+ --read-only
672
+
673
+ # Delete deploy key
674
+ gh repo deploy-key delete 12345
675
+ ```
676
+
677
+ ### Gitignore and License
678
+
679
+ ```bash
680
+ # View gitignore template
681
+ gh repo gitignore
682
+
683
+ # View license template
684
+ gh repo license mit
685
+
686
+ # License with full name
687
+ gh repo license mit --fullname "John Doe"
688
+ ```
689
+
690
+ ## Issues (gh issue)
691
+
692
+ ### Create Issue
693
+
694
+ ```bash
695
+ # Create issue interactively
696
+ gh issue create
697
+
698
+ # Create with title
699
+ gh issue create --title "Bug: Login not working"
700
+
701
+ # Create with title and body
702
+ gh issue create \
703
+ --title "Bug: Login not working" \
704
+ --body "Steps to reproduce..."
705
+
706
+ # Create with body from file
707
+ gh issue create --body-file issue.md
708
+
709
+ # Create with labels
710
+ gh issue create --title "Fix bug" --labels bug,high-priority
711
+
712
+ # Create with assignees
713
+ gh issue create --title "Fix bug" --assignee user1,user2
714
+
715
+ # Create in specific repository
716
+ gh issue create --repo owner/repo --title "Issue title"
717
+
718
+ # Create issue from web
719
+ gh issue create --web
720
+ ```
721
+
722
+ ### List Issues
723
+
724
+ ```bash
725
+ # List all open issues
726
+ gh issue list
727
+
728
+ # List all issues (including closed)
729
+ gh issue list --state all
730
+
731
+ # List closed issues
732
+ gh issue list --state closed
733
+
734
+ # Limit results
735
+ gh issue list --limit 50
736
+
737
+ # Filter by assignee
738
+ gh issue list --assignee username
739
+ gh issue list --assignee @me
740
+
741
+ # Filter by labels
742
+ gh issue list --labels bug,enhancement
743
+
744
+ # Filter by milestone
745
+ gh issue list --milestone "v1.0"
746
+
747
+ # Search/filter
748
+ gh issue list --search "is:open is:issue label:bug"
749
+
750
+ # JSON output
751
+ gh issue list --json number,title,state,author
752
+
753
+ # Table view
754
+ gh issue list --json number,title,labels --jq '.[] | [.number, .title, .labels[].name] | @tsv'
755
+
756
+ # Show comments count
757
+ gh issue list --json number,title,comments --jq '.[] | [.number, .title, .comments]'
758
+
759
+ # Sort by
760
+ gh issue list --sort created --order desc
761
+ ```
762
+
763
+ ### View Issue
764
+
765
+ ```bash
766
+ # View issue
767
+ gh issue view 123
768
+
769
+ # View with comments
770
+ gh issue view 123 --comments
771
+
772
+ # View in browser
773
+ gh issue view 123 --web
774
+
775
+ # JSON output
776
+ gh issue view 123 --json title,body,state,labels,comments
777
+
778
+ # View specific fields
779
+ gh issue view 123 --json title --jq '.title'
780
+ ```
781
+
782
+ ### Edit Issue
783
+
784
+ ```bash
785
+ # Edit interactively
786
+ gh issue edit 123
787
+
788
+ # Edit title
789
+ gh issue edit 123 --title "New title"
790
+
791
+ # Edit body
792
+ gh issue edit 123 --body "New description"
793
+
794
+ # Add labels
795
+ gh issue edit 123 --add-label bug,high-priority
796
+
797
+ # Remove labels
798
+ gh issue edit 123 --remove-label stale
799
+
800
+ # Add assignees
801
+ gh issue edit 123 --add-assignee user1,user2
802
+
803
+ # Remove assignees
804
+ gh issue edit 123 --remove-assignee user1
805
+
806
+ # Set milestone
807
+ gh issue edit 123 --milestone "v1.0"
808
+ ```
809
+
810
+ ### Close/Reopen Issue
811
+
812
+ ```bash
813
+ # Close issue
814
+ gh issue close 123
815
+
816
+ # Close with comment
817
+ gh issue close 123 --comment "Fixed in PR #456"
818
+
819
+ # Reopen issue
820
+ gh issue reopen 123
821
+ ```
822
+
823
+ ### Comment on Issue
824
+
825
+ ```bash
826
+ # Add comment
827
+ gh issue comment 123 --body "This looks good!"
828
+
829
+ # Edit comment
830
+ gh issue comment 123 --edit 456789 --body "Updated comment"
831
+
832
+ # Delete comment
833
+ gh issue comment 123 --delete 456789
834
+ ```
835
+
836
+ ### Issue Status
837
+
838
+ ```bash
839
+ # Show issue status summary
840
+ gh issue status
841
+
842
+ # Status for specific repository
843
+ gh issue status --repo owner/repo
844
+ ```
845
+
846
+ ### Pin/Unpin Issues
847
+
848
+ ```bash
849
+ # Pin issue (pinned to repo dashboard)
850
+ gh issue pin 123
851
+
852
+ # Unpin issue
853
+ gh issue unpin 123
854
+ ```
855
+
856
+ ### Lock/Unlock Issue
857
+
858
+ ```bash
859
+ # Lock conversation
860
+ gh issue lock 123
861
+
862
+ # Lock with reason
863
+ gh issue lock 123 --reason off-topic
864
+
865
+ # Unlock
866
+ gh issue unlock 123
867
+ ```
868
+
869
+ ### Transfer Issue
870
+
871
+ ```bash
872
+ # Transfer to another repository
873
+ gh issue transfer 123 --repo owner/new-repo
874
+ ```
875
+
876
+ ### Delete Issue
877
+
878
+ ```bash
879
+ # Delete issue
880
+ gh issue delete 123
881
+
882
+ # Confirm without prompt
883
+ gh issue delete 123 --yes
884
+ ```
885
+
886
+ ### Develop Issue (Draft PR)
887
+
888
+ ```bash
889
+ # Create draft PR from issue
890
+ gh issue develop 123
891
+
892
+ # Create in specific branch
893
+ gh issue develop 123 --branch fix/issue-123
894
+
895
+ # Create with base branch
896
+ gh issue develop 123 --base main
897
+ ```
898
+
899
+ ## Pull Requests (gh pr)
900
+
901
+ ### Create Pull Request
902
+
903
+ ```bash
904
+ # Create PR interactively
905
+ gh pr create
906
+
907
+ # Create with title
908
+ gh pr create --title "Feature: Add new functionality"
909
+
910
+ # Create with title and body
911
+ gh pr create \
912
+ --title "Feature: Add new functionality" \
913
+ --body "This PR adds..."
914
+
915
+ # Fill body from template
916
+ gh pr create --body-file .github/PULL_REQUEST_TEMPLATE.md
917
+
918
+ # Set base branch
919
+ gh pr create --base main
920
+
921
+ # Set head branch (default: current branch)
922
+ gh pr create --head feature-branch
923
+
924
+ # Create draft PR
925
+ gh pr create --draft
926
+
927
+ # Add assignees
928
+ gh pr create --assignee user1,user2
929
+
930
+ # Add reviewers
931
+ gh pr create --reviewer user1,user2
932
+
933
+ # Add labels
934
+ gh pr create --labels enhancement,feature
935
+
936
+ # Link to issue
937
+ gh pr create --issue 123
938
+
939
+ # Create in specific repository
940
+ gh pr create --repo owner/repo
941
+
942
+ # Open in browser after creation
943
+ gh pr create --web
944
+ ```
945
+
946
+ ### List Pull Requests
947
+
948
+ ```bash
949
+ # List open PRs
950
+ gh pr list
951
+
952
+ # List all PRs
953
+ gh pr list --state all
954
+
955
+ # List merged PRs
956
+ gh pr list --state merged
957
+
958
+ # List closed (not merged) PRs
959
+ gh pr list --state closed
960
+
961
+ # Filter by head branch
962
+ gh pr list --head feature-branch
963
+
964
+ # Filter by base branch
965
+ gh pr list --base main
966
+
967
+ # Filter by author
968
+ gh pr list --author username
969
+ gh pr list --author @me
970
+
971
+ # Filter by assignee
972
+ gh pr list --assignee username
973
+
974
+ # Filter by labels
975
+ gh pr list --labels bug,enhancement
976
+
977
+ # Limit results
978
+ gh pr list --limit 50
979
+
980
+ # Search
981
+ gh pr list --search "is:open is:pr label:review-required"
982
+
983
+ # JSON output
984
+ gh pr list --json number,title,state,author,headRefName
985
+
986
+ # Show check status
987
+ gh pr list --json number,title,statusCheckRollup --jq '.[] | [.number, .title, .statusCheckRollup[]?.status]'
988
+
989
+ # Sort by
990
+ gh pr list --sort created --order desc
991
+ ```
992
+
993
+ ### View Pull Request
994
+
995
+ ```bash
996
+ # View PR
997
+ gh pr view 123
998
+
999
+ # View with comments
1000
+ gh pr view 123 --comments
1001
+
1002
+ # View in browser
1003
+ gh pr view 123 --web
1004
+
1005
+ # JSON output
1006
+ gh pr view 123 --json title,body,state,author,commits,files
1007
+
1008
+ # View diff
1009
+ gh pr view 123 --json files --jq '.files[].path'
1010
+
1011
+ # View with jq query
1012
+ gh pr view 123 --json title,state --jq '"\(.title): \(.state)"'
1013
+ ```
1014
+
1015
+ ### Checkout Pull Request
1016
+
1017
+ ```bash
1018
+ # Checkout PR branch
1019
+ gh pr checkout 123
1020
+
1021
+ # Checkout with specific branch name
1022
+ gh pr checkout 123 --branch name-123
1023
+
1024
+ # Force checkout
1025
+ gh pr checkout 123 --force
1026
+ ```
1027
+
1028
+ ### Diff Pull Request
1029
+
1030
+ ```bash
1031
+ # View PR diff
1032
+ gh pr diff 123
1033
+
1034
+ # View diff with color
1035
+ gh pr diff 123 --color always
1036
+
1037
+ # Output to file
1038
+ gh pr diff 123 > pr-123.patch
1039
+
1040
+ # View diff of specific files
1041
+ gh pr diff 123 --name-only
1042
+ ```
1043
+
1044
+ ### Merge Pull Request
1045
+
1046
+ ```bash
1047
+ # Merge PR
1048
+ gh pr merge 123
1049
+
1050
+ # Merge with specific method
1051
+ gh pr merge 123 --merge
1052
+ gh pr merge 123 --squash
1053
+ gh pr merge 123 --rebase
1054
+
1055
+ # Delete branch after merge
1056
+ gh pr merge 123 --delete-branch
1057
+
1058
+ # Merge with comment
1059
+ gh pr merge 123 --subject "Merge PR #123" --body "Merging feature"
1060
+
1061
+ # Merge draft PR
1062
+ gh pr merge 123 --admin
1063
+
1064
+ # Force merge (skip checks)
1065
+ gh pr merge 123 --admin
1066
+ ```
1067
+
1068
+ ### Close Pull Request
1069
+
1070
+ ```bash
1071
+ # Close PR (as draft, not merge)
1072
+ gh pr close 123
1073
+
1074
+ # Close with comment
1075
+ gh pr close 123 --comment "Closing due to..."
1076
+ ```
1077
+
1078
+ ### Reopen Pull Request
1079
+
1080
+ ```bash
1081
+ # Reopen closed PR
1082
+ gh pr reopen 123
1083
+ ```
1084
+
1085
+ ### Edit Pull Request
1086
+
1087
+ ```bash
1088
+ # Edit interactively
1089
+ gh pr edit 123
1090
+
1091
+ # Edit title
1092
+ gh pr edit 123 --title "New title"
1093
+
1094
+ # Edit body
1095
+ gh pr edit 123 --body "New description"
1096
+
1097
+ # Add labels
1098
+ gh pr edit 123 --add-label bug,enhancement
1099
+
1100
+ # Remove labels
1101
+ gh pr edit 123 --remove-label stale
1102
+
1103
+ # Add assignees
1104
+ gh pr edit 123 --add-assignee user1,user2
1105
+
1106
+ # Remove assignees
1107
+ gh pr edit 123 --remove-assignee user1
1108
+
1109
+ # Add reviewers
1110
+ gh pr edit 123 --add-reviewer user1,user2
1111
+
1112
+ # Remove reviewers
1113
+ gh pr edit 123 --remove-reviewer user1
1114
+
1115
+ # Mark as ready for review
1116
+ gh pr edit 123 --ready
1117
+ ```
1118
+
1119
+ ### Ready for Review
1120
+
1121
+ ```bash
1122
+ # Mark draft PR as ready
1123
+ gh pr ready 123
1124
+ ```
1125
+
1126
+ ### Pull Request Checks
1127
+
1128
+ ```bash
1129
+ # View PR checks
1130
+ gh pr checks 123
1131
+
1132
+ # Watch checks in real-time
1133
+ gh pr checks 123 --watch
1134
+
1135
+ # Watch interval (seconds)
1136
+ gh pr checks 123 --watch --interval 5
1137
+ ```
1138
+
1139
+ ### Comment on Pull Request
1140
+
1141
+ ```bash
1142
+ # Add comment
1143
+ gh pr comment 123 --body "Looks good!"
1144
+
1145
+ # Comment on specific line
1146
+ gh pr comment 123 --body "Fix this" \
1147
+ --repo owner/repo \
1148
+ --head-owner owner --head-branch feature
1149
+
1150
+ # Edit comment
1151
+ gh pr comment 123 --edit 456789 --body "Updated"
1152
+
1153
+ # Delete comment
1154
+ gh pr comment 123 --delete 456789
1155
+ ```
1156
+
1157
+ ### Review Pull Request
1158
+
1159
+ ```bash
1160
+ # Review PR (opens editor)
1161
+ gh pr review 123
1162
+
1163
+ # Approve PR
1164
+ gh pr review 123 --approve --body "LGTM!"
1165
+
1166
+ # Request changes
1167
+ gh pr review 123 --request-changes \
1168
+ --body "Please fix these issues"
1169
+
1170
+ # Comment on PR
1171
+ gh pr review 123 --comment --body "Some thoughts..."
1172
+
1173
+ # Dismiss review
1174
+ gh pr review 123 --dismiss
1175
+ ```
1176
+
1177
+ ### Update Branch
1178
+
1179
+ ```bash
1180
+ # Update PR branch with latest base branch
1181
+ gh pr update-branch 123
1182
+
1183
+ # Force update
1184
+ gh pr update-branch 123 --force
1185
+
1186
+ # Use merge strategy
1187
+ gh pr update-branch 123 --merge
1188
+ ```
1189
+
1190
+ ### Lock/Unlock Pull Request
1191
+
1192
+ ```bash
1193
+ # Lock PR conversation
1194
+ gh pr lock 123
1195
+
1196
+ # Lock with reason
1197
+ gh pr lock 123 --reason off-topic
1198
+
1199
+ # Unlock
1200
+ gh pr unlock 123
1201
+ ```
1202
+
1203
+ ### Revert Pull Request
1204
+
1205
+ ```bash
1206
+ # Revert merged PR
1207
+ gh pr revert 123
1208
+
1209
+ # Revert with specific branch name
1210
+ gh pr revert 123 --branch revert-pr-123
1211
+ ```
1212
+
1213
+ ### Pull Request Status
1214
+
1215
+ ```bash
1216
+ # Show PR status summary
1217
+ gh pr status
1218
+
1219
+ # Status for specific repository
1220
+ gh pr status --repo owner/repo
1221
+ ```
1222
+
1223
+ ## GitHub Actions
1224
+
1225
+ ### Workflow Runs (gh run)
1226
+
1227
+ ```bash
1228
+ # List workflow runs
1229
+ gh run list
1230
+
1231
+ # List for specific workflow
1232
+ gh run list --workflow "ci.yml"
1233
+
1234
+ # List for specific branch
1235
+ gh run list --branch main
1236
+
1237
+ # Limit results
1238
+ gh run list --limit 20
1239
+
1240
+ # JSON output
1241
+ gh run list --json databaseId,status,conclusion,headBranch
1242
+
1243
+ # View run details
1244
+ gh run view 123456789
1245
+
1246
+ # View run with verbose logs
1247
+ gh run view 123456789 --log
1248
+
1249
+ # View specific job
1250
+ gh run view 123456789 --job 987654321
1251
+
1252
+ # View in browser
1253
+ gh run view 123456789 --web
1254
+
1255
+ # Watch run in real-time
1256
+ gh run watch 123456789
1257
+
1258
+ # Watch with interval
1259
+ gh run watch 123456789 --interval 5
1260
+
1261
+ # Rerun failed run
1262
+ gh run rerun 123456789
1263
+
1264
+ # Rerun specific job
1265
+ gh run rerun 123456789 --job 987654321
1266
+
1267
+ # Cancel run
1268
+ gh run cancel 123456789
1269
+
1270
+ # Delete run
1271
+ gh run delete 123456789
1272
+
1273
+ # Download run artifacts
1274
+ gh run download 123456789
1275
+
1276
+ # Download specific artifact
1277
+ gh run download 123456789 --name build
1278
+
1279
+ # Download to directory
1280
+ gh run download 123456789 --dir ./artifacts
1281
+ ```
1282
+
1283
+ ### Workflows (gh workflow)
1284
+
1285
+ ```bash
1286
+ # List workflows
1287
+ gh workflow list
1288
+
1289
+ # View workflow details
1290
+ gh workflow view ci.yml
1291
+
1292
+ # View workflow YAML
1293
+ gh workflow view ci.yml --yaml
1294
+
1295
+ # View in browser
1296
+ gh workflow view ci.yml --web
1297
+
1298
+ # Enable workflow
1299
+ gh workflow enable ci.yml
1300
+
1301
+ # Disable workflow
1302
+ gh workflow disable ci.yml
1303
+
1304
+ # Run workflow manually
1305
+ gh workflow run ci.yml
1306
+
1307
+ # Run with inputs
1308
+ gh workflow run ci.yml \
1309
+ --raw-field \
1310
+ version="1.0.0" \
1311
+ environment="production"
1312
+
1313
+ # Run from specific branch
1314
+ gh workflow run ci.yml --ref develop
1315
+ ```
1316
+
1317
+ ### Action Caches (gh cache)
1318
+
1319
+ ```bash
1320
+ # List caches
1321
+ gh cache list
1322
+
1323
+ # List for specific branch
1324
+ gh cache list --branch main
1325
+
1326
+ # List with limit
1327
+ gh cache list --limit 50
1328
+
1329
+ # Delete cache
1330
+ gh cache delete 123456789
1331
+
1332
+ # Delete all caches
1333
+ gh cache delete --all
1334
+ ```
1335
+
1336
+ ### Action Secrets (gh secret)
1337
+
1338
+ ```bash
1339
+ # List secrets
1340
+ gh secret list
1341
+
1342
+ # Set secret (prompts for value)
1343
+ gh secret set MY_SECRET
1344
+
1345
+ # Set secret from environment
1346
+ echo "$MY_SECRET" | gh secret set MY_SECRET
1347
+
1348
+ # Set secret for specific environment
1349
+ gh secret set MY_SECRET --env production
1350
+
1351
+ # Set secret for organization
1352
+ gh secret set MY_SECRET --org orgname
1353
+
1354
+ # Delete secret
1355
+ gh secret delete MY_SECRET
1356
+
1357
+ # Delete from environment
1358
+ gh secret delete MY_SECRET --env production
1359
+ ```
1360
+
1361
+ ### Action Variables (gh variable)
1362
+
1363
+ ```bash
1364
+ # List variables
1365
+ gh variable list
1366
+
1367
+ # Set variable
1368
+ gh variable set MY_VAR "some-value"
1369
+
1370
+ # Set variable for environment
1371
+ gh variable set MY_VAR "value" --env production
1372
+
1373
+ # Set variable for organization
1374
+ gh variable set MY_VAR "value" --org orgname
1375
+
1376
+ # Get variable value
1377
+ gh variable get MY_VAR
1378
+
1379
+ # Delete variable
1380
+ gh variable delete MY_VAR
1381
+
1382
+ # Delete from environment
1383
+ gh variable delete MY_VAR --env production
1384
+ ```
1385
+
1386
+ ## Projects (gh project)
1387
+
1388
+ ```bash
1389
+ # List projects
1390
+ gh project list
1391
+
1392
+ # List for owner
1393
+ gh project list --owner owner
1394
+
1395
+ # Open projects
1396
+ gh project list --open
1397
+
1398
+ # View project
1399
+ gh project view 123
1400
+
1401
+ # View project items
1402
+ gh project view 123 --format json
1403
+
1404
+ # Create project
1405
+ gh project create --title "My Project"
1406
+
1407
+ # Create in organization
1408
+ gh project create --title "Project" --org orgname
1409
+
1410
+ # Create with readme
1411
+ gh project create --title "Project" --readme "Description here"
1412
+
1413
+ # Edit project
1414
+ gh project edit 123 --title "New Title"
1415
+
1416
+ # Delete project
1417
+ gh project delete 123
1418
+
1419
+ # Close project
1420
+ gh project close 123
1421
+
1422
+ # Copy project
1423
+ gh project copy 123 --owner target-owner --title "Copy"
1424
+
1425
+ # Mark template
1426
+ gh project mark-template 123
1427
+
1428
+ # List fields
1429
+ gh project field-list 123
1430
+
1431
+ # Create field
1432
+ gh project field-create 123 --title "Status" --datatype single_select
1433
+
1434
+ # Delete field
1435
+ gh project field-delete 123 --id 456
1436
+
1437
+ # List items
1438
+ gh project item-list 123
1439
+
1440
+ # Create item
1441
+ gh project item-create 123 --title "New item"
1442
+
1443
+ # Add item to project
1444
+ gh project item-add 123 --owner-owner --repo repo --issue 456
1445
+
1446
+ # Edit item
1447
+ gh project item-edit 123 --id 456 --title "Updated title"
1448
+
1449
+ # Delete item
1450
+ gh project item-delete 123 --id 456
1451
+
1452
+ # Archive item
1453
+ gh project item-archive 123 --id 456
1454
+
1455
+ # Link items
1456
+ gh project link 123 --id 456 --link-id 789
1457
+
1458
+ # Unlink items
1459
+ gh project unlink 123 --id 456 --link-id 789
1460
+
1461
+ # View project in browser
1462
+ gh project view 123 --web
1463
+ ```
1464
+
1465
+ ## Releases (gh release)
1466
+
1467
+ ```bash
1468
+ # List releases
1469
+ gh release list
1470
+
1471
+ # View latest release
1472
+ gh release view
1473
+
1474
+ # View specific release
1475
+ gh release view v1.0.0
1476
+
1477
+ # View in browser
1478
+ gh release view v1.0.0 --web
1479
+
1480
+ # Create release
1481
+ gh release create v1.0.0 \
1482
+ --notes "Release notes here"
1483
+
1484
+ # Create release with notes from file
1485
+ gh release create v1.0.0 --notes-file notes.md
1486
+
1487
+ # Create release with target
1488
+ gh release create v1.0.0 --target main
1489
+
1490
+ # Create release as draft
1491
+ gh release create v1.0.0 --draft
1492
+
1493
+ # Create pre-release
1494
+ gh release create v1.0.0 --prerelease
1495
+
1496
+ # Create release with title
1497
+ gh release create v1.0.0 --title "Version 1.0.0"
1498
+
1499
+ # Upload asset to release
1500
+ gh release upload v1.0.0 ./file.tar.gz
1501
+
1502
+ # Upload multiple assets
1503
+ gh release upload v1.0.0 ./file1.tar.gz ./file2.tar.gz
1504
+
1505
+ # Upload with label (casing sensitive)
1506
+ gh release upload v1.0.0 ./file.tar.gz --casing
1507
+
1508
+ # Delete release
1509
+ gh release delete v1.0.0
1510
+
1511
+ # Delete with cleanup tag
1512
+ gh release delete v1.0.0 --yes
1513
+
1514
+ # Delete specific asset
1515
+ gh release delete-asset v1.0.0 file.tar.gz
1516
+
1517
+ # Download release assets
1518
+ gh release download v1.0.0
1519
+
1520
+ # Download specific asset
1521
+ gh release download v1.0.0 --pattern "*.tar.gz"
1522
+
1523
+ # Download to directory
1524
+ gh release download v1.0.0 --dir ./downloads
1525
+
1526
+ # Download archive (zip/tar)
1527
+ gh release download v1.0.0 --archive zip
1528
+
1529
+ # Edit release
1530
+ gh release edit v1.0.0 --notes "Updated notes"
1531
+
1532
+ # Verify release signature
1533
+ gh release verify v1.0.0
1534
+
1535
+ # Verify specific asset
1536
+ gh release verify-asset v1.0.0 file.tar.gz
1537
+ ```
1538
+
1539
+ ## Gists (gh gist)
1540
+
1541
+ ```bash
1542
+ # List gists
1543
+ gh gist list
1544
+
1545
+ # List all gists (including private)
1546
+ gh gist list --public
1547
+
1548
+ # Limit results
1549
+ gh gist list --limit 20
1550
+
1551
+ # View gist
1552
+ gh gist view abc123
1553
+
1554
+ # View gist files
1555
+ gh gist view abc123 --files
1556
+
1557
+ # Create gist
1558
+ gh gist create script.py
1559
+
1560
+ # Create gist with description
1561
+ gh gist create script.py --desc "My script"
1562
+
1563
+ # Create public gist
1564
+ gh gist create script.py --public
1565
+
1566
+ # Create multi-file gist
1567
+ gh gist create file1.py file2.py
1568
+
1569
+ # Create from stdin
1570
+ echo "print('hello')" | gh gist create
1571
+
1572
+ # Edit gist
1573
+ gh gist edit abc123
1574
+
1575
+ # Delete gist
1576
+ gh gist delete abc123
1577
+
1578
+ # Rename gist file
1579
+ gh gist rename abc123 --filename old.py new.py
1580
+
1581
+ # Clone gist
1582
+ gh gist clone abc123
1583
+
1584
+ # Clone to directory
1585
+ gh gist clone abc123 my-directory
1586
+ ```
1587
+
1588
+ ## Codespaces (gh codespace)
1589
+
1590
+ ```bash
1591
+ # List codespaces
1592
+ gh codespace list
1593
+
1594
+ # Create codespace
1595
+ gh codespace create
1596
+
1597
+ # Create with specific repository
1598
+ gh codespace create --repo owner/repo
1599
+
1600
+ # Create with branch
1601
+ gh codespace create --branch develop
1602
+
1603
+ # Create with specific machine
1604
+ gh codespace create --machine premiumLinux
1605
+
1606
+ # View codespace details
1607
+ gh codespace view
1608
+
1609
+ # SSH into codespace
1610
+ gh codespace ssh
1611
+
1612
+ # SSH with specific command
1613
+ gh codespace ssh --command "cd /workspaces && ls"
1614
+
1615
+ # Open codespace in browser
1616
+ gh codespace code
1617
+
1618
+ # Open in VS Code
1619
+ gh codespace code --codec
1620
+
1621
+ # Open with specific path
1622
+ gh codespace code --path /workspaces/repo
1623
+
1624
+ # Stop codespace
1625
+ gh codespace stop
1626
+
1627
+ # Delete codespace
1628
+ gh codespace delete
1629
+
1630
+ # View logs
1631
+ gh codespace logs
1632
+
1633
+ --tail 100
1634
+
1635
+ # View ports
1636
+ gh codespace ports
1637
+
1638
+ # Forward port
1639
+ gh codespace cp 8080:8080
1640
+
1641
+ # Rebuild codespace
1642
+ gh codespace rebuild
1643
+
1644
+ # Edit codespace
1645
+ gh codespace edit --machine standardLinux
1646
+
1647
+ # Jupyter support
1648
+ gh codespace jupyter
1649
+
1650
+ # Copy files to/from codespace
1651
+ gh codespace cp file.txt :/workspaces/file.txt
1652
+ gh codespace cp :/workspaces/file.txt ./file.txt
1653
+ ```
1654
+
1655
+ ## Organizations (gh org)
1656
+
1657
+ ```bash
1658
+ # List organizations
1659
+ gh org list
1660
+
1661
+ # List for user
1662
+ gh org list --user username
1663
+
1664
+ # JSON output
1665
+ gh org list --json login,name,description
1666
+
1667
+ # View organization
1668
+ gh org view orgname
1669
+
1670
+ # View organization members
1671
+ gh org view orgname --json members --jq '.members[] | .login'
1672
+ ```
1673
+
1674
+ ## Search (gh search)
1675
+
1676
+ ```bash
1677
+ # Search code
1678
+ gh search code "TODO"
1679
+
1680
+ # Search in specific repository
1681
+ gh search code "TODO" --repo owner/repo
1682
+
1683
+ # Search commits
1684
+ gh search commits "fix bug"
1685
+
1686
+ # Search issues
1687
+ gh search issues "label:bug state:open"
1688
+
1689
+ # Search PRs
1690
+ gh search prs "is:open is:pr review:required"
1691
+
1692
+ # Search repositories
1693
+ gh search repos "stars:>1000 language:python"
1694
+
1695
+ # Limit results
1696
+ gh search repos "topic:api" --limit 50
1697
+
1698
+ # JSON output
1699
+ gh search repos "stars:>100" --json name,description,stargazers
1700
+
1701
+ # Order results
1702
+ gh search repos "language:rust" --order desc --sort stars
1703
+
1704
+ # Search with extensions
1705
+ gh search code "import" --extension py
1706
+
1707
+ # Web search (open in browser)
1708
+ gh search prs "is:open" --web
1709
+ ```
1710
+
1711
+ ## Labels (gh label)
1712
+
1713
+ ```bash
1714
+ # List labels
1715
+ gh label list
1716
+
1717
+ # Create label
1718
+ gh label create bug --color "d73a4a" --description "Something isn't working"
1719
+
1720
+ # Create with hex color
1721
+ gh label create enhancement --color "#a2eeef"
1722
+
1723
+ # Edit label
1724
+ gh label edit bug --name "bug-report" --color "ff0000"
1725
+
1726
+ # Delete label
1727
+ gh label delete bug
1728
+
1729
+ # Clone labels from repository
1730
+ gh label clone owner/repo
1731
+
1732
+ # Clone to specific repository
1733
+ gh label clone owner/repo --repo target/repo
1734
+ ```
1735
+
1736
+ ## SSH Keys (gh ssh-key)
1737
+
1738
+ ```bash
1739
+ # List SSH keys
1740
+ gh ssh-key list
1741
+
1742
+ # Add SSH key
1743
+ gh ssh-key add ~/.ssh/id_rsa.pub --title "My laptop"
1744
+
1745
+ # Add key with type
1746
+ gh ssh-key add ~/.ssh/id_ed25519.pub --type "authentication"
1747
+
1748
+ # Delete SSH key
1749
+ gh ssh-key delete 12345
1750
+
1751
+ # Delete by title
1752
+ gh ssh-key delete --title "My laptop"
1753
+ ```
1754
+
1755
+ ## GPG Keys (gh gpg-key)
1756
+
1757
+ ```bash
1758
+ # List GPG keys
1759
+ gh gpg-key list
1760
+
1761
+ # Add GPG key
1762
+ gh gpg-key add ~/.ssh/id_rsa.pub
1763
+
1764
+ # Delete GPG key
1765
+ gh gpg-key delete 12345
1766
+
1767
+ # Delete by key ID
1768
+ gh gpg-key delete ABCD1234
1769
+ ```
1770
+
1771
+ ## Status (gh status)
1772
+
1773
+ ```bash
1774
+ # Show status overview
1775
+ gh status
1776
+
1777
+ # Status for specific repositories
1778
+ gh status --repo owner/repo
1779
+
1780
+ # JSON output
1781
+ gh status --json
1782
+ ```
1783
+
1784
+ ## Configuration (gh config)
1785
+
1786
+ ```bash
1787
+ # List all config
1788
+ gh config list
1789
+
1790
+ # Get specific value
1791
+ gh config get editor
1792
+
1793
+ # Set value
1794
+ gh config set editor vim
1795
+
1796
+ # Set git protocol
1797
+ gh config set git_protocol ssh
1798
+
1799
+ # Clear cache
1800
+ gh config clear-cache
1801
+
1802
+ # Set prompt behavior
1803
+ gh config set prompt disabled
1804
+ gh config set prompt enabled
1805
+ ```
1806
+
1807
+ ## Extensions (gh extension)
1808
+
1809
+ ```bash
1810
+ # List installed extensions
1811
+ gh extension list
1812
+
1813
+ # Search extensions
1814
+ gh extension search github
1815
+
1816
+ # Install extension
1817
+ gh extension install owner/extension-repo
1818
+
1819
+ # Install from branch
1820
+ gh extension install owner/extension-repo --branch develop
1821
+
1822
+ # Upgrade extension
1823
+ gh extension upgrade extension-name
1824
+
1825
+ # Remove extension
1826
+ gh extension remove extension-name
1827
+
1828
+ # Create new extension
1829
+ gh extension create my-extension
1830
+
1831
+ # Browse extensions
1832
+ gh extension browse
1833
+
1834
+ # Execute extension command
1835
+ gh extension exec my-extension --arg value
1836
+ ```
1837
+
1838
+ ## Aliases (gh alias)
1839
+
1840
+ ```bash
1841
+ # List aliases
1842
+ gh alias list
1843
+
1844
+ # Set alias
1845
+ gh alias set prview 'pr view --web'
1846
+
1847
+ # Set shell alias
1848
+ gh alias set co 'pr checkout' --shell
1849
+
1850
+ # Delete alias
1851
+ gh alias delete prview
1852
+
1853
+ # Import aliases
1854
+ gh alias import ./aliases.sh
1855
+ ```
1856
+
1857
+ ## API Requests (gh api)
1858
+
1859
+ ```bash
1860
+ # Make API request
1861
+ gh api /user
1862
+
1863
+ # Request with method
1864
+ gh api --method POST /repos/owner/repo/issues \
1865
+ --field title="Issue title" \
1866
+ --field body="Issue body"
1867
+
1868
+ # Request with headers
1869
+ gh api /user \
1870
+ --header "Accept: application/vnd.github.v3+json"
1871
+
1872
+ # Request with pagination
1873
+ gh api /user/repos --paginate
1874
+
1875
+ # Raw output (no formatting)
1876
+ gh api /user --raw
1877
+
1878
+ # Include headers in output
1879
+ gh api /user --include
1880
+
1881
+ # Silent mode (no progress output)
1882
+ gh api /user --silent
1883
+
1884
+ # Input from file
1885
+ gh api --input request.json
1886
+
1887
+ # jq query on response
1888
+ gh api /user --jq '.login'
1889
+
1890
+ # Field from response
1891
+ gh api /repos/owner/repo --jq '.stargazers_count'
1892
+
1893
+ # GitHub Enterprise
1894
+ gh api /user --hostname enterprise.internal
1895
+
1896
+ # GraphQL query
1897
+ gh api graphql \
1898
+ -f query='
1899
+ {
1900
+ viewer {
1901
+ login
1902
+ repositories(first: 5) {
1903
+ nodes {
1904
+ name
1905
+ }
1906
+ }
1907
+ }
1908
+ }'
1909
+ ```
1910
+
1911
+ ## Rulesets (gh ruleset)
1912
+
1913
+ ```bash
1914
+ # List rulesets
1915
+ gh ruleset list
1916
+
1917
+ # View ruleset
1918
+ gh ruleset view 123
1919
+
1920
+ # Check ruleset
1921
+ gh ruleset check --branch feature
1922
+
1923
+ # Check specific repository
1924
+ gh ruleset check --repo owner/repo --branch main
1925
+ ```
1926
+
1927
+ ## Attestations (gh attestation)
1928
+
1929
+ ```bash
1930
+ # Download attestation
1931
+ gh attestation download owner/repo \
1932
+ --artifact-id 123456
1933
+
1934
+ # Verify attestation
1935
+ gh attestation verify owner/repo
1936
+
1937
+ # Get trusted root
1938
+ gh attestation trusted-root
1939
+ ```
1940
+
1941
+ ## Completion (gh completion)
1942
+
1943
+ ```bash
1944
+ # Generate shell completion
1945
+ gh completion -s bash > ~/.gh-complete.bash
1946
+ gh completion -s zsh > ~/.gh-complete.zsh
1947
+ gh completion -s fish > ~/.gh-complete.fish
1948
+ gh completion -s powershell > ~/.gh-complete.ps1
1949
+
1950
+ # Shell-specific instructions
1951
+ gh completion --shell=bash
1952
+ gh completion --shell=zsh
1953
+ ```
1954
+
1955
+ ## Preview (gh preview)
1956
+
1957
+ ```bash
1958
+ # List preview features
1959
+ gh preview
1960
+
1961
+ # Run preview script
1962
+ gh preview prompter
1963
+ ```
1964
+
1965
+ ## Agent Tasks (gh agent-task)
1966
+
1967
+ ```bash
1968
+ # List agent tasks
1969
+ gh agent-task list
1970
+
1971
+ # View agent task
1972
+ gh agent-task view 123
1973
+
1974
+ # Create agent task
1975
+ gh agent-task create --description "My task"
1976
+ ```
1977
+
1978
+ ## Global Flags
1979
+
1980
+ | Flag | Description |
1981
+ | -------------------------- | -------------------------------------- |
1982
+ | `--help` / `-h` | Show help for command |
1983
+ | `--version` | Show gh version |
1984
+ | `--repo [HOST/]OWNER/REPO` | Select another repository |
1985
+ | `--hostname HOST` | GitHub hostname |
1986
+ | `--jq EXPRESSION` | Filter JSON output |
1987
+ | `--json FIELDS` | Output JSON with specified fields |
1988
+ | `--template STRING` | Format JSON using Go template |
1989
+ | `--web` | Open in browser |
1990
+ | `--paginate` | Make additional API calls |
1991
+ | `--verbose` | Show verbose output |
1992
+ | `--debug` | Show debug output |
1993
+ | `--timeout SECONDS` | Maximum API request duration |
1994
+ | `--cache CACHE` | Cache control (default, force, bypass) |
1995
+
1996
+ ## Output Formatting
1997
+
1998
+ ### JSON Output
1999
+
2000
+ ```bash
2001
+ # Basic JSON
2002
+ gh repo view --json name,description
2003
+
2004
+ # Nested fields
2005
+ gh repo view --json owner,name --jq '.owner.login + "/" + .name'
2006
+
2007
+ # Array operations
2008
+ gh pr list --json number,title --jq '.[] | select(.number > 100)'
2009
+
2010
+ # Complex queries
2011
+ gh issue list --json number,title,labels \
2012
+ --jq '.[] | {number, title: .title, tags: [.labels[].name]}'
2013
+ ```
2014
+
2015
+ ### Template Output
2016
+
2017
+ ```bash
2018
+ # Custom template
2019
+ gh repo view \
2020
+ --template '{{.name}}: {{.description}}'
2021
+
2022
+ # Multiline template
2023
+ gh pr view 123 \
2024
+ --template 'Title: {{.title}}
2025
+ Author: {{.author.login}}
2026
+ State: {{.state}}
2027
+ '
2028
+ ```
2029
+
2030
+ ## Common Workflows
2031
+
2032
+ ### Create PR from Issue
2033
+
2034
+ ```bash
2035
+ # Create branch from issue
2036
+ gh issue develop 123 --branch feature/issue-123
2037
+
2038
+ # Make changes, commit, push
2039
+ git add .
2040
+ git commit -m "Fix issue #123"
2041
+ git push
2042
+
2043
+ # Create PR linking to issue
2044
+ gh pr create --title "Fix #123" --body "Closes #123"
2045
+ ```
2046
+
2047
+ ### Bulk Operations
2048
+
2049
+ ```bash
2050
+ # Close multiple issues
2051
+ gh issue list --search "label:stale" \
2052
+ --json number \
2053
+ --jq '.[].number' | \
2054
+ xargs -I {} gh issue close {} --comment "Closing as stale"
2055
+
2056
+ # Add label to multiple PRs
2057
+ gh pr list --search "review:required" \
2058
+ --json number \
2059
+ --jq '.[].number' | \
2060
+ xargs -I {} gh pr edit {} --add-label needs-review
2061
+ ```
2062
+
2063
+ ### Repository Setup Workflow
2064
+
2065
+ ```bash
2066
+ # Create repository with initial setup
2067
+ gh repo create my-project --public \
2068
+ --description "My awesome project" \
2069
+ --clone \
2070
+ --gitignore python \
2071
+ --license mit
2072
+
2073
+ cd my-project
2074
+
2075
+ # Set up branches
2076
+ git checkout -b develop
2077
+ git push -u origin develop
2078
+
2079
+ # Create labels
2080
+ gh label create bug --color "d73a4a" --description "Bug report"
2081
+ gh label create enhancement --color "a2eeef" --description "Feature request"
2082
+ gh label create documentation --color "0075ca" --description "Documentation"
2083
+ ```
2084
+
2085
+ ### CI/CD Workflow
2086
+
2087
+ ```bash
2088
+ # Run workflow and wait
2089
+ RUN_ID=$(gh workflow run ci.yml --ref main --jq '.databaseId')
2090
+
2091
+ # Watch the run
2092
+ gh run watch "$RUN_ID"
2093
+
2094
+ # Download artifacts on completion
2095
+ gh run download "$RUN_ID" --dir ./artifacts
2096
+ ```
2097
+
2098
+ ### Fork Sync Workflow
2099
+
2100
+ ```bash
2101
+ # Fork repository
2102
+ gh repo fork original/repo --clone
2103
+
2104
+ cd repo
2105
+
2106
+ # Add upstream remote
2107
+ git remote add upstream https://github.com/original/repo.git
2108
+
2109
+ # Sync fork
2110
+ gh repo sync
2111
+
2112
+ # Or manual sync
2113
+ git fetch upstream
2114
+ git checkout main
2115
+ git merge upstream/main
2116
+ git push origin main
2117
+ ```
2118
+
2119
+ ## Environment Setup
2120
+
2121
+ ### Shell Integration
2122
+
2123
+ ```bash
2124
+ # Add to ~/.bashrc or ~/.zshrc
2125
+ eval "$(gh completion -s bash)" # or zsh/fish
2126
+
2127
+ # Create useful aliases
2128
+ alias gs='gh status'
2129
+ alias gpr='gh pr view --web'
2130
+ alias gir='gh issue view --web'
2131
+ alias gco='gh pr checkout'
2132
+ ```
2133
+
2134
+ ### Git Configuration
2135
+
2136
+ ```bash
2137
+ # Use gh as credential helper
2138
+ gh auth setup-git
2139
+
2140
+ # Set gh as default for repo operations
2141
+ git config --global credential.helper 'gh !gh auth setup-git'
2142
+
2143
+ # Or manually
2144
+ git config --global credential.helper github
2145
+ ```
2146
+
2147
+ ## Best Practices
2148
+
2149
+ 1. **Authentication**: Use environment variables for automation
2150
+
2151
+ ```bash
2152
+ export GH_TOKEN=$(gh auth token)
2153
+ ```
2154
+
2155
+ 2. **Default Repository**: Set default to avoid repetition
2156
+
2157
+ ```bash
2158
+ gh repo set-default owner/repo
2159
+ ```
2160
+
2161
+ 3. **JSON Parsing**: Use jq for complex data extraction
2162
+
2163
+ ```bash
2164
+ gh pr list --json number,title --jq '.[] | select(.title | contains("fix"))'
2165
+ ```
2166
+
2167
+ 4. **Pagination**: Use --paginate for large result sets
2168
+
2169
+ ```bash
2170
+ gh issue list --state all --paginate
2171
+ ```
2172
+
2173
+ 5. **Caching**: Use cache control for frequently accessed data
2174
+ ```bash
2175
+ gh api /user --cache force
2176
+ ```
2177
+
2178
+ ## Getting Help
2179
+
2180
+ ```bash
2181
+ # General help
2182
+ gh --help
2183
+
2184
+ # Command help
2185
+ gh pr --help
2186
+ gh issue create --help
2187
+
2188
+ # Help topics
2189
+ gh help formatting
2190
+ gh help environment
2191
+ gh help exit-codes
2192
+ gh help accessibility
2193
+ ```
2194
+
2195
+ ## References
2196
+
2197
+ - Official Manual: https://cli.github.com/manual/
2198
+ - GitHub Docs: https://docs.github.com/en/github-cli
2199
+ - REST API: https://docs.github.com/en/rest
2200
+ - GraphQL API: https://docs.github.com/en/graphql