Estimated time: 30–45 minutes
In this module, you will install GitHub Copilot CLI, authenticate it with your account, and run your first commands. By the end, you will have a working setup and a basic understanding of how the tool works.
GitHub Copilot CLI is a command-line interface that brings GitHub Copilot into your terminal. Instead of relying only on editor completions, you can ask Copilot to explain commands, suggest shell scripts, and help with development tasks without leaving your terminal session.
It works as an extension to the GitHub CLI (gh) and communicates with GitHub's Copilot backend using your existing subscription.
Copilot CLI runs as a gh extension, so you need the GitHub CLI installed first.
macOS:
brew install ghUbuntu / Debian:
sudo apt install ghWindows:
winget install GitHub.cliVerify the installation:
gh --versionYou should see output like gh version 2.x.x.
Log in to your GitHub account using:
gh auth loginFollow the prompts. When asked which protocol to use, select HTTPS. When asked how to authenticate, select Login with a web browser, and complete the process in your browser.
To confirm you are logged in:
gh auth statusThe output should show your username and that you are authenticated.
gh extension install github/gh-copilotAfter installation, confirm it is available:
gh copilot --helpYou should see a list of available subcommands.
GitHub Copilot CLI has two primary commands:
Use this to understand what a shell command does. This is especially useful when you encounter an unfamiliar command in documentation or a script.
gh copilot explain "tar -xzf archive.tar.gz"Copilot will give you a plain-language explanation of the command and each flag.
Here is what that looks like in practice:
Use this when you know what you want to do but are not sure of the exact command.
gh copilot suggest "list all files larger than 100MB"Copilot will suggest a command that does what you described.
When you run gh copilot suggest without a specific request, it enters an interactive session where you can have a back-and-forth conversation.
gh copilot suggestThink of it like asking a knowledgeable colleague a question. The more clearly you describe your situation, the more useful the answer will be.
You can describe your goal in natural language and ask follow-up questions. Type exit to leave the session.
Here is a short demo of Copilot CLI responding to a first prompt:
Run the following command periodically to stay on the latest version:
gh extension upgrade gh-copilotTry the following on your own before moving to the next module.
Exercise 1.1 Install the GitHub CLI and Copilot extension, then run:
gh copilot --versionNote the version number. Take a screenshot — you will need this for your submission.
Exercise 1.2
Use gh copilot explain to understand this command:
gh copilot explain "ps aux | grep python"Read the explanation. Does it match what you expected?
Exercise 1.3
Use gh copilot suggest to get a command for the following task:
Find all .log files in the current directory that were modified in the last 7 days
Run the suggested command in a test directory.
In this module you:
- Installed the GitHub CLI and authenticated with your account
- Installed the GitHub Copilot CLI extension
- Ran your first
explainandsuggestcommands - Learned about interactive mode
Continue to Module 02 — Core Commands and Context.



