BrainGrid

Installing the GitHub CLI

Step-by-step guide to install the GitHub CLI on Mac and Windows

The GitHub CLI (gh) lets you interact with GitHub from your terminal. BrainGrid uses it to connect with your repositories, create branches, and manage pull requests.

What is GitHub?

GitHub is a platform where developers store and collaborate on code. Think of it as a shared folder for your project's code, where you can track every change, work with teammates, and review each other's work. BrainGrid connects to GitHub to analyze your code and help manage your development workflow.

Create a GitHub Account

If you are going to build a BrainGrid requirement locally, you will first need the GitHub CLI installed to download the code and upload any changes you make. To use the GitHub CLI, you need a GitHub account.

Go to GitHub

Open github.com in your browser and click Sign up.

Enter your details

Provide your email address, create a password, and choose a username. Follow the verification steps to confirm your account.

Choose a plan

Select the Free plan. It includes everything you need to use BrainGrid.

Opening a Terminal

A terminal is a text-based application where you type commands. You'll need one to install the GitHub CLI.

  1. Press Command + Space to open Spotlight Search
  2. Type Terminal
  3. Press Enter to open it

A window with a text prompt will appear — this is your terminal.

  1. Press the Windows key on your keyboard
  2. Type PowerShell
  3. Click Windows PowerShell from the results

A blue window with a text prompt will appear — this is your terminal.

Use PowerShell, not Command Prompt. PowerShell comes pre-installed on Windows 10 and later.

Install the GitHub CLI

The easiest way to install on Mac is with Homebrew, a popular package manager.

Install Homebrew (if you don't have it)

Paste this command into your terminal and press Enter:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Follow the on-screen instructions. You may need to enter your Mac password — the characters won't appear as you type, but they are being entered.

If you already have Homebrew, you can skip this step. To check, type brew --version and press Enter. If you see a version number, it's already installed.

Install the GitHub CLI

Run this command:

brew install gh

Wait for the installation to finish.

Install with winget

Windows 10 and later include a built-in package manager called winget. Paste this command into PowerShell and press Enter:

winget install --id GitHub.cli

Follow any prompts that appear.

Verify the Installation

Close your terminal and open a new one (this ensures the new command is recognized). Then run:

gh --version

You should see output like gh version 2.x.x. If you see an error like "command not found", try closing and reopening your terminal again.

Log In to GitHub

Before using the GitHub CLI, you need to connect it to your GitHub account:

Start the login process

Run this command:

gh auth login

Answer the prompts

The CLI will ask you a series of questions. Choose the following:

  1. Where do you use GitHub? → Select GitHub.com
  2. Preferred protocol for Git operations? → Select HTTPS
  3. Authenticate Git with your GitHub credentials? → Select Yes
  4. How would you like to authenticate? → Select Login with a web browser

Complete browser authentication

The CLI will display a one-time code and open your browser. Paste the code into the browser page and authorize access.

Once complete, you'll see a confirmation message in your terminal.

Verify Authentication

Run this command to confirm you're logged in:

gh auth status

You should see your GitHub username and a confirmation that you're logged in.

Troubleshooting

Next Steps

Install the GitHub App

Connect your repositories to BrainGrid

Quickstart

Set up your first BrainGrid project