The official command-line tool for GitHub
brew install ghwinget install GitHub.clisudo apt install ghgh auth logingh auth statusgh auth logoutgh repo clone owner/repogh repo create my-repo --publicgh repo fork owner/repogh repo view --webgh repo listgh repo sync owner/repogh repo archive owner/repogh pr create --title "Title" --body "Description"gh pr listgh pr view 123gh pr checkout 123gh pr merge 123 --squashgh pr close 123gh pr review 123 --approvegh pr diff 123gh issue create --title "Bug" --body "Details"gh issue listgh issue view 42gh issue close 42gh issue reopen 42gh issue edit 42 --add-label "bug"gh issue comment 42 --body "Comment"gh issue transfer 42 owner/repogh workflow listgh workflow view deploy.ymlgh workflow run deploy.ymlgh run listgh run view 12345gh run watch 12345gh run download 12345gh run rerun 12345gh release create v1.0.0 --title "v1.0.0"gh release listgh release view v1.0.0gh release download v1.0.0gh release delete v1.0.0gh release upload v1.0.0 ./dist/*gh release create v1.0.0 --draftgh search repos "machine learning" --language=pythongh search issues "bug" --state=opengh search prs "feature" --state=mergedgh search code "def main" --language=pythongh search commits "fix bug"--json flag to get machine-readable output for scripting!
gh ssh-key listgh ssh-key add ~/.ssh/id_ed25519.pubgh ssh-key delete 12345gh gpg-key listgh gpg-key add key.pubgh api repos/owner/repogh api graphql -f query='{ viewer { login } }'gh extension listgh extension install owner/gh-extgh extension upgrade --allgh extension create my-extgh codespace create -r owner/repogh codespace listgh codespace ssh -c codespace-namegh codespace code -c codespace-namegh codespace stop -c codespace-namegh codespace delete -c codespace-namegh codespace ports forward 8080:8080gh config set editor "code --wait"gh config set browser firefoxgh config set git_protocol sshgh config listgh config set prompt disabledgh alias set pv 'pr view'gh alias listgh alias delete pvgh pr create # prompts for detailsgh pr list --json number,titlegh pr list --json title --jq '.[].title'gh pr create --templategh issue view 42 --webgh pr create --assignee @megh issue create --label "bug,urgent"gh pr create --reviewer user1,user2