gh
GitHub CLI — interact with GitHub from the command line (https://cli.github.com)
To authenticate with GitHub
To check authentication status
--- Workflow Runs ---
To list recent workflow runs (pipe to cat to bypass pager):
gh run list --limit 10 | cat
To view details of a specific run
gh run view <run-id> | cat
To view full logs for a failed job
gh run view --log --job=<job-id> | cat
To watch a run in real time
To re-run a failed workflow
To re-run only failed jobs
gh run rerun <run-id> --failed-only
To trigger a workflow_dispatch manually
gh workflow run <workflow-name>
--- Issues ---
To list open issues:
To create an issue
gh issue create --title "Title" --body "Body"
To list issues with a label
gh issue list --label <label>
--- Pull Requests ---
To list open pull requests:
To create a pull request
gh pr create --title "Title" --body "Body" --base main
To merge a pull request
gh pr merge <number> --squash
To check PR status (CI checks)
gh pr checks <number> | cat
--- Repos ---
To clone a repo:
gh repo clone <owner>/<repo>
To view repo info
gh repo view <owner>/<repo>
To fork a repo
gh repo fork <owner>/<repo>
To create a new repo
gh repo create <name> --public --clone
--- Releases ---
To list releases:
To create a release
gh release create <tag> --title "Title" --notes "Notes"
To download release assets
gh release download <tag>
--- Secrets ---
To list repository secrets:
--- Gists ---
To create a gist from a file:
gh gist create <file> --public