Skip to content

Instantly share code, notes, and snippets.

@niallmerrigan
Last active May 7, 2026 13:49
Show Gist options
  • Select an option

  • Save niallmerrigan/6e4288f212ff6cdcae686de8dfb64e2f to your computer and use it in GitHub Desktop.

Select an option

Save niallmerrigan/6e4288f212ff6cdcae686de8dfb64e2f to your computer and use it in GitHub Desktop.
Getting Started with GitHub Copilot CLI - Setup guide

Getting Started with GitHub Copilot CLI

A practical guide for getting GitHub Copilot working in your terminal. Written for people who are comfortable with technology but don't live in the command line.

How to use this guide: Copy and paste the commands into your terminal one section at a time. Everything is designed to be run in order.


What is this?

GitHub Copilot CLI is an AI assistant that runs in your terminal. You type what you want in plain English, and it does it — writes code, edits files, runs commands, searches your codebase, manages git, and more.

Think of it as having a senior developer sitting next to you who never gets tired and has read every Stack Overflow answer ever written.

On top of that, you can extend it with:

  • MCP servers — connect it to Azure, Microsoft 365, documentation, and other services
  • Plugins — add specialised capabilities (workplace intelligence, docs search, etc.)
  • Agents — custom AI team members with specific roles and expertise

This guide walks you through setting it all up on Windows.


Step 0: Create a GitHub Account & Get Copilot Access

Create a GitHub account (skip if you already have one)

  1. Go to https://github.com/signup
  2. Enter your email, create a password, and choose a username
  3. Follow the verification steps (email confirmation, puzzle, etc.)
  4. Choose the Free plan — that's all you need to get started

💡 Use your personal email if this is for personal projects. Your username will be visible publicly, so pick something professional-ish.

Enable Copilot

Go to https://aka.ms/copilot and make sure you have GitHub Copilot enabled on your account.


Step 1: Install the Tools

Open Windows Terminal or the Start Menu → search "PowerShell" and run these commands one at a time. Each one installs a tool you'll need.

1a. Install PowerShell 7

Windows comes with PowerShell 5.1, but we want the modern version:

winget install -e --id Microsoft.PowerShell

⚠️ Close and reopen your terminal after this. Then make sure you're in PowerShell 7 by checking the window title says "PowerShell" (not "Windows PowerShell").

1b. Install Git

winget install -e --id Git.Git

1c. Install Node.js

winget install -e --id OpenJS.NodeJS.LTS

1d. Install GitHub CLI

winget install -e --id GitHub.cli

1e. Install GitHub Copilot CLI

winget install -e --id GitHub.Copilot

1f. Close and reopen your terminal

This is important — it refreshes your PATH so all the tools are available.

1g. Verify everything is installed

Copy and paste this whole block:

pwsh --version
git --version
node --version
gh --version
copilot --version

You should see version numbers for all five. If any of them say "not recognized", close and reopen the terminal again.


Step 2: Authenticate with GitHub

Start Copilot CLI for the first time:

copilot

Once it's running, type:

/login

This will open a browser window where you log in with your GitHub account. Follow the prompts to complete authentication.

Type something like "what can you do?" to test it. Press Ctrl+C to exit.

Also authenticate the GitHub CLI (needed for Squad later):

gh auth login

Follow the browser prompts. Verify with gh auth status.


Step 3: Install Plugins

Plugins add extra capabilities. You should still be in Copilot CLI from Step 2. Run these commands inside it:

Microsoft Docs — search official Microsoft documentation

/plugin install microsoftdocs/mcp

What it does: Lets you ask "how do I set up an Azure Function?" and get answers pulled directly from learn.microsoft.com.

WorkIQ — query your Microsoft 365 data

First, add the Work IQ marketplace (one-time setup):

/plugin marketplace add microsoft/work-iq

Then install the plugins:

/plugin install workiq@work-iq
/plugin install workiq-productivity@work-iq

What it does: Ask about your emails, meetings, Teams messages, and documents. Things like "what did John say about the deadline?" or "what meetings do I have tomorrow?"

Verify plugins are installed

/plugin list

Restart to pick up the new plugins

Now quit Copilot CLI:

/quit

And restart it with --resume so you can continue from where you left off:

copilot --resume

You'll see a list of recent sessions — pick the one you were just in.


Step 4: Install Squad (Optional — AI Team Agent)

Squad gives you a human-directed AI development team through GitHub Copilot. Instead of one AI assistant, you get a team of specialists — frontend, backend, tester, lead — that live in your repo as files. They persist across sessions, learn your codebase, and help you move faster without giving up oversight.

⚠️ Squad is alpha software. Commands and APIs may change between releases. It's experimental but very usable.

4a. Install the Squad CLI

In your regular terminal (not inside Copilot CLI):

npm install -g @bradygaster/squad-cli

4b. Verify the install

squad --version

You should see a version number.

4c. Initialize Squad in a project

Navigate to a git repository you want to use Squad in, then:

squad init

✓ Validate: Check that a .squad/team.md file was created in your project.

💡 Squad needs a git repo. If you don't have one yet: mkdir my-project && cd my-project && git init

4d. Run Squad with Copilot CLI

copilot --agent squad --yolo

Why --yolo? Squad makes many tool calls in a typical session. Without it, Copilot will prompt you to approve each one individually — which gets tedious fast.

4e. Your first interaction

Once Copilot launches with Squad, try:

I'm starting a new project. Set up the team.
Here's what I'm building: [describe your project]

Squad will propose a team — each member with a name, role, and expertise area. Type yes to confirm. They're ready to work.

Then try giving the team actual work:

Team, build a login page with email and password

You'll see multiple agents working in parallel — the lead analysing requirements, frontend building the UI, backend setting up auth, and testers writing test cases.

4f. Upgrading Squad

Squad is updated in two steps:

Update the CLI:

npm install -g @bradygaster/squad-cli@latest

Update Squad files in your project:

squad upgrade

This updates the agent framework files but never touches your team state — your agents, decisions, and history are always preserved.

4g. Check your setup

If something isn't working:

squad doctor

This runs diagnostics and tells you what's missing or misconfigured.


How to Use It Day-to-Day

Starting Copilot CLI

copilot

Starting Copilot CLI with Squad

copilot --agent squad --yolo

Just talk to it

Once it's running, you type in plain English:

  • "Explain what this project does"
  • "Find all files that reference authentication"
  • "Create a new React component for user settings"
  • "What's the git status and show me what changed"
  • "Write a unit test for the login function"
  • "Help me write a PowerShell script to rename files in a folder"

Useful shortcuts

  • Ctrl+C — cancel the current operation
  • Ctrl+D or type exit — quit Copilot CLI
  • /help — see available commands
  • /clear — clear the conversation history

Tips for getting good results

  1. Be specific. "Fix the bug" is vague. "The login page shows a blank screen when the password is wrong — fix it" is specific.
  2. Give context. "I'm building a Hugo site" helps more than you'd think.
  3. Iterate. If the first answer isn't right, say what's wrong and ask it to try again.
  4. Let it explore. It can read your files, search your code, and run commands. You don't need to paste code into the chat.

Quick Reference

What Command
Start Copilot CLI copilot
Start with Squad agent copilot --agent squad --yolo
Check plugins /plugin list
Install a plugin /plugin install <name>
Authenticate with GitHub copilot (first run prompts login)
Resume last session copilot --resume
Install Squad npm install -g @bradygaster/squad-cli
Initialize Squad in a project squad init
Check Squad status squad status
Diagnose Squad issues squad doctor
Upgrade Squad npm install -g @bradygaster/squad-cli@latest && squad upgrade
Check Node.js version node --version
Check Git version git --version
Check PowerShell version pwsh --version

Troubleshooting

"copilot is not recognized" Make sure you installed it: winget install -e --id GitHub.Copilot. Close and reopen your terminal to refresh the PATH.

"Not authenticated" Run copilot, then type /login and follow the browser-based login prompts.

Plugin install fails Make sure you're running the command inside Copilot CLI, not in a regular terminal.

Squad: "squad is not recognized" Make sure Node.js is installed and run npm install -g @bradygaster/squad-cli. Close and reopen your terminal.

Squad: "not a git repository" Squad needs a git repo. Run git init in your project folder first.

Squad: team isn't responding properly Run squad doctor to check your setup. Make sure gh auth status shows you're logged in.


What's Next?

Once you're comfortable with the basics:

  1. Explore plugins — WorkIQ is particularly useful if you have M365 Copilot
  2. Add MCP servers — connect to Azure, databases, and other services
  3. Create custom instructions — add a .github/copilot-instructions.md to any repo to give Copilot context about your project's conventions
  4. Try Squad — if you haven't already, install Squad and experience what it's like to have an AI team that knows your codebase. Start with squad init and copilot --agent squad --yolo
  5. Squad Watch Mode — once you're comfortable with Squad, try squad watch --execute to have Ralph (Squad's coordinator) automatically triage and handle GitHub issues

Any questions? Ask your friendly neighbourhood Copilot CLI — it can probably answer them too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment