World map

 

BM: Baca dalam Bahasa Melayu

World 9: Power Tools

GitHub CLI

You will learn: how to use GitHub from your terminal with gh.

The problem

You are deep in the terminal. You spot a bug. Opening the browser breaks your flow. Can you report it from right here?

Pick one answer.

Watch

bash
gh auth login
gh issue create --title "Typo on home page" --body "It says Dairy."
https://github.com/aina-codes/diary/issues/5
gh auth login signs you in once. Then gh issue create opens an issue called Typo on home page, and prints its web address.

GitHub CLI (gh): A free tool that talks to GitHub from your terminal. Its command is gh. is a free tool. Its command is gh. Sign in once with gh auth login. Then gh issue create opens an issue, no browser needed.

Try it

gh sorts its jobs into groups. Which group does each job belong to?

Drag a card into a box. Or tap the card, then tap the box.

        Watch

        bash
        gh pr create --title "Fix typo" --body "Closes #5"
        https://github.com/aina-codes/diary/pull/6
        gh pr view --web
        gh pr create with a title and a body prints the link to pull request 6. Then gh pr view --web opens it in the browser.

        Pushed your branch? gh pr create opens a pull request (PR): Ask others to review and accept your changes. and prints its link. gh pr view --web opens it in your browser.

        Try it

        Build the command that lists open issues with the bug label.

        Tap the pieces in the right order.

        …

        Predict

        Your friend Mei has a diary repo. You run gh repo clone mei/diary. What happens?

        Pick one answer.

        Check

        Good habit, or needs work? Swipe each one.

        Swipe right for good, left for needs work. Or use the buttons.

        1 / 4

        Sign in once with gh auth login

        Sign in once with gh auth login

        You did it!

        You can now use GitHub from your terminal with gh.

        Go deeper (optional)

        gh browse opens the current repo in your browser. gh repo fork --clone makes a fork and copies it in one go. gh api can ask GitHub for almost anything. Get gh from cli.github.com. It works on Windows, macOS and Linux.