beginner20 chapters

Understanding GitHub CLI

A comprehensive guide to mastering the GitHub CLI (gh) — from installation to advanced workflows. Learn how to manage repos, pull requests, issues, and more directly from your terminal.

githubcligitdevtools

The GitHub CLI (gh) brings GitHub to your terminal. It reduces context switching, speeds up workflows, and makes automation a breeze.

In this course, you'll learn everything from basic installation to advanced automation with GitHub CLI. Whether you're a beginner or an experienced developer, you'll find practical examples and real-world workflows that you can apply immediately.

What You'll Learn

  • Install and configure the GitHub CLI
  • Manage repositories, pull requests, and issues
  • Work with GitHub Actions from the command line
  • Automate repetitive workflows
  • Extend the CLI with aliases and extensions

Prerequisites

  • Basic familiarity with the command line
  • A GitHub account
  • Git installed on your machine

Chapters

1

Introduction to GitHub CLI

What GitHub CLI is, its history, and why it matters for your development workflow.

2

Installation

Installing GitHub CLI on macOS, Linux, and Windows, plus upgrading and getting help.

3

Authentication

Logging in, managing tokens, switching accounts, and configuring Git credentials.

4

Configuration

Configuring GitHub CLI settings, environment variables, and config files.

5

Repositories

Cloning, creating, forking, editing, and managing GitHub repositories from the CLI.

6

Issues

Creating, listing, viewing, editing, and managing the full lifecycle of GitHub Issues.

7

Pull Requests

The full PR lifecycle — creating, reviewing, merging, reverting, and more.

8

Releases

Creating, managing, and distributing software releases from the terminal.

9

GitHub Actions

Managing workflows, runs, and caches for CI/CD from the terminal.

10

Gists

Creating, viewing, editing, and managing code snippets with GitHub Gists.

11

Projects

Managing GitHub Projects (v2) boards, fields, and items from the CLI.

12

Codespaces

Creating, managing, and connecting to cloud development environments from the CLI.

13

Search

Searching repositories, code, issues, pull requests, and commits across GitHub.

14

The API Command

Making authenticated REST and GraphQL requests to the GitHub API with gh api.

15

Secrets and Variables

Managing GitHub Actions secrets and configuration variables from the CLI.

16

Extensions

Discovering, installing, and creating custom GitHub CLI extensions.

17

Aliases

Creating shortcuts for frequently used gh commands to save time and build custom workflows.

18

Formatting and Scripting

Output formatting, exit codes, and automation patterns for shell scripting with gh.

19

Additional Commands

Browse, status, labels, SSH keys, GPG keys, rulesets, attestations, and more.

20

Advanced Workflows

Real-world automation patterns, CI/CD integration, enterprise usage, and productivity tips.