The GitHub Copilot CLI brings AI-assisted coding into your terminal. Unlike the older gh copilot extension, which only suggests and explains shell commands, Copilot CLI is a standalone agentic app that answers questions, writes and debugs code, and interacts with GitHub.com services through natural-language prompts.
For Python developers who feel at home on the command line, it offers a quick way to plan tasks, edit files, and run agentic workflows without leaving the shell.
By the end of this tutorial, you’ll understand that:
- GitHub Copilot CLI is a terminal-based AI agent that plans, writes, and debugs Python code from natural-language prompts.
- Subagents like explore and code-review do specialized work behind the scenes, and the
/fleetcommand runs them in parallel. - Standard, Plan, and Autopilot modes let you manage the agent’s autonomy.
- The same session can switch between Claude and GPT models with one
/modelcommand. - Native GitHub integration lets you work with issues, pull requests, and the cloud-based coding agent.
In this guide, you’ll use a small Python project as a playground while trying out the features of Copilot CLI. Familiarity with similar tools like Claude Code or Gemini CLI will be a plus.
Note: GitHub Copilot CLI is not the same as the GitHub CLI (gh). The GitHub CLI is the long-standing tool for Git and GitHub workflows. Copilot CLI is an AI-powered agent for coding workflows in the terminal. You can use both side by side.
Before you read this guide and explore the features of GitHub Copilot CLI, take a minute to set up the prerequisites below.
Get Your Code: Click here to download the free sample code you’ll use as a playground to plan, edit, and review a Python tic-tac-toe project with the GitHub Copilot CLI.
Prerequisites
You’ll need a few things in place before you start. If you’re missing one or two pieces, each requirement links to a resource that can help get you set up:
- A GitHub account: You need a GitHub account to authenticate the CLI and access your repositories. If you don’t have one, you can sign up for free.
- An active Copilot subscription: Any Copilot plan works. If you don’t have one yet, the free tier includes a monthly allowance of AI credits that covers chat and CLI usage, which might be enough to follow along with this tutorial. Agentic tasks consume these credits quickly, though, so selecting the Auto option may help the free allowance go further.
- Basic terminal familiarity: You should be comfortable running commands in a terminal. If you’re not, then the terminal first-steps tutorial is a friendly starting point.
- A sample Python project: You’ll use a sample Python project as a playground.
Download the project before you continue. It requires Python 3.10 or later, so make sure you have a recent version installed. The project implements the tic-tac-toe game as a Tkinter application that looks and works as shown below:
With your environment in place, the rest of the tutorial follows a natural arc: install Copilot CLI, take it for a spin, and then put it to work on a real-world Python project. You’ll move from a cautious, read-only session to fully autonomous edits as your trust in the agent grows.
Step 1: Get Started With GitHub Copilot CLI
To kick things off, you’ll install Copilot CLI, sign in to GitHub, and get familiar with how to drive a session from the keyboard. By the end, you’ll be able to run prompts, use slash commands, and navigate the interactive CLI with confidence.
Install Copilot CLI
The most portable way to install Copilot CLI is from a terminal. On Linux and macOS, run the official install script, which downloads a prebuilt binary and drops it under ~/.local/bin. On Windows, use WinGet, which downloads the binary and adds copilot.exe to your PATH automatically:
During the installation, the script may ask if you want to add Copilot CLI to your PATH. If you say yes, then it adds the install location to your shell profile so you can run copilot from any terminal window.
If you’d rather use a package manager, Copilot CLI is also distributed through npm and Homebrew on macOS and Linux. Note that the npm method requires Node.js 22 or later:
$ # With npm
$ npm install -g @github/copilot
$ # With Homebrew
$ brew install github/copilot/copilot-cli
GitHub also publishes a Windows installer and source bundles for macOS and Linux on the Copilot CLI releases page. Use those if you need to pin a specific version or if your environment blocks the install commands above.
Once the installation finishes, close and reopen your terminal so the new copilot command is picked up. Then verify that it works:


