gh: GitHub from the Command Line
Get fluent with the gh CLI — sign in, work with repositories, issues and pull requests, watch CI runs, cut releases, query the API, and make the tool your own, one small command at a time.
Most people drive GitHub through the website, clicking between tabs while their work lives in the terminal. gh closes that gap: pull requests, issues, releases, Actions and the raw API are all one short command away, right next to your code. This course follows a single small project — a shop called widget-store — and builds real fluency one command at a time. We sign in, look at a repository, triage and file issues, open and review pull requests, watch a CI run finish, cut a release, and reach the API directly when no command exists yet. Reading gh's output is half the skill, so every transcript is the real thing — the issue numbers, the PR state, the run status — and we learn to pull exactly the field we want out of it. By the end gh is yours: an alias or two, a default, and the everyday GitHub loop without leaving the keyboard.
What you'll build
- Authenticate gh and confirm which account is active
- Inspect, clone and create repositories
- Triage, file, comment on and close issues
- Open, list, review and merge pull requests
- Watch GitHub Actions runs and cut a release
- Query the GitHub API directly and extract fields with --jq
- Customise gh with aliases and config
Contents
- Check the tool
- See who you are
- Sign in
- Look at a repository
- Ask for just the facts
- Clone it
- Create a new repository
- List the open issues
- Narrow the list
- File a new issue
- Read an issue
- Add a comment
- Close an issue
- Open a pull request
- List the pull requests
- Where do you stand
- Read a pull request
- See what changed
- Try it locally
- Leave a review
- Merge it
- List CI runs
- Inspect a run
- Watch it finish
- Cut a release
- List releases
- Reach the API directly
- Pull out one field
- Share a snippet
- Search across GitHub
- Make it your own
- The everyday loop