| name | GitHub CLI |
| description | Expert help with GitHub CLI (gh) for managing pull requests, issues, repositories, workflows, and releases. Use this when working with GitHub operations from the command line, creating new releases, or bumping package versions. |
GitHub CLI (gh)
Expert guidance for GitHub CLI operations and workflows.
Installation & Setup
gh auth login
gh auth status
gh auth setup-git
Pull Requests
Creating PRs
gh pr create
gh pr create --title "Add feature" --body "Description"
gh pr create --base main --head feature-branch
gh pr create --draft
gh pr create --fill
Viewing PRs
gh pr list
gh pr list --author @me
gh pr view 123
gh pr view 123 --web
gh pr diff 123
gh pr status
Managing PRs
gh pr checkout 123
gh pr review 123 --approve
gh pr review 123 --comment --body "Looks good!"
gh pr review 123 --request-changes --body "Please fix X"
gh pr merge 123
gh pr merge 123 --squash
gh pr merge 123 --rebase
gh pr merge 123 --merge
gh pr close 123
gh pr reopen 123
gh pr ready 123
PR Checks
gh pr checks 123
gh pr checks 123 --watch
Issues
Creating Issues
gh issue create
gh issue create --title "Bug report" --body "Description"
gh issue create --title "Bug" --label bug,critical
gh issue create --title "Task" --assignee @me
Viewing Issues
gh issue list
gh issue list --assignee @me
gh issue list --label bug
gh issue view 456
gh issue view 456 --web
Managing Issues
gh issue close 456
gh issue reopen 456
gh issue edit 456 --title "New title"
gh issue edit 456 --add-label bug
gh issue edit 456 --add-assignee @user
gh issue comment 456 --body "Update"
Repository Operations
Repository Info
gh repo view
gh repo view --web
gh repo clone owner/repo
gh repo fork owner/repo
gh repo list owner
Repository Management
gh repo create my-repo --public
gh repo create my-repo --private
gh repo delete owner/repo
gh repo sync owner/repo
gh repo set-default
Workflows & Actions
Viewing Workflows
gh workflow list
gh run list
gh run view 789
gh run watch 789
gh run view 789 --log
Managing Workflows
gh workflow run workflow.yml
gh run cancel 789
gh run rerun 789
gh run download 789
Releases
Creating Releases
gh release create v1.0.0
gh release create v1.0.0 --notes "Release notes"
gh release create v1.0.0 dist/*.tar.gz
gh release create v1.0.0 --draft
gh release create v1.0.0 --generate-notes
Managing Releases
gh release list
gh release view v1.0.0
gh release download v1.0.0
gh release delete v1.0.0
Version Management (pki-manager specific)
IMPORTANT: When creating a new release for this project, you MUST bump the version in ALL THREE package.json files:
package.json (root - authoritative source)
frontend/package.json
backend/package.json
Version Bump Types (Semantic Versioning)
| Type | When to use | Example |
|---|
| patch | Bug fixes, minor changes | 1.2.0 → 1.2.1 |
| minor | New features, backwards compatible | 1.2.0 → 1.3.0 |
| major | Breaking changes | 1.2.0 → 2.0.0 |
Pre-Release Workflow
Before creating a release, you MUST:
- Check current version in root package.json
- Determine bump type based on changes since last release
- Update ALL package.json files with the new version
- Commit version changes with message:
chore: bump version to vX.Y.Z
- Create git tag:
git tag vX.Y.Z
- Push tag:
git push origin vX.Y.Z
- Create GitHub release:
gh release create vX.Y.Z --generate-notes
Complete Release Workflow
cat package.json | grep '"version"'
NEW_VERSION="1.2.1"
git add package.json frontend/package.json backend/package.json
git commit -m "chore: bump version to v${NEW_VERSION}"
git tag "v${NEW_VERSION}"
git push origin main
git push origin "v${NEW_VERSION}"
gh release create "v${NEW_VERSION}" --generate-notes
gh release create "v${NEW_VERSION}" --notes "## What's Changed
- Feature A
- Bug fix B
- Improvement C"
Version Synchronization Rules
CRITICAL: All three package.json files MUST have matching versions:
| File | Path | Must Match Root |
|---|
| Root | package.json | ✓ (authoritative) |
| Frontend | frontend/package.json | ✓ |
| Backend | backend/package.json | ✓ |
Checking Version Consistency
echo "Root: $(cat package.json | grep '"version"' | head -1)"
echo "Frontend: $(cat frontend/package.json | grep '"version"' | head -1)"
echo "Backend: $(cat backend/package.json | grep '"version"' | head -1)"
Release Checklist
Before releasing, verify:
Gists
gh gist create file.txt
echo "content" | gh gist create -
gh gist list
gh gist view <gist-id>
gh gist edit <gist-id>
gh gist delete <gist-id>
Advanced Features
Aliases
gh alias set pv "pr view"
gh alias set bugs "issue list --label bug"
gh alias list
gh pv 123
API Access
gh api repos/:owner/:repo/issues
gh api repos/:owner/:repo/issues -f title="Bug" -f body="Description"
gh api --paginate repos/:owner/:repo/issues
Extensions
gh extension list
gh extension install owner/gh-extension
gh extension upgrade --all
Common Workflows
Code Review Workflow
gh pr list --assignee @me
gh pr checkout 123
gh pr review 123 --approve --body "LGTM!"
gh pr merge 123 --squash
Quick PR Creation
git checkout -b feature/new-feature
git add .
git commit -m "Add new feature"
git push -u origin feature/new-feature
gh pr create --fill
gh pr view --web
Issue Triage
gh issue list
gh issue edit 456 --add-label needs-triage
gh issue edit 456 --add-label bug
gh issue edit 456 --add-assignee @developer
Configuration
gh config set editor vim
gh config set git_protocol ssh
gh config list
gh config set browser firefox
Tips
- Use
--web flag: Open items in browser for detailed view
- Interactive prompts: Most commands work interactively if you omit parameters
- Filters: Use
--author, --label, --state to filter lists
- JSON output: Add
--json flag for scriptable output
- Template repos: Use
gh repo create --template for templates
- Auto-merge: Enable with
gh pr merge --auto