Appendix I: GitHub CLI Reference
Episode coming soon: GitHub CLI Reference - a conversational audio overview of this appendix. Listen before reading to preview the concepts, or after to reinforce what you learned.
Reference companion to: Chapter 01: Choose Your Tools | Also relevant: Chapter 14
Authoritative source: GitHub CLI Manual | GitHub Accessibility Lab: CLI Guide
Your Terminal, Supercharged for GitHub
Who this is for: You want to manage GitHub — issues, pull requests, repos, releases — from your terminal without opening a browser. The GitHub CLI (gh) gives you full access to GitHub from the command line, with clean plain-text output that works beautifully with screen readers.
gh handles the GitHub side of things (issues, PRs, repos, releases). git handles the local version control side (commits, branches, history). You use both together.
Getting started principles for accessible CLI workflows
- Follow a local-to-remote progression: learn
git basics first, then layer gh workflows.
- Treat terminal output as the source of truth. Confirm each command result before moving on.
- Prefer short, reversible steps: clone, inspect, branch, edit, commit, push, open PR.
- Keep one reliable terminal profile and one reliable editor setup rather than constant tool switching.
- Use browser fallback strategically for verification, not as a replacement for command understanding.
Table of Contents
- Installing and Authenticating
- Repos — Clone, Fork, Create, View
- Issues — Create, List, View, Comment, Close
- Pull Requests — Create, Review, Merge, Check
- Releases — Create, List, Upload
- Search — Issues, PRs, Repos, Code
- Labels and Milestones
- Output Formatting — JSON, jq, Templates
- Aliases — Create Your Own Shortcuts
- Extensions — Adding New Commands
- Copilot in the CLI
- Screen Reader Tips
- Quick Reference Card
1. Installing and Authenticating
Installing
Windows
winget install GitHub.cli
Or download the installer from cli.github.com.
macOS
brew install gh
Linux (Debian/Ubuntu)
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
Verify installation
gh --version
Authenticating
gh auth login
Follow the prompts:
- Where do you use GitHub? → GitHub.com (or Enterprise)
- Preferred protocol? → HTTPS (or SSH)
- Authenticate with browser? → Yes — your browser opens for OAuth sign-in
After signing in, return to the terminal. You're done.
gh auth status
gh auth logout
gh auth refresh
Screen reader tip: gh auth login is an interactive prompt — navigate with Arrow keys, confirm with Enter. All prompts are plain text and read naturally. The browser step opens automatically; switch back to the terminal when the browser confirms success.
Command safety guideline: Use options documented in gh --help and the GitHub CLI manual. Avoid undocumented or experimental flags in classroom and production workflows.
Windows Terminal setup pattern
If you are on Windows, configure Windows Terminal once and reuse it:
- Keep a dedicated shell profile for your Git workflows.
- Learn mark mode (
Ctrl+Shift+M) to review and copy command output line by line.
- Use command palette (
Ctrl+Shift+P) to find terminal actions without memorizing every shortcut.
- Keep your font size and contrast settings stable so output remains readable across sessions.
Learning Cards: Getting Started with gh
Screen reader users
gh auth login uses plain-text arrow-key prompts -- every option is announced as you arrow through the list
- After authentication,
gh auth status confirms your login in a single readable line -- no browser needed
- All
gh output is plain text with no hidden elements, making it one of the most screen-reader-friendly GitHub interfaces
Low vision users
- Increase your terminal font size before running
gh commands -- all output scales with your terminal settings
- Use a high-contrast terminal theme (light text on dark background, or vice versa) for comfortable reading of command output
gh output is plain text with no color-dependent meaning -- colors are supplementary labels, not the only indicator
Sighted users
- The interactive prompts use arrow-based selection with a highlight marker -- look for the
> indicator next to your current choice
- After
gh auth login, the terminal prints a success confirmation with your username -- verify it matches your GitHub account
- Install
gh via winget or brew for the fastest setup; the binary is immediately available in your current terminal session
2. Repos — Clone, Fork, Create, View
gh repo clone owner/repo-name
gh repo fork owner/repo-name --clone
gh repo fork owner/repo-name
gh repo create my-new-project
gh repo create my-new-project --public --description "My project description"
gh repo create my-new-project --private
gh repo view
gh repo view owner/repo-name
gh repo view --web
gh repo list
gh repo list --limit 50
gh repo list my-org --limit 100
gh repo archive owner/repo-name
gh repo delete owner/repo-name --confirm
gh repo sync
gh repo sync --branch main
Creating issues
gh issue create
gh issue create \
--title "Screen reader can't navigate the settings menu" \
--body "When using NVDA with Firefox, the Settings menu items are not announced..." \
--label "bug,accessibility" \
--assignee "@me"
gh issue create --title "Accessibility audit findings" --body-file ./report.md
Listing and filtering issues
gh issue list
gh issue list --label "accessibility"
gh issue list --label "good first issue"
gh issue list --assignee "@me"
gh issue list --state closed
gh issue list --limit 50
gh issue list --search "screen reader"
gh issue list --repo owner/repo-name
Viewing issues
gh issue view 42
gh issue view 42 --web
gh issue view 42 --comments
Screen reader tip: gh issue view 42 outputs clean plain text — title, metadata, and body all formatted without noise. Read line by line with Arrow keys. Much faster than navigating a browser page with a screen reader.
gh issue comment 42 --body "I can reproduce this on Windows 11 with NVDA 2024.1."
gh issue comment 42 --body-file ./my-comment.md
gh issue edit 42 --title "Updated title"
gh issue edit 42 --add-label "needs-reproduction"
gh issue edit 42 --remove-label "bug"
gh issue edit 42 --add-assignee username
gh issue close 42
gh issue close 42 --comment "Fixed in PR #56."
gh issue close 42 --reason "not planned"
gh issue reopen 42
Pinning and locking
gh issue pin 42
gh issue lock 42 --reason "resolved"
4. Pull Requests — Create, Review, Merge, Check
Creating a PR
gh pr create
gh pr create \
--title "Add keyboard navigation to settings menu" \
--body "Closes #42. Adds Tab/arrow key support to the settings dropdown." \
--base main \
--label "accessibility,enhancement"
gh pr create --draft
gh pr create --title "Accessibility improvements" --body-file ./pr-description.md
gh pr create --web
Listing and viewing PRs
gh pr list
gh pr list --state closed
gh pr list --author "@me"
gh pr list --label "accessibility"
gh pr list --search "screen reader"
gh pr view 56
gh pr diff 56
gh pr view 56 --web
gh pr checkout 56
Reviewing PRs
gh pr review 56 --approve
gh pr review 56 --approve --body "Tested with NVDA — keyboard nav works perfectly. LGTM!"
gh pr review 56 --request-changes --body "The focus indicator disappears on the last menu item."
gh pr review 56 --comment --body "A few observations — see inline comments."
Checking CI status
gh pr checks 56
gh pr checks 56 --watch
gh pr checks
Merging PRs
gh pr merge 56
gh pr merge 56 --merge
gh pr merge 56 --squash
gh pr merge 56 --rebase
gh pr merge 56 --auto --squash
gh pr merge 56 --squash --delete-branch
Other PR operations
gh pr ready 56
gh pr ready 56 --undo
gh pr update-branch 56
gh pr update-branch 56 --rebase
gh pr close 56
gh pr close 56 --comment "Superseded by #58."
gh pr reopen 56
gh pr comment 56 --body "Thanks for the thorough review! Addressing feedback now."
5. Releases — Create, List, Upload
gh release create v1.2.0
gh release create v1.2.0 \
--title "Version 1.2.0 — Accessibility Improvements" \
--notes "- Fixed keyboard navigation in settings\n- Added ARIA labels to all form inputs"
gh release create v1.2.0 --notes-file ./CHANGELOG.md
gh release create v1.2.0-beta.1 --prerelease
gh release create v1.2.0 --draft
gh release upload v1.2.0 ./dist/app.zip ./dist/app.tar.gz
gh release list
gh release view v1.2.0
gh release download v1.2.0
gh release download v1.2.0 --pattern "*.zip"
gh release delete v1.2.0
See also: Appendix H: Releases, Tags, and Insights for the GitHub.com interface side of releases.
6. Search — Issues, PRs, Repos, Code
gh search issues "screen reader navigation" --label accessibility
gh search issues "keyboard shortcut" --repo owner/repo-name
gh search issues "help wanted" --language javascript --limit 20
gh search prs "accessibility fix" --state open
gh search prs "WCAG" --author username
gh search repos "accessible markdown editor" --language python --stars ">100"
gh search repos "screen reader" --topic accessibility
gh search code "aria-label" --repo owner/repo-name
gh search code "git cherry-pick" --language markdown
7. Labels and Milestones
Labels
gh label list
gh label create "accessibility" --color "0075ca" --description "Accessibility improvements"
gh label clone owner/source-repo
gh label delete "wontfix"
Milestones
gh api repos/{owner}/{repo}/milestones --jq '.[].title'
gh api repos/{owner}/{repo}/milestones \
--method POST \
--field title="v2.0 Launch" \
--field description="All features for the v2.0 release" \
--field due_on="2026-06-01T00:00:00Z"
By default gh outputs human-readable text. For scripting or custom display, you can get raw JSON and filter it.
--json flag
gh issue view 42 --json title,body,labels,state
gh pr view 56 --json title,number,state,mergeable,reviews
gh issue list --json number,title,labels,assignees
--jq flag (filter JSON inline)
gh issue list --json number,title --jq '.[] | "\(.number): \(.title)"'
gh issue view 42 --json labels --jq '.labels[].name'
gh pr list --json number --jq 'length'
gh pr view 56 --json reviews --jq '[.reviews[] | select(.state=="APPROVED") | .author.login] | unique'
--template flag (Go templates)
gh issue list --template '{{range .}}#{{.number}} {{.title}} ({{.state}}){{"\n"}}{{end}}'
Screen reader tip: --json with --jq produces clean, predictable output — ideal for piping to a file or reading with a screen reader. The default human-readable output is also clean, but JSON gives you precise control over what's announced.
Screen reader users
- Use
--json with --jq to extract exactly the fields you need -- this eliminates table formatting noise and reads as clean key-value pairs
- Pipe long output to a file (
gh issue list --json title > issues.txt) and open it in VS Code for structured navigation with Alt+F2
- Go templates (
--template) let you define a single-line-per-item format that reads naturally with arrow keys
Low vision users
- The default table output aligns columns with spaces -- increase terminal font size so columns stay readable
- JSON output with
--jq strips visual formatting and gives compact text that scales cleanly with any font size
- Pipe output to VS Code (
gh pr view 42 --json body --jq '.body' | code -) to read it with your preferred editor theme and zoom
Sighted users
- Default table output is already human-readable with aligned columns -- scan the header row to orient on each column
- Use
--web on any command to open the result in your browser if you prefer the GitHub web interface for detailed views
- Chain
| head -20 (macOS/Linux) or | Select-Object -First 20 (PowerShell) to preview long output before reading the full list
9. Aliases — Create Your Own Shortcuts
Aliases let you create custom gh commands from long commands you run often.
gh alias set bugs 'issue list --label bug'
gh alias set my-prs 'pr list --author @me'
gh alias set review-ready 'pr list --label "ready for review"'
gh bugs
gh my-prs
gh review-ready
gh alias list
gh alias delete bugs
gh alias set --shell open-pr 'gh pr view $1 --web'
gh open-pr 56
Useful aliases to set up
gh alias set mine 'issue list --assignee @me'
gh alias set mypr 'pr list --author @me --state open'
gh alias set ci 'pr checks'
gh alias set pr 'pr view'
10. Extensions — Adding New Commands
Extensions add new gh subcommands written by the community.
gh extension search
gh extension install owner/gh-extension-name
gh extension list
gh extension upgrade --all
gh extension upgrade owner/gh-extension-name
gh extension remove owner/gh-extension-name
Useful extensions
| Extension |
What it does |
Install |
github/gh-copilot |
Ask Copilot questions in the terminal |
gh extension install github/gh-copilot |
nicokosi/gh-notify |
Desktop notifications for GitHub events |
gh extension install nicokosi/gh-notify |
mislav/gh-branch |
Better branch switching with fuzzy search |
gh extension install mislav/gh-branch |
11. Copilot in the CLI
Install the Copilot extension once, then ask coding and git questions without leaving the terminal.
gh extension install github/gh-copilot
gh copilot suggest "squash my last 4 commits into one"
gh copilot suggest "find which commit introduced a bug in auth.js"
gh copilot suggest "create a pull request from my current branch"
gh copilot explain "git rebase -i HEAD~3"
gh copilot explain "git bisect start"
gh copilot explain "find . -name '*.md' -mtime -7"
Copilot CLI shows the suggested command, explains what it does, and asks whether to run it - perfect for learning while doing.
Auto model selection
As of early 2026, gh copilot uses auto model selection by default - it picks the best available model for your request without you needing to specify one. You can still request a specific model using the --model flag if you prefer:
gh copilot suggest "create a pull request from my current branch"
gh copilot suggest --model gpt-5 "create a pull request from my current branch"
Telemetry opt-out
As of gh CLI 2.70 (April 2026), gh collects anonymized usage telemetry by default to improve the product. To opt out:
gh config set telemetry disabled
Or set the environment variable GH_NO_UPDATE_NOTIFIER=1 to suppress update notifications only.
See also: Appendix AA: Advanced Git Operations, Section 11 for more Copilot CLI examples with git operations.
12. Screen Reader Tips
The GitHub CLI is one of the most screen-reader-friendly ways to use GitHub. Here's why and how to get the most out of it.
Why the CLI works so well
- Plain text output — no visual noise, no unlabelled buttons, no hidden dialogs
- Predictable structure — every command produces consistent output you can navigate with arrow keys
- No focus traps — you control when you read output; nothing streams unexpectedly
- Keyboard-first by design — everything is a command you type
Tips by task
Reading issues and PRs:
gh issue view 42 | less
gh pr view 56 > pr-56.md
code pr-56.md
Navigating long lists:
gh issue list --limit 10
gh issue list --search "keyboard" --limit 5
Getting just what you need:
gh pr view 56 --json title --jq '.title'
gh issue view 42 --json body --jq '.body'
gh pr checks 56 --json name,state --jq '.[] | "\(.state): \(.name)"'
Creating content without a browser:
gh issue create --title "Bug: focus lost after modal closes" --body-file ./issue.md
NVDA / JAWS (Windows)
- Run
gh commands in Windows Terminal or the VS Code integrated terminal — both work well with NVDA/JAWS
- Use
Insert+Down (NVDA) or Insert+F12 (JAWS) to read the current line of terminal output
- For long output, use
| less and navigate with Space (next page) and b (back)
VoiceOver (macOS)
- Run
gh in Terminal.app or VS Code integrated terminal
VO+Right moves through terminal output character by character; VO+Down line by line
- Use
Ctrl+C to stop a running command if output is too long
Learning Cards: Screen Reader CLI Workflow
Screen reader users
gh is keyboard-first by design -- no focus traps, no streaming, no unlabelled buttons; everything is typed and read as plain text
- Use
Insert+Down (NVDA) or Insert+F12 (JAWS) to read the current line, and arrow keys to move through multi-line output
- Write issue and PR bodies in a text file first, then use
--body-file ./issue.md to submit -- much easier than composing inline
Low vision users
- Terminal output from
gh has no icons or images -- all information is conveyed as text that scales with your terminal font
- Use
--limit 10 on list commands to keep output short enough to scan comfortably without scrolling
- Run
gh in the VS Code integrated terminal to benefit from VS Code's zoom, themes, and Accessible View (Alt+F2)
Sighted users
gh output uses subtle color coding (green for open, red for closed) -- these are supplementary; the text labels are always present
- Use
gh pr view --web or gh issue view --web to jump to the browser when you want the full visual GitHub interface
- The
gh pr checks command gives a quick pass/fail summary of CI checks without opening the browser
13. Quick Reference Card
Authentication
| Command |
What it does |
gh auth login |
Sign in to GitHub |
gh auth status |
Check login status |
gh auth logout |
Sign out |
Repos
| Command |
What it does |
gh repo clone owner/repo |
Clone a repo |
gh repo fork owner/repo --clone |
Fork and clone |
gh repo create name --public |
Create a new repo |
gh repo view |
View current repo info |
gh repo sync |
Sync fork with upstream |
Issues
| Command |
What it does |
gh issue list |
List open issues |
gh issue view 42 |
Read issue #42 |
gh issue create |
Create a new issue |
gh issue comment 42 --body "..." |
Add a comment |
gh issue close 42 |
Close an issue |
Pull Requests
| Command |
What it does |
gh pr list |
List open PRs |
gh pr view 56 |
Read PR #56 |
gh pr create |
Create a PR |
gh pr diff 56 |
See the diff |
gh pr checks 56 |
See CI status |
gh pr review 56 --approve |
Approve |
gh pr merge 56 --squash |
Merge (squash) |
gh pr checkout 56 |
Check out locally |
gh pr update-branch |
Update from base |
Releases
| Command |
What it does |
gh release create v1.0.0 |
Create a release |
gh release list |
List releases |
gh release download v1.0.0 |
Download assets |
Copilot
| Command |
What it does |
gh copilot suggest "..." |
Get a command suggestion |
gh copilot explain "..." |
Explain a command |
Next: Appendix J: Codespaces
Back: Appendix H: GitHub Desktop
Teaching chapter: Chapter 01: Choose Your Tools
Authoritative Sources
Use these official references when you need the current source of truth for facts in this chapter.
Section-Level Source Map
Use this map to verify facts for each major section in this file.
- Your Terminal, Supercharged for GitHub: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, About Git
- 1. Installing and Authenticating: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, GitHub security features
- 2. Repos — Clone, Fork, Create, View: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, About Git
- 3. Issues — Create, List, View, Comment, Close: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, About Git
- 4. Pull Requests — Create, Review, Merge, Check: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, About Git
- 5. Releases — Create, List, Upload: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, About releases
- 6. Search — Issues, PRs, Repos, Code: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, About Git
- 7. Labels and Milestones: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, GitHub Projects docs
- 8. Output Formatting — JSON, jq, Templates: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs
- 9. Aliases — Create Your Own Shortcuts: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs
- 10. Extensions — Adding New Commands: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs
- 11. Copilot in the CLI: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, GitHub Copilot docs
- 12. Screen Reader Tips: GitHub Docs, home, GitHub Changelog, GitHub CLI manual, GitHub Copilot CLI docs, W3C Web Content Accessibility Guidelines (WCAG) 2 overview