GitHub Copilot (App & CLI)
Last reviewed
BeginnerWhat you'll learn
~15 min- Know what the GitHub Copilot app and VS Code agent mode offer without a terminal
- Install and sign in to Copilot CLI (skip if you did it in Lesson 1.2)
- Run the build loop (plan, approve, build, check, keep) with plan mode
- Understand AI Credits, plans and tool approval
This is the in-depth lesson for GitHub Copilot. If Copilot is the tool you installed in Lesson 1.2, you are set up already: use this page for its modes, credits and approvals. Not your tool? Pick another from the Module 6 hub; one tool is enough.
Copilot in VS Code works inside GitHub Codespaces, so you get the full Copilot experience without a local install. See the Cloud Sandbox Cheat Sheet for pricing, or set up your sandbox.
Desktop app or CLI
The GitHub Copilot app is GitHub’s desktop agent, built on Copilot CLI: download it from GitHub’s docs for macOS, Windows, or Linux. It is included on every Copilot plan, Copilot Free ($0) among them, so a GitHub account is all you need.
You open a local folder, a GitHub repository, or a project with no repository, then work in Interactive (it checks in with you), Plan (it lays out the work for you to approve first) or Autopilot (it keeps going through a task). It can also keep Canvases, shared documents you and the agent edit together, and run Automations on a schedule. If you have the CLI, copilot app opens the app. If you already work in VS Code, Copilot’s agent mode there is another graphical way in: pick the agent from the Agent dropdown in the chat view.
Copilot CLI is GitHub’s standalone agent for the terminal (the old gh copilot suggest / explain extension is superseded). It reads your codebase, edits files, runs commands and iterates on errors, with deep GitHub integration for Issues, PRs and Actions. Copilot offers models from several makers (Claude 5.5 and Fable 5.2, GPT-6.2, Gemini 4, Microsoft’s MAI Code 2); Copilot Fusion routes each task to a suitable model, and /model shows what your plan lets you pin (supported models).
Install & sign in (skip if you already set this up in Lesson 1.2)
All you need is a GitHub account; create one free at github.com. The Copilot CLI is a standalone tool: it does not require the GitHub CLI (gh), and none of these routes needs Node.js.
curl -fsSL https://gh.io/copilot-install | bashOr with Homebrew: brew install --cask copilot-cli.
Windows native: Copilot CLI needs PowerShell 6 or later, and Windows ships with the older Windows PowerShell 5.1. Install the current PowerShell first:
winget install Microsoft.PowerShellOpen the new PowerShell 7 (it appears in Windows Terminal and the Start menu as PowerShell, separate from Windows PowerShell), then install Copilot CLI:
winget install GitHub.CopilotWSL:
curl -fsSL https://gh.io/copilot-install | bashcurl -fsSL https://gh.io/copilot-install | bashOr with Homebrew: brew install --cask copilot-cli.
Alternative: npm (any platform, Node.js 22 or newer): npm install -g @github/copilot
Verify with copilot --version. Several releases ship each week and the CLI auto-updates. If you get “command not found,” restart your terminal, since the installer may have updated your PATH.
Sign in
Start it and follow the prompt:
copilotIf you’re not logged in, Copilot CLI asks you to run /login. On a local desktop that opens a browser sign-in; over SSH, in Codespaces, dev containers or headless Linux it uses the GitHub device flow, showing a one-time code to enter at github.com/login/device. If COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN is set, it silently overrides the stored login. Then Copilot asks whether you trust the files in the current folder.
Plans and AI Credits
Copilot Free is open to anyone with a GitHub account. It includes the CLI, the Copilot app, up to 2,000 completions a month and an allowance of AI Credits for chat and agent work, with automatic model selection only. That makes Copilot the lowest-barrier entry point of the four tools.
GitHub meters chat and agentic work in AI Credits (one credit is $0.01, charged at each model’s per-token price); annual Pro and Pro+ subscribers stay on legacy “premium requests”. Code completions stay unlimited on paid plans.
| Plan | Price | Notes |
|---|---|---|
| Copilot Free | $0 | 2,000 completions/mo; unpublished AI-Credit allowance; automatic model selection only |
| Copilot Student | $0 (verified students) | Unlimited completions; unpublished AI-Credit allowance; automatic model selection only |
| Copilot Pro | $10/mo | 1,500 AI Credits/mo (worth $15) |
| Copilot Pro+ | $39/mo | 7,000 AI Credits/mo (worth $70); premium models |
| Copilot Max | $100/mo | 20,000 AI Credits/mo (worth $200); priority access to premium models |
| Copilot Business | $19/seat/mo | 1,900 AI Credits/user/mo, pooled; admin controls |
| Copilot Enterprise | $39/seat/mo | 3,900 AI Credits/user/mo, pooled; knowledge bases, audit |
From GitHub’s plans and usage-based billing pages; the Cloud Sandbox Cheat Sheet keeps current prices for every tool. To stop extra spend, set a Bundled AI credits budget to $0 and turn on Stop usage when budget limit is reached. Students and verified teachers can qualify for free benefits at education.github.com.
GitHub retires older models from Copilot in waves; the most recent, on 2026-11-16, removed Claude Opus 5 (use Opus 5.5) and GPT-5.6 Terra. If a saved setting or script names a model that no longer answers, run /model and pick a current one.
Your first build
Already built welcome.html in Lesson 1.2? You’re set. If you are trying Copilot as a second tool, run Lesson 1.2’s Step 2 in your ai-class folder.
The build loop in Copilot
The rhythm is plan, approve, build, check, keep.
Plan mode
Open copilot in your project folder, then type /plan or press Shift+Tab to enter plan mode (one press from the normal mode shows Plan at the bottom of the screen). Describe the goal in one or two sentences. Copilot writes a structured plan; since version 1.0.71 it blocks the built-in tools that would change your files. When the plan is right, pick “Accept plan and continue” and it builds. Then check the result (/review, /diff) and ask Copilot to save a checkpoint (Module 7). The four tools side by side are in the tool modes table.
Copilot also runs in programmatic mode: copilot -p "add error handling to all API routes" --allow-tool='write' runs one prompt and exits. It cannot stop to ask for approval, so name the tools it may use.
Key commands
| Command | What it does |
|---|---|
/help | Show available commands |
/model | Switch the underlying AI model |
/context | Show current token usage |
/plan | Plan the work before executing (or Shift+Tab) |
/init | Scaffold custom instructions for this repository |
/review | Review your changes before you keep them (/security-review for a security pass, /diff to see changes) |
/resume | Pick up an earlier session (copilot --continue reopens the most recent) |
/usage | Show usage and credit consumption |
/limits | Set a soft limit on the AI Credits a session may spend (minimum 30) |
Run /help for the full set; the command surface expands quickly. Copilot lists /rewind in its help, but what it restores is not documented, so ask the agent to save a checkpoint before each task and treat that as your undo.
Tool approval
Copilot CLI asks for permission before running commands or writing files. Flags change that:
# Allow specific toolscopilot --allow-tool='shell(git)'
# Approval prompts off: tools, file paths and web addresses (the same as --yolo)copilot --allow-all
# Block specific tools; deny rules win even when everything else is allowedcopilot --allow-all-tools --deny-tool='shell(rm)' --deny-tool='shell(git push)'Started as plain copilot, it asks before running a command or writing a file you have not allowed (/permissions show tells you which approval mode it is in). This course starts practice sessions with copilot --allow-all, which turns on every permission at once without asking (what that does and does not protect). GitHub notes that automatic approval can allow destructive operations and suggests a sandbox before granting wide permissions. To be asked more often, start with just copilot.
Custom instructions
/init (or copilot init from the shell) scaffolds custom instructions so Copilot has persistent context about your project. Copilot reads .github/copilot-instructions.md, and also AGENTS.md, CLAUDE.md and GEMINI.md natively, so a brief file you keep for another tool works here too (custom instructions).
More: autopilot, delegation, scheduled prompts
Newer builds add /autopilot (keep working through a task without waiting for you between steps; the allow and deny flags still decide which tools it may use), /delegate (or start a line with &) to hand a task to Copilot’s cloud agent, which opens a draft PR (paid plans only), /fleet (parallel subagents), /tasks, /worktree, /skills and /plugin. Set a soft spend limit on an autonomous run:
copilot --mode autopilot --max-ai-credits 50 --allow-tool='shell(npm test)' --allow-tool='write' -p "fix the failing tests"Scheduled prompts (/every 1h ..., /after ...) are experimental and appear only after /experimental on (schedule prompts).
🏛️In Your Field: Government Devclick to expand
Allow specific tools while blocking risky ones: copilot --allow-tool='shell(git)' --deny-tool='shell(rm)'. Copilot also understands your Issues and PRs natively, useful for agencies that track projects and compliance documentation in GitHub.
Verify it works
copilot --version should print a version number; if you get an error, make sure copilot is in your PATH.
When Things Go Wrong
Use the Symptom → Evidence → Request pattern: describe what you see, paste the error, then ask for a fix.
Key Takeaways
- Two ways in, both free: the GitHub Copilot app (or VS Code agent mode) with no terminal, or the CLI (
curlon macOS/Linux; PowerShell 7 pluswinget install GitHub.Copiloton Windows); Copilot Free covers both - The build loop: plan, approve, build, check, keep;
/planorShift+Tabfor plan mode - Interactive and programmatic modes:
copilotfor persistent sessions,copilot -p "prompt"for one-off tasks - Tool approval keeps you safe:
--allow-tooland--deny-toolcontrol what the agent can do - Deep GitHub integration is the standout advantage: native understanding of Issues, PRs and Actions