GitHub CLI Skill
Use the gh CLI to interact with GitHub repositories and services.
Authentication
Check auth status:
bashgh auth status
Login:
bashgh auth login
Refresh token:
bashgh auth refresh
Repositories
Clone repository:
bashgh repo clone owner/repo
Create new repo:
bashgh repo create my-repo --public --source=. --push
Fork repository:
bashgh repo fork owner/repo --clone
View repo in browser:
bashgh repo view --web
List your repos:
bashgh repo list
Issues
List issues:
bashgh issue list
Create issue:
bashgh issue create --title "Bug: Login fails" --body "Description here"
Create issue interactively:
bashgh issue create
View issue:
bashgh issue view 123
Close issue:
bashgh issue close 123
Reopen issue:
bashgh issue reopen 123
Comment on issue:
bashgh issue comment 123 --body "Working on this"
Assign issue:
bashgh issue edit 123 --add-assignee @me
Add labels:
bashgh issue edit 123 --add-label "bug,priority:high"
Pull Requests
List PRs:
bashgh pr list
Create PR:
bashgh pr create --title "Add feature" --body "Description"
Create PR from current branch:
bashgh pr create --fill
View PR:
bashgh pr view 45
View PR in browser:
bashgh pr view 45 --web
Checkout PR locally:
bashgh pr checkout 45
Review PR:
bashgh pr review 45 --approve gh pr review 45 --request-changes --body "Please fix X" gh pr review 45 --comment --body "Looks good but..."
Merge PR:
bashgh pr merge 45 --squash gh pr merge 45 --merge gh pr merge 45 --rebase
Close PR:
bashgh pr close 45
List PR checks:
bashgh pr checks 45
View PR diff:
bashgh pr diff 45
Actions (CI/CD)
List workflow runs:
bashgh run list
View run details:
bashgh run view 12345
Watch run in progress:
bashgh run watch 12345
View run logs:
bashgh run view 12345 --log
Rerun failed jobs:
bashgh run rerun 12345 --failed
List workflows:
bashgh workflow list
Run workflow manually:
bashgh workflow run deploy.yml
Run with inputs:
bashgh workflow run deploy.yml -f environment=production
Disable/enable workflow:
bashgh workflow disable deploy.yml gh workflow enable deploy.yml
Releases
List releases:
bashgh release list
Create release:
bashgh release create v1.0.0 --title "Version 1.0" --notes "Release notes"
Create from tag:
bashgh release create v1.0.0 --generate-notes
Upload assets:
bashgh release upload v1.0.0 ./dist/app.zip
Download assets:
bashgh release download v1.0.0
Delete release:
bashgh release delete v1.0.0
Gists
Create gist:
bashgh gist create file.txt --public
Create from stdin:
bashecho "Hello" | gh gist create -
List gists:
bashgh gist list
View gist:
bashgh gist view GIST_ID
Edit gist:
bashgh gist edit GIST_ID
Search
Search repos:
bashgh search repos "react hooks" --limit 10
Search issues:
bashgh search issues "bug authentication" --repo owner/repo
Search PRs:
bashgh search prs "fix memory leak" --state open
Search code:
bashgh search code "function handleAuth" --repo owner/repo
API
Make API request:
bashgh api repos/owner/repo
POST request:
bashgh api repos/owner/repo/issues -f title="New issue" -f body="Description"
GraphQL query:
bashgh api graphql -f query='{ viewer { login } }'
Paginate results:
bashgh api repos/owner/repo/issues --paginate
Labels
List labels:
bashgh label list
Create label:
bashgh label create "priority:high" --color FF0000 --description "High priority"
Projects
List projects:
bashgh project list
View project:
bashgh project view 1
SSH Keys
List SSH keys:
bashgh ssh-key list
Add SSH key:
bashgh ssh-key add ~/.ssh/id_ed25519.pub --title "My laptop"
GPG Keys
List GPG keys:
bashgh gpg-key list
Add GPG key:
bashgh gpg-key add key.gpg
Secrets (for Actions)
List secrets:
bashgh secret list
Set secret:
bashgh secret set MY_SECRET
Set from file:
bashgh secret set MY_SECRET < secret.txt
Delete secret:
bashgh secret delete MY_SECRET
Variables (for Actions)
List variables:
bashgh variable list
Set variable:
bashgh variable set MY_VAR --body "value"
Extensions
List installed extensions:
bashgh extension list
Install extension:
bashgh extension install owner/gh-extension
Browse extensions:
bashgh extension browse
Aliases
Create alias:
bashgh alias set pv 'pr view'
List aliases:
bashgh alias list
Configuration
View config:
bashgh config list
Set default editor:
bashgh config set editor vim
Set default browser:
bashgh config set browser "open"
Common Workflows
Quick PR workflow:
bash# Create branch, commit, push, create PR git checkout -b feature/my-feature # ... make changes ... git add . && git commit -m "Add feature" git push -u origin feature/my-feature gh pr create --fill
Review and merge:
bashgh pr checkout 45 # ... review code ... gh pr review --approve gh pr merge --squash --delete-branch
Check CI status:
bashgh pr checks gh run watch


