Loading...
Loading...
This skill should be used when the user mentions "gh CLI", "gh command", asks to "view repository info", "trigger workflows", "search GitHub", "manage codespaces", "check PR status", "list issues", or asks about GitHub CLI usage and automation from the command line.
npx skill4agent add paulrberg/agent-skills cli-ghgh repo deletegh repo archivegh release deletegh release delete-assetgh run deletegh cache deletegh secret deletegh variable deletegh label deletegh ssh-key deletegh gpg-key deletegh codespace deletegh extension removegh gist deletexargsrm -rfgit statusgit loggit diff# Login to GitHub
gh auth login
# Check authentication status
gh auth status
# Configure git to use gh as credential helper
gh auth setup-git# Create PR interactively
gh pr create
# Create PR with title and body
gh pr create --title "Add feature" --body "Description"
# Create PR to specific branch
gh pr create --base main --head feature-branch
# Create draft PR
gh pr create --draft
# Create PR from current branch
gh pr create --fill # Uses commit messages# List PRs
gh pr list
# List my PRs
gh pr list --author @me
# View PR details
gh pr view 123
# View PR in browser
gh pr view 123 --web
# View PR diff
gh pr diff 123
# Check PR status
gh pr status# Checkout PR locally
gh pr checkout 123
# Review PR
gh pr review 123 --approve
gh pr review 123 --comment --body "Looks good!"
gh pr review 123 --request-changes --body "Please fix X"
# Merge PR
gh pr merge 123
gh pr merge 123 --squash
gh pr merge 123 --rebase
gh pr merge 123 --merge
# Close PR
gh pr close 123
# Reopen PR
gh pr reopen 123
# Ready draft PR
gh pr ready 123
# Update PR branch with base branch
gh pr update-branch 123# View PR checks
gh pr checks 123
# Watch PR checks
gh pr checks 123 --watch# Create issue interactively
gh issue create
# Create issue with title and body
gh issue create --title "Bug report" --body "Description"
# Create issue with labels
gh issue create --title "Bug" --label bug,critical
# Assign issue
gh issue create --title "Task" --assignee @me# List issues
gh issue list
# List my issues
gh issue list --assignee @me
# List by label
gh issue list --label bug
# View issue details
gh issue view 456
# View in browser
gh issue view 456 --web# Close issue
gh issue close 456
# Reopen issue
gh issue reopen 456
# Edit issue
gh issue edit 456 --title "New title"
gh issue edit 456 --add-label bug
gh issue edit 456 --add-assignee @user
# Comment on issue
gh issue comment 456 --body "Update"
# Create branch to work on issue
gh issue develop 456 --checkout# View repository
gh repo view
# View in browser
gh repo view --web
# Clone repository
gh repo clone owner/repo
# Fork repository
gh repo fork owner/repo
# List repositories
gh repo list owner# Create repository
gh repo create my-repo --public
gh repo create my-repo --private
# Sync fork
gh repo sync owner/repo
# Set default repository
gh repo set-default# Search for repositories
gh search repos "machine learning" --language=python
# Search with filters
gh search repos --stars=">1000" --topic=kubernetes# Search issues across GitHub
gh search issues "bug" --label=critical --state=open
# Exclude results (note the -- to prevent flag interpretation)
gh search issues -- "memory leak -label:wontfix"# Search PRs
gh search prs --author=@me --state=open
# Search with date filters
gh search prs "refactor" --created=">2024-01-01"# List all labels in repository
gh label list# Create new label
gh label create "priority: high" --color FF0000 --description "High priority items"
# Edit existing label
gh label edit "bug" --color FFAA00 --description "Something isn't working"# Clone labels from another repository
gh label clone owner/source-repo# List codespaces
gh codespace list
# Create new codespace
gh codespace create --repo owner/repo# SSH into codespace
gh codespace ssh
# Open in VS Code
gh codespace code
# Open in JupyterLab
gh codespace jupyter# Copy files to/from codespace
gh codespace cp local-file.txt remote:~/path/
gh codespace cp remote:~/path/file.txt ./local-dir/
# View logs
gh codespace logs# Create release
gh release create v1.0.0
# Create release with notes
gh release create v1.0.0 --notes "Release notes"
# Create release with files
gh release create v1.0.0 dist/*.tar.gz
# Create draft release
gh release create v1.0.0 --draft
# Generate release notes automatically
gh release create v1.0.0 --generate-notes# List releases
gh release list
# View release
gh release view v1.0.0
# Download release assets
gh release download v1.0.0# Create gist
gh gist create file.txt
# Create gist from stdin
echo "content" | gh gist create -
# List gists
gh gist list
# View gist
gh gist view <gist-id>
# Edit gist
gh gist edit <gist-id># Set default editor
gh config set editor vim
# Set default git protocol
gh config set git_protocol ssh
# View configuration
gh config list
# Set browser
gh config set browser firefox| Operation | Command | Common Flags |
|---|---|---|
| Create PR | | |
| List PRs | | |
| View PR | | |
| Merge PR | | |
| Create issue | | |
| List issues | | |
| View issue | | |
| Clone repo | | |
| Fork repo | | |
| View repo | | |
| Create release | | |
| Run workflow | | |
| Watch run | | |
| Search repos | | |
| Create label | | |
| Create codespace | | |
| SSH to codespace | | |
examples/auto-pr-create.shissue-triage.shworkflow-monitor.shrelease-automation.sh--json--help# Check available JSON fields for any command
gh repo view --help | grep -A 50 "JSON FIELDS"
gh pr list --help | grep -A 50 "JSON FIELDS"| Wrong (API-style) | Correct (gh CLI) |
|---|---|
| |
| |
| |
| |
# Common fields for gh repo view --json
gh repo view owner/repo --json name,description,stargazerCount,forkCount,updatedAt,url,readme--web--author--label--state--json--helpgh repo create --templategh pr merge --auto