π€ GitHub Copilot CLI¶
Welcome to your complete guide to GitHub Copilot CLI β from zero experience to confident user.
Whether you've never touched a terminal or you've spent years clicking through GUIs, this section will walk you through everything. No developer background needed. No coding experience assumed. Just plain English explanations of a genuinely powerful AI tool that lives right inside your command line.
Who is this for?
You β an IT infrastructure professional who knows Windows, networking, and cloud services, but hasn't lived in the terminal before. This guide meets you where you are.
What is Copilot CLI?¶
Let's start with the building analogy β because understanding where Copilot CLI sits in the stack is the single most important concept.
Think of your computer as a building with floors:
| Floor | What It Is | Real-World Analogy |
|---|---|---|
| ποΈ Foundation | Your Computer (Windows) | The building itself β walls, plumbing, electricity |
| 1οΈβ£ Floor 1 | Terminal (Windows Terminal) | A window β just a glass pane you look through. It doesn't do anything on its own |
| 2οΈβ£ Floor 2 | PowerShell (language/engine) | The staff who speak English β they understand instructions and can carry them out |
| 3οΈβ£ Floor 3 | GitHub Copilot CLI (AI assistant) | The genius manager who translates your plain English into commands the staff understand |
βββββββββββββββββββββββββββββββββββββββββββββββ
β YOU (typing commands & questions) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β GitHub Copilot CLI (AI buddy) β Floor 3β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β PowerShell (language/engine) β Floor 2β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Terminal (window/screen) β Floor 1β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Your Computer (Windows) β Foundationβ
βββββββββββββββββββββββββββββββββββββββββββββββ
Why does this matter?
When people say "I opened the terminal and typed a command," they're actually using three layers at once β the terminal (window), PowerShell (engine), and now Copilot (the AI brain). Understanding this stack helps you troubleshoot when things don't work.
Without Copilot CLI, you'd need to:
- Know the exact PowerShell command (e.g.,
Get-ChildItem -Path C:\ -Recurse -Filter *.log) - Remember every flag and parameter
- Google syntax you've forgotten
With Copilot CLI, you just say:
"Find all .log files on my C: drive"
...and it figures out the rest. That's the magic. You speak human. It translates to machine.
What Can Copilot CLI Do?¶
Here's the full picture of what your new AI terminal buddy can handle:
| Category | What It Does | Example You'd Type |
|---|---|---|
| π¬ Answer questions | Explains concepts, commands, errors | "What does the netstat command do?" |
| β‘ Run commands | Executes PowerShell, Azure CLI, git, and more β on your behalf | "List all files modified in the last 24 hours" |
| π Read & edit files | Opens, reads, searches, and modifies files on your machine | "Read the config.json file and explain what each setting does" |
| ποΈ Build things | Creates scripts, websites, config files, entire project structures | "Create a PowerShell script that checks disk space on all drives" |
| π Search & explore | Searches codebases, the web, GitHub repos, and your file system | "Search this folder for any file containing the word 'password'" |
| π Teach | Explains what commands do, breaks down errors, suggests best practices | "Explain this error message like I'm new to PowerShell" |
| βοΈ Connect to services | Talks to Azure, M365, GitHub, and other cloud services via MCP servers and skills | "List all VMs in my Azure subscription" |
| π Automate workflows | Chains multiple commands, builds CI/CD pipelines, deploys apps | "Deploy this app to Azure Container Apps" |
The key insight
You don't need to memorize commands. You describe what you want in plain English, and Copilot figures out how to do it. It's like having a senior engineer sitting next to you who never gets annoyed at questions.
Two Ways to Talk to Copilot¶
There are exactly two ways to communicate with Copilot CLI. Both are useful for different situations.
1. π¬ Plain English (Just Type Normally)¶
This is the most natural way. Just type what you want, as if you're talking to a colleague.
Copilot reads your plain English, figures out what you mean, and either answers your question or runs the right commands.
2. β‘ Slash Commands (Start with /)¶
Slash commands are shortcuts β pre-built actions that do specific things instantly.
/help β Shows all available commands
/resume β Go back to a previous session
/clear β Clear the screen
/compact β Summarize the conversation to save memory
/skills β List available skills and plugins
Think of it this way
Plain English = asking a colleague for help in conversation.
Slash commands = pressing buttons on a remote control β each button does one specific thing, instantly.
You'll use plain English 90% of the time. Slash commands are for quick actions you do repeatedly.
How Communication Works Behind the Scenes¶
Ever wonder what happens when you type something and hit Enter? Here's the journey your message takes:
sequenceDiagram
participant You
participant Terminal as Windows Terminal<br/>(local)
participant Internet as π Internet
participant GitHub as GitHub Servers
participant AI as AI Model<br/>(Claude/GPT)
You->>Terminal: Type question & hit Enter
Terminal->>Internet: Send message securely
Internet->>GitHub: Deliver to GitHub servers
GitHub->>AI: Process request
AI-->>GitHub: Generated response
GitHub-->>Internet: Send response back
Internet-->>Terminal: Deliver to your terminal
Terminal-->>You: Display answer β
Internet Required!
Copilot CLI is cloud-based. No internet = no Copilot. If your VPN drops or Wi-Fi goes down, Copilot stops responding. Your local terminal and PowerShell still work β only the AI layer needs connectivity.
How fast is it? Most responses come back in 2β5 seconds. Complex tasks (like deploying Azure resources) can take longer because the AI is running multiple commands sequentially.
What Makes It Different from ChatGPT?¶
This is the question everyone asks. Here's the honest comparison:
| Feature | ChatGPT (Web/App) | Copilot CLI (Terminal) |
|---|---|---|
| Where it lives | Browser tab or mobile app | Inside your terminal, right next to your work |
| Can run commands | β No β can only suggest commands | β Yes β actually executes them on your machine |
| Can read your files | β Only if you paste content in | β Yes β reads files directly from your file system |
| Can edit your files | β No | β Yes β creates, edits, and deletes files |
| Can deploy to Azure | β No | β Yes β provisions resources, deploys apps |
| MCP server support | β No | β Yes β connects to Azure, M365, databases, and more |
| Remembers context | Within one conversation | Within one session + can resume past sessions |
| Can search GitHub | β No | β Yes β searches repos, issues, PRs, code |
| Can access the web | Via plugins (limited) | β Built-in web search |
The key difference
ChatGPT can only TALK. It can suggest a PowerShell command, but you have to copy-paste it and run it yourself.
Copilot CLI can TALK and DO. It suggests the command and runs it β reads the output, handles errors, and keeps going until the job is done.
Think of it this way: ChatGPT is like calling a mechanic on the phone for advice. Copilot CLI is like having the mechanic in your garage, tools in hand, doing the work.
How It Learned Commands¶
You might wonder: "How does Copilot know all these commands?"
It didn't learn by "using" a computer. Here's what actually happened:
- π Trained on billions of documents β Microsoft documentation, Stack Overflow answers, GitHub repositories, PowerShell help files, Azure docs, man pages, tutorials, and more
- π§ Learned patterns β After reading billions of examples, the AI model learned that when someone says "list files," the right command is usually
Get-ChildItem(PowerShell) orls(Linux) - π¨βπ« Fine-tuned by humans β Engineers at GitHub/Microsoft reviewed outputs, corrected mistakes, and refined the model's behavior
- π Continuously improved β The model is regularly updated with new knowledge and capabilities
It's like a medical student
A doctor doesn't learn medicine by getting sick. They learn by reading thousands of textbooks, case studies, and research papers. Copilot learned commands the same way β by reading billions of examples of how commands are used, not by "using" them itself.
Does it always get it right? No. Like any AI, it can make mistakes β especially with unusual or very specific commands. Always review what it's about to do before approving.
Safety β 4 Layers of Protection¶
Copilot CLI has four layers of safety built in. Think of them as security checkpoints:
graph TB
Request([π Your Request]) --> L1
subgraph L1[πͺ Layer 1: Content Filters]
F1[Blocks harmful/malicious content]
end
L1 --> L2
subgraph L2[π¨βπ³ Layer 2: Model Training]
F2[AI refuses dangerous requests]
end
L2 --> L3
subgraph L3[π Layer 3: Tool Permissions]
F3[Asks permission before acting]
end
L3 --> L4
subgraph L4[β
Layer 4: Your Approval]
F4[You say Yes or No]
end
L4 --> Result([β
Action Executed])
style L1 fill:#4a1942,stroke:#ff66ff,color:#fff
style L2 fill:#3d1a50,stroke:#ff66ff,color:#fff
style L3 fill:#2d1a5e,stroke:#66ffff,color:#fff
style L4 fill:#1a2a6e,stroke:#66ffff,color:#fff
πͺ Layer 1: Content Filters (Bouncer at the Door)¶
Before any request even reaches the AI model, it passes through content filters. These block:
- Harmful or dangerous content
- Requests to generate malicious code
- Attempts to bypass security
Like a bouncer at a club β if your request looks suspicious, it doesn't get in.
π¨βπ³ Layer 2: Model Training (The Chef Refuses Raw Chicken)¶
The AI model itself was trained to refuse dangerous requests. Even if something gets past the content filters, the model knows not to:
- Generate destructive commands without warning
- Help with malicious activities
- Produce harmful content
Like a chef who refuses to serve raw chicken β even if a customer orders it, the chef knows better.
π Layer 3: Tool Permissions (Manager Asks Before Acting)¶
When Copilot wants to run a command that could change something (create files, delete data, deploy resources), it asks for your permission first. You'll see:
Like a manager who always checks with you before making big decisions.
β Layer 4: Your Approval (Nothing Happens Without You)¶
This is the most important layer: you are always in control. Copilot CLI cannot:
- Run destructive commands without asking
- Access systems without your credentials
- Override your decisions
You are the final checkpoint. If you say no, nothing happens.
Your responsibility
The safety layers are strong, but they're not perfect. Always read what Copilot is about to do before approving. If a command looks wrong or unfamiliar, say no and ask Copilot to explain it first.
What Copilot CLI CANNOT Do¶
It's just as important to know the limits as the capabilities:
| Limitation | Why |
|---|---|
| β Can't work offline | The AI model runs on GitHub's cloud servers β needs internet |
| β Can't access other computers | It only runs commands on your machine (unless you set up remote connections) |
| β Can't run when the terminal is closed | Close the terminal = end the session. Background tasks stop |
| β Can't bypass Windows permissions | If your Windows account can't do it, Copilot can't either. No privilege escalation |
| β Can't share your data with others | Your conversations are private. Code is not used for training |
| β Can't remember across sessions (by default) | Each session starts fresh β unless you use /resume or custom instructions |
| β Can't access your camera/microphone | It's text-only. No voice, no video |
| β Can't interact with GUI applications | It can't click buttons in Outlook or Teams β it only works in the terminal |
A good mental model
Copilot CLI is like a very smart, very fast colleague who sits inside your terminal. They can do anything you can do from the command line β but nothing more. They can't reach through the screen and click things, and they can't work when you're not there.
How I Installed It¶
Installation is surprisingly simple β one command:
Then launch it by typing:
That's it. You'll see the Copilot CLI prompt, and you're ready to go.
Prerequisites
- Windows 10/11 with PowerShell 5.1+ or PowerShell 7+
- GitHub account with a Copilot subscription (Individual, Business, or Enterprise)
- Internet connection (always required)
- Windows Terminal (recommended but not strictly required β the built-in PowerShell window works too)
First time?
When you run copilot for the first time, it will ask you to sign in with your GitHub account. Follow the prompts β it opens a browser window for authentication. After that, you're all set.
Pages in This Section¶
This section covers everything you need to know about Copilot CLI. Work through them in order, or jump to what you need:
| Page | What You'll Learn |
|---|---|
| π Sessions & Custom Instructions | How sessions work, how to resume past conversations, and how to set up permanent preferences so Copilot always behaves the way you want |
| π Skills & Plugins | The extra superpowers β Azure tools, M365 integration, MCP servers, and how to connect Copilot to external services |
| β‘ Useful Commands | Quick-reference cheat sheet of the most common commands, slash commands, and patterns you'll use daily |
Suggestion: Start with this page
Read this page fully first. It gives you the mental model you need. Then move to Sessions & Custom Instructions β that's where Copilot starts feeling truly personal.
Built with π by a fellow learner. This guide is part of the Learning Portal β documenting everything as I learn it.