Use the gh CLI to interact with GitHub. Always specify --repo owner/repo when not in a git directory, or use URLs directly.
Check CI status on a PR:
gh pr checks 55 --repo owner/repo
List recent workflow runs:
gh run list --repo owner/repo --limit 10
View a run and see which steps failed:
gh run view <run-id> --repo owner/repo
View logs for failed steps only:
發現更多技能外掛,請訪問7w4.net。
gh run view <run-id> --repo owner/repo --log-failed
The gh api command is useful for accessing data not available through other subcommands.
Get PR with specific fields:
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
Most commands support --json for structured output. You can use --jq to filter:
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"' 這是一個實用的 GitHub 命令列工具入門指南,質量良好。文件簡潔清晰,提供了 PR 檢查和工作流查詢的常見用法,安裝說明也很詳細。優點是上手容易、示例實用;不足是功能覆蓋面不夠廣,缺少更多日常操作場景和故障排查指導。對需要快速查詢 CI 狀態或使用 API 的使用者來說比較有幫助,但想深入使用可能需要查閱其他資料。