<< All versions
GitHub CLI (
Skill v1.0.0
currentAutomated scan100/100rafayelgardishyan/rafayels-marketplace/github
──Details
PublishedNovember 20, 2026 at 03:52 AM
Content Hashsha256:724dabf1f04546b3...
Git SHAe21e808f2903
──Files
Files (1 file, 7.4 KB)
SKILL.md7.4 KBactive
SKILL.md · 342 lines · 7.4 KB
name: github description: Manage GitHub repositories, issues, pull requests, releases, actions, and more using the gh CLI. Use when creating repos, managing issues/PRs, checking CI status, creating releases, or any GitHub operations. metadata: version: "1.0.0"
GitHub CLI (gh) Skill
Overview
Use the gh CLI for all GitHub operations. This skill covers repos, issues, pull requests, releases, actions, and repository settings.
Prerequisites
bash
# Check gh is installed and authenticatedgh auth status
If not authenticated: gh auth login
Common Operations
Repository Management
bash
# Create a new repogh repo create <name> --private --source=. --pushgh repo create <name> --public --source=. --push# Clone a repogh repo clone <owner>/<repo># View repo infogh repo view <owner>/<repo># Fork a repogh repo fork <owner>/<repo> --clone# Set default repo (useful in worktrees)gh repo set-default <owner>/<repo># Archive a repogh repo archive <owner>/<repo># Delete a repo (destructive — confirm with user first)gh repo delete <owner>/<repo> --yes# List your reposgh repo list --limit 20gh repo list --language go
Pull Requests
bash
# Create a PRgh pr create --title "feat: description" --body "## Summary\n- Change 1\n- Change 2"# Create PR with body from filegh pr create --title "feat: description" --body-file docs/plans/plan.md# Create draft PRgh pr create --title "wip: description" --draft# List PRsgh pr listgh pr list --state open --author @me# View PR detailsgh pr view <number>gh pr view <number> --json title,body,files,reviews,comments# Check out a PR locallygh pr checkout <number># View PR diffgh pr diff <number># Review a PRgh pr review <number> --approvegh pr review <number> --request-changes --body "Reason"gh pr review <number> --comment --body "Comment"# Merge a PRgh pr merge <number> --squash --delete-branchgh pr merge <number> --mergegh pr merge <number> --rebase# Enable automergegh pr merge <number> --auto --squash# Close a PRgh pr close <number># View PR checks/CI statusgh pr checks <number>gh pr checks <number> --watch# Add labelsgh pr edit <number> --add-label "bug,priority:high"# Add reviewersgh pr edit <number> --add-reviewer username1,username2# View PR commentsgh api repos/<owner>/<repo>/pulls/<number>/comments
Issues
bash
# Create an issuegh issue create --title "Bug: description" --body "Steps to reproduce..."# Create issue with labelsgh issue create --title "feat: description" --label "enhancement" --body-file docs/plans/plan.md# List issuesgh issue listgh issue list --state open --label "bug"gh issue list --assignee @me# View an issuegh issue view <number># Close an issuegh issue close <number> --reason completed# Reopen an issuegh issue reopen <number># Edit an issuegh issue edit <number> --title "New title"gh issue edit <number> --add-label "priority:high"gh issue edit <number> --add-assignee @me# Pin an issuegh issue pin <number># Transfer an issuegh issue transfer <number> <destination-repo># Search issuesgh issue list --search "keyword in:title,body"
GitHub Actions / CI
bash
# List workflow runsgh run listgh run list --workflow=ci.yml# View a specific rungh run view <run-id># Watch a run in progressgh run watch <run-id># View run logsgh run view <run-id> --loggh run view <run-id> --log-failed# Re-run a failed workflowgh run rerun <run-id>gh run rerun <run-id> --failed# Trigger a workflow manuallygh workflow run <workflow-name>gh workflow run <workflow-name> --ref <branch># List workflowsgh workflow list# Disable/enable a workflowgh workflow disable <workflow-name>gh workflow enable <workflow-name>
Releases
bash
# Create a releasegh release create v1.0.0 --title "v1.0.0" --notes "Release notes here"# Create release with auto-generated notesgh release create v1.0.0 --generate-notes# Create draft releasegh release create v1.0.0 --draft --generate-notes# Upload assets to a releasegh release upload v1.0.0 ./dist/binary-linux ./dist/binary-darwin# List releasesgh release list# View a releasegh release view v1.0.0# Delete a releasegh release delete v1.0.0
Labels
bash
# Create a labelgh label create "priority:high" --color FF0000 --description "High priority"# List labelsgh label list# Edit a labelgh label edit "bug" --color 00FF00# Delete a labelgh label delete "old-label"
GitHub API (for anything not covered by built-in commands)
bash
# GET requestgh api repos/<owner>/<repo># POST requestgh api repos/<owner>/<repo>/issues --method POST --field title="Title" --field body="Body"# GraphQL querygh api graphql -f query='{ viewer { login } }'# Paginated resultsgh api repos/<owner>/<repo>/issues --paginate# With jq filteringgh api repos/<owner>/<repo>/pulls --jq '.[].title'
Repository Settings
bash
# Set branch protection (via API)gh api repos/<owner>/<repo>/branches/main/protection \--method PUT \--input - <<EOF{"required_status_checks": {"strict": true,"contexts": ["ci"]},"enforce_admins": true,"required_pull_request_reviews": {"required_approving_review_count": 1},"restrictions": null}EOF# Enable auto-merge on repogh api repos/<owner>/<repo> --method PATCH --field allow_auto_merge=true# Set default branchgh api repos/<owner>/<repo> --method PATCH --field default_branch=main# Add secrets for actionsgh secret set SECRET_NAME --body "secret-value"gh secret list# Add deploy keysgh repo deploy-key add key.pub --title "CI Deploy Key"
Workflow Patterns
Feature Branch → PR → Merge
bash
# 1. Create and push branchgit checkout -b feat/my-feature# ... make changes, commit ...git push -u origin feat/my-feature# 2. Create PRgh pr create --title "feat: my feature" --body "Description"# 3. Wait for CIgh pr checks <number> --watch# 4. Merge when readygh pr merge <number> --squash --delete-branch
Quick Issue → Branch → PR
bash
# 1. Create issuegh issue create --title "feat: add user profiles" --label "enhancement"# 2. Create branch from issuegit checkout -b feat/add-user-profiles# ... implement ...git push -u origin feat/add-user-profiles# 3. Create PR linking the issuegh pr create --title "feat: add user profiles" --body "Closes #<issue-number>"
Release Flow
bash
# 1. Create release branchgit checkout -b release/v1.0.0git push -u origin release/v1.0.0# 2. Create PR for releasegh pr create --title "Release v1.0.0" --base main# 3. After merge, tag and releasegh release create v1.0.0 --generate-notes --target main
Tips
- Use
--jsonflag with--jqfor machine-readable output - Use
--webflag to open any resource in the browser:gh pr view <number> --web - Set
GH_REPOenv var to avoid specifying owner/repo in every command - Use
gh alias setto create shortcuts for common operations - PR descriptions support markdown — use
--body-filefor complex descriptions
Common Mistakes
| Mistake | Fix | |
|---|---|---|
| Force pushing without checking PR status | Always gh pr checks before force push | |
| Creating PR from main branch | Create a feature branch first | |
| Forgetting to link issues | Use "Closes #N" or "Fixes #N" in PR body | |
| Not checking CI before merge | Use gh pr checks --watch | |
| Deleting branches with open PRs | Close or merge PRs first |