@olegkoval/agent-skills 1.0.0-beta.1

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