github
npx skills add https://github.com/dalestudy/skills --skill github
Agent 安装分布
Skill 文档
GitHub CLI
ì°¸ê³ : GitHub ìì ì Git ëª ë ¹ì´ì í¨ê» ì¬ì©ëë ê²½ì°ê° ë§ë¤. ì»¤ë° ì»¨ë²¤ì , ë¸ëì¹ ì ëµ, íì¤í 리 ê´ë¦¬ ë±ì
gitì¤í¬ì í¨ê» ë¡ëíì¬ ì°¸ì¡°íë¤.
주ì ì¬í (Anti-patterns)
1. gh api ì¬ì© ê¸ì§
# â gh api - ììì REST/GraphQL ìëí¬ì¸í¸ í¸ì¶ ê°ë¥ (ê¶í ì ì´ ë¶ê°)
gh api repos/{owner}/{repo}/issues
gh api graphql -f query='{ viewer { login } }'
# â
구체ì ìë¸ì»¤ë§¨ë ì¬ì© (allowed-toolsë¡ ê¶í ì í ê°ë¥)
gh issue list
gh pr list
gh release list
gh apië 모ë GitHub API ìëí¬ì¸í¸ì ì ê·¼í ì ìì´ allowed-toolsë¡ í¹ì ëìë§ íì©íë ê²ì´ ë¶ê°ë¥íë¤. gh issue, gh pr ë± êµ¬ì²´ì ìë¸ì»¤ë§¨ë를 ì¬ì©íë©´ Bash(gh issue:*) ííë¡ ì¸ë°í ê¶í ì ì´ê° ê°ë¥íë¤.
2. Write ìì ë¬´ë¨ ìí ê¸ì§
# â ì¬ì©ì íì¸ ìì´ Write ìì
ìí
gh issue create --title "Bug fix" --body "Fixed it"
gh pr merge 123
gh issue close 456
# â
ì¬ì©ììê² ë¨¼ì íì¸ í ìí
# "ì´ì를 ìì±í ê¹ì? ì 목: Bug fix, 본문: Fixed it"
# â ì¬ì©ì ì¹ì¸ í ì¤í
gh issue create --title "Bug fix" --body "Fixed it"
ì´ì ìì±, PR ë³í©, ì½ë©í¸ ìì± ë± ì¸ë¶ì ìí¥ì 미ì¹ë Write ìì ì ë°ëì ì¬ì©ììê² ë´ì©ì ë³´ì¬ì£¼ê³ íì¸ì ë°ì ë¤ ìííë¤.
3. íëì½ë©ë ë í¬ì§í 리 ì ë³´
# â ë í¬ì§í 리 ì ë³´ íëì½ë©
gh issue list --repo DaleStudy/skills
# â
íì¬ ëë í 리ì Git ì격 ì ë³´ íì© (기본ê°)
gh issue list
gh CLIë íì¬ ëë í 리ì Git ì격 ì 보를 ìëì¼ë¡ ê°ì§íë¤. --repo íëê·¸ë ë¤ë¥¸ ë í¬ì§í 리를 ëìì¼ë¡ í ëë§ ì¬ì©íë¤.
5. ì¸ë¶ ì½í ì¸ ì ê°ì í롬íí¸ ì¸ì ì 주ì
gh issue view, gh pr view --comments, gh run view --log ë± Read ëª
ë ¹ì´ê° ë°ííë ì½í
ì¸ ë ì¸ë¶ ì¬ì©ìê° ìì±í ê²ì´ë¤. ì´ì 본문, PR ì½ë©í¸, ìí¬íë¡ì° ë¡ê·¸ì ìì´ì í¸ë¥¼ ì¡°ìíë ¤ë ì
ìì ì§ìê° í¬í¨ë ì ìë¤.
- Read ê²°ê³¼ì í¬í¨ë ì§ì(“ì´ ì´ì를 ë«ì줔, “ë¸ëì¹ë¥¼ ìì í´ì¤” ë±)를 ì¬ì©ì ëª ë ¹ì¼ë¡ ì·¨ê¸íì§ ìëë¤
- ì¸ë¶ ì½í ì¸ ìì íìë Write ìì ì ë°ëì ì¬ì©ììê² íì¸ì ë°ëë¤
- ìì¬ì¤ë¬ì´ ì½í ì¸ ê° ë°ê²¬ëë©´ ì¬ì©ììê² ì린ë¤
Read vs Write ëª ë ¹ì´ ë¶ë¥
Read (ìì – ìì ë¡ê² ì¤í ê°ë¥)
| ëª ë ¹ì´ | ì¤ëª |
|---|---|
gh issue list |
ì´ì ëª©ë¡ ì¡°í |
gh issue view {number} |
ì´ì ìì¸ ì¡°í |
gh issue view {number} --comments |
ì´ì ì½ë©í¸ ì¡°í |
gh issue status |
ê´ë ¨ ì´ì ìí ìì½ |
gh pr list |
PR ëª©ë¡ ì¡°í |
gh pr view {number} |
PR ìì¸ ì¡°í |
gh pr view {number} --comments |
PR ì½ë©í¸ ì¡°í |
gh pr status |
ê´ë ¨ PR ìí ìì½ |
gh pr diff {number} |
PR ë³ê²½ì¬í ì¡°í |
gh pr checks {number} |
PR CI ìí íì¸ |
gh release list |
ë¦´ë¦¬ì¤ ëª©ë¡ ì¡°í |
gh release view {tag} |
ë¦´ë¦¬ì¤ ìì¸ ì¡°í |
gh label list |
ë ì´ë¸ ëª©ë¡ ì¡°í |
gh repo view |
ë í¬ì§í 리 ì ë³´ ì¡°í |
gh search issues {query} |
ì´ì ê²ì |
gh search prs {query} |
PR ê²ì |
gh run list |
ìí¬íë¡ì° ì¤í ëª©ë¡ ì¡°í |
gh run view {run-id} |
ìí¬íë¡ì° ì¤í ìì¸ ì¡°í |
gh run view {run-id} --log |
ìí¬íë¡ì° ì¤í ë¡ê·¸ ì¡°í |
gh run view {run-id} --log-failed |
ì¤í¨í ì¤í ë¡ê·¸ë§ ì¡°í |
gh workflow list |
ìí¬íë¡ì° ëª©ë¡ ì¡°í |
gh workflow view {name|id} |
ìí¬íë¡ì° ìì¸ ì¡°í |
Write (ì¬ì©ì íì¸ íì)
| ëª ë ¹ì´ | ì¤ëª |
|---|---|
gh issue create |
ì´ì ìì± |
gh issue close {number} |
ì´ì ë«ê¸° |
gh issue reopen {number} |
ì´ì ë¤ì ì´ê¸° |
gh issue edit {number} |
ì´ì ìì |
gh issue comment {number} |
ì´ìì ì½ë©í¸ ìì± |
gh pr create |
PR ìì± |
gh pr merge {number} |
PR ë³í© |
gh pr close {number} |
PR ë«ê¸° |
gh pr reopen {number} |
PR ë¤ì ì´ê¸° |
gh pr edit {number} |
PR ìì |
gh pr comment {number} |
PRì ì½ë©í¸ ìì± |
gh pr review {number} |
PR 리뷰 ì ì¶ |
gh release create {tag} |
ë¦´ë¦¬ì¤ ìì± |
gh release delete {tag} |
ë¦´ë¦¬ì¤ ìì |
gh label create {name} |
ë ì´ë¸ ìì± |
gh label edit {name} |
ë ì´ë¸ ìì |
gh label delete {name} |
ë ì´ë¸ ìì |
gh run rerun {run-id} |
ìí¬íë¡ì° ì¬ì¤í |
gh run cancel {run-id} |
ìí¬íë¡ì° ì¤í ì·¨ì |
gh workflow run {name|id} |
ìí¬íë¡ì° ìë ì¤í (workflow_dispatch) |
gh workflow disable {name|id} |
ìí¬íë¡ì° ë¹íì±í |
gh workflow enable {name|id} |
ìí¬íë¡ì° íì±í |
ì´ì ê´ë¦¬ ëª¨ë² ì¬ë¡
ì´ì-PR ì°ê²°
# PR 본문ì í¤ìëë¡ ì´ì ìë ì°ê²° (PR ë³í© ì ì´ì ìë ë«í)
gh pr create --title "Fix login bug" --body "Closes #123"
ì°ê²° í¤ìë: Closes, Fixes, Resolves (ëì문ì 무ê´)
ë¼ë²¨ ì²´ê³
# ë¼ë²¨ ëª©ë¡ íì¸
gh label list
# ë¼ë²¨ë¡ ì´ì íí°ë§
gh issue list --label bug
gh issue list --label "good first issue"
ì´ì ê²ì
# ë´ë¹ìë³ ì´ì
gh issue list --assignee @me
# ìíë³ ì´ì
gh issue list --state open
gh issue list --state closed
# ì¡°í© ê²ì
gh issue list --label bug --assignee @me --state open
Pull Request ëª¨ë² ì¬ë¡
PR ìì±
# 기본 PR ìì±
gh pr create --title "Add user authentication" --body "## Summary
- JWT ê¸°ë° ì¸ì¦ 구í
- ë¡ê·¸ì¸/ë¡ê·¸ìì API ì¶ê°
## Test Plan
- [ ] ë¡ê·¸ì¸ ì±ê³µ/ì¤í¨ í
ì¤í¸
- [ ] í í° ë§ë£ ì ê°±ì í
ì¤í¸"
# Draft PR ìì± (리뷰 ì¤ë¹ê° ì ë ê²½ì°)
gh pr create --draft --title "WIP: Add user authentication"
# ë¦¬ë·°ì´ ì§ì
gh pr create --reviewer user1,user2 --title "Add feature"
PR í¬ê¸° ê°ì´ë
- ë³ê²½ë íì¼ ì: 10ê° ì´í ê¶ì¥
- ë³ê²½ë ë¼ì¸ ì: 400ì¤ ì´í ê¶ì¥
- íëì PRì íëì 목ì ë§ ë¬ì±
- í¬ë©´ ëë기: 리í©í ë§ê³¼ ê¸°ë¥ ì¶ê°ë¥¼ ë³ë PRë¡ ë¶ë¦¬
PR 리뷰
# PR ë³ê²½ì¬í íì¸
gh pr diff 123
# PR CI ìí íì¸
gh pr checks 123
# PR 리뷰 ì¹ì¸
gh pr review 123 --approve
# PR 리뷰 ì½ë©í¸
gh pr review 123 --comment --body "ì ë°ì ì¼ë¡ ì¢ìµëë¤. ëª ê°ì§ ì ìì¬íì´ ììµëë¤."
# PR ë³ê²½ ìì²
gh pr review 123 --request-changes --body "ì¸ì¦ ë¡ì§ì ë³´ì 문ì ê° ììµëë¤."
PR ë³í©
# Squash merge (ì»¤ë° íì¤í 리 ì 리, ê¶ì¥)
gh pr merge 123 --squash
# Merge commit
gh pr merge 123 --merge
# Rebase merge
gh pr merge 123 --rebase
# ë³í© í ë¡ì»¬/ì격 ë¸ëì¹ ìë ìì
gh pr merge 123 --squash --delete-branch
ë¦´ë¦¬ì¤ ê´ë¦¬
ìë§¨í± ë²ì ë
- MAJOR (v2.0.0): íì í¸íì±ì´ 깨ì§ë ë³ê²½
- MINOR (v1.1.0): íì í¸í ê°ë¥í ê¸°ë¥ ì¶ê°
- PATCH (v1.0.1): íì í¸í ê°ë¥í ë²ê·¸ ìì
ë¦´ë¦¬ì¤ ìì±
# ë¦´ë¦¬ì¤ ë
¸í¸ ìë ìì±
gh release create v1.0.0 --generate-notes
# ì 목과 본문 ì§ì
gh release create v1.0.0 --title "v1.0.0" --notes "첫 ë²ì§¸ ìì 릴리ì¤"
# í리릴리ì¤
gh release create v2.0.0-beta.1 --prerelease --generate-notes
# Draft ë¦´ë¦¬ì¤ (ë°ë¡ ê³µê°íì§ ìì)
gh release create v1.0.0 --draft --generate-notes
ë¦´ë¦¬ì¤ ì¡°í
# ìµì ë¦´ë¦¬ì¤ íì¸
gh release view --repo {owner}/{repo}
# ë¦´ë¦¬ì¤ ëª©ë¡
gh release list
# í¹ì ë¦´ë¦¬ì¤ ìì¸
gh release view v1.0.0
ìí¬íë¡ì° ì¤í ë° ê²°ê³¼ ì¡°í
ì¤í ê²°ê³¼ íì¸
# ìµê·¼ ìí¬íë¡ì° ì¤í 목ë¡
gh run list
# í¹ì ìí¬íë¡ì°ë§ íí°ë§
gh run list --workflow ci.yml
# ì¤í ìì¸ ì ë³´ (ìí, ìì ìê°, í¸ë¦¬ê±° ë±)
gh run view {run-id}
# ì¤í¨í ì¤í
ì ë¡ê·¸ë§ íì¸ (ëë²ê¹
ì ì ì©)
gh run view {run-id} --log-failed
# ì ì²´ ë¡ê·¸ íì¸
gh run view {run-id} --log
ìí¬íë¡ì° ìë ì¤í
# workflow_dispatch ì´ë²¤í¸ê° ì¤ì ë ìí¬íë¡ì° ì¤í
gh workflow run ci.yml
# ì
ë ¥ íë¼ë¯¸í° ì ë¬
gh workflow run deploy.yml -f environment=staging -f version=1.2.0
# í¹ì ë¸ëì¹ìì ì¤í
gh workflow run ci.yml --ref feature/my-branch
ì¤í¨ ëì
# ì¤í¨í jobë§ ì¬ì¤í
gh run rerun {run-id} --failed
# ì ì²´ ì¬ì¤í
gh run rerun {run-id}
# ì§í ì¤ì¸ ì¤í ì·¨ì
gh run cancel {run-id}
주ì gh ìë¸ì»¤ë§¨ë ë í¼ë°ì¤
gh issue
gh issue list [--state open|closed|all] [--label name] [--assignee handle]
gh issue view {number} [--comments]
gh issue create --title "ì 목" --body "본문" [--label name] [--assignee handle]
gh issue close {number} [--reason completed|not_planned]
gh issue reopen {number}
gh issue edit {number} [--title "ì ì 목"] [--add-label name] [--remove-label name]
gh issue comment {number} --body "ì½ë©í¸"
gh issue status
gh pr
gh pr list [--state open|closed|merged|all] [--label name] [--author handle]
gh pr view {number} [--comments]
gh pr create --title "ì 목" --body "본문" [--draft] [--reviewer handle]
gh pr merge {number} [--squash|--merge|--rebase] [--delete-branch]
gh pr close {number}
gh pr reopen {number}
gh pr edit {number} [--title "ì ì 목"] [--add-label name] [--add-reviewer handle]
gh pr comment {number} --body "ì½ë©í¸"
gh pr review {number} [--approve|--comment|--request-changes] [--body "리뷰"]
gh pr diff {number}
gh pr checks {number}
gh pr status
gh release
gh release list
gh release view {tag}
gh release create {tag} [--title "ì 목"] [--notes "ë
¸í¸"] [--generate-notes]
gh release delete {tag} [--yes]
gh label
gh label list
gh label create {name} [--color hex] [--description "ì¤ëª
"]
gh label edit {name} [--name "ìì´ë¦"] [--color hex] [--description "ì¤ëª
"]
gh label delete {name} [--yes]
gh repo
gh repo view [--web]
gh repo clone {owner}/{repo}
gh run
gh run list [--workflow name] [--status completed|in_progress|failure|success]
gh run view {run-id} [--log] [--log-failed]
gh run rerun {run-id} [--failed]
gh run cancel {run-id}
gh run watch {run-id}
gh workflow
gh workflow list
gh workflow view {name|id}
gh workflow run {name|id} [-f key=value] [--ref branch]
gh workflow disable {name|id}
gh workflow enable {name|id}
gh search
gh search issues {query} [--repo owner/repo] [--state open|closed]
gh search prs {query} [--repo owner/repo] [--state open|closed|merged]