GitHub Copilot Setup Guide: VS Code, Custom Instructions, Copilot CLI and Cloud Agent (2026)
Set up GitHub Copilot in VS Code, JetBrains and Visual Studio, write .github/copilot-instructions.md, install the Copilot CLI and assign issues to the Copilot cloud agent.
By Harsh Thummar 10–12 min read

GitHub Copilot is GitHub's AI assistant for developers. It suggests code as you type, answers questions in chat, makes multi-file changes with agents in your editor, works in the terminal through the Copilot CLI, and can even take a GitHub issue and come back with a pull request.
This guide covers a complete GitHub Copilot setup in VS Code, plus JetBrains and Visual Studio, custom instructions for your repository, the Copilot CLI and the Copilot cloud agent (previously called the coding agent).
Every step comes from GitHub's and VS Code's official documentation, checked on 22 October 2026. For plans and alternatives at a glance, see the GitHub Copilot tool page.
Copilot Plans in One Minute
- Copilot Free: $0, limited to 2,000 code completions per month, with automatic model selection.
- Pro: $10 per month. Pro+: $39 per month. Max: $100 per month.
- Business: $19 per user per month. Enterprise: $39 per user per month (requires GitHub Enterprise Cloud).
- There is also a Student plan, and Copilot is free for verified teachers and maintainers of popular open source projects.
You can start on Free with nothing more than a GitHub account.
Step 1: Set Up Copilot in VS Code
- Install or update VS Code.
- Hover over the Copilot icon in the Status Bar and choose Use AI Features.
- Sign in with your GitHub account.
If you don't have a Copilot subscription, you are signed up for Copilot Free automatically. VS Code installs the Copilot extensions for you. They are listed in the Marketplace as GitHub Copilot (GitHub.copilot) and GitHub Copilot Chat (GitHub.copilot-chat), and you can also install them from the terminal:
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-chatWhat you get in VS Code
- Inline completions: grey suggestions as you type. Press
Tabto accept,Escto dismiss. - Chat: open the Chat view to ask about your code, errors or docs. Reference files and symbols to give it context.
- Agents: pick an agent in the Chat view, such as Agent to make multi-file changes and run commands, or Plan to work out an approach first.
- Inline chat: press
Ctrl+I(Cmd+Ion macOS) in the editor to ask for a change right where your cursor is.
Step 2: Set Up Copilot in Other Editors
JetBrains IDEs
- Install the GitHub Copilot plugin from the JetBrains Marketplace (Settings, then Plugins).
- Restart the IDE.
- Sign in from Tools, then GitHub Copilot, then Login to GitHub.
Visual Studio
Copilot is built into Visual Studio 2022 version 17.10 and later as a single Copilot and Chat experience. Sign in with your GitHub account from the Copilot badge.
Copilot also supports Xcode and Eclipse through official extensions.
Step 3: Add Custom Instructions for Your Repository
Custom instructions tell Copilot how your project works, so you stop repeating yourself in every chat.
Repository-wide instructions
Create .github/copilot-instructions.md:
# Copilot instructions
This is a Next.js App Router project written in TypeScript.
## Build and test
- Install: npm ci
- Dev: npm run dev
- Tests: npm test
- Type check: npx tsc --noEmit
## Conventions
- Prefer Server Components; add "use client" only when needed
- Validate all API input with zod
- Use the existing Button and Input components in components/ui
- Never hard-code secrets; read them from environment variablesPath-specific instructions
For rules that only apply to some files, create files in .github/instructions/ ending in .instructions.md, with an applyTo pattern:
---
applyTo: "app/api/**/*.ts"
---
- Every route returns JSON with a consistent { data, error } shape
- Check authentication before reading the request bodyAGENTS.md
Copilot also reads AGENTS.md files, and the nearest one to the file being worked on wins. If your team already keeps AGENTS.md for other agents, Copilot will use it too.
Commit these files so the whole team gets the same behaviour.
Step 4: Install the GitHub Copilot CLI
The Copilot CLI brings Copilot's agent to your terminal. Choose one install method:
# npm (needs Node.js 22 or later)
npm install -g @github/copilot
# Homebrew (macOS and Linux)
brew install --cask copilot-cli
# Install script (macOS and Linux)
curl -fsSL https://gh.io/copilot-install | bashOn Windows (PowerShell 6 or later):
winget install GitHub.CopilotThen start it in a project and sign in:
cd my-project
copilotInside the session, type /login to authenticate with GitHub. For scripts, pass a prompt directly with -p:
copilot -p "list the TODO comments in src and group them by file"Step 5: Assign an Issue to the Copilot Cloud Agent
The Copilot cloud agent (formerly the coding agent) works on a GitHub issue in the background and opens a pull request for you to review.
- Write a clear issue: what to change, where, and how to know it is done.
- Open the issue on GitHub and click Assignees.
- Choose Copilot. You can add an optional prompt, base branch, custom agent or model.
- Copilot works on a branch and opens a pull request.
- Review the pull request like any teammate's, and leave comments to ask for changes.
A good issue for the agent looks like this:
### Add rate limiting to the contact form API
- File: app/api/contact/route.ts
- Limit: 5 requests per IP per 10 minutes
- Return HTTP 429 with a JSON error when the limit is hit
- Add a test for the limit
- Done when: npm test passesTips for Better Copilot Results
- Open the relevant files. Copilot uses your open tabs and selection as context.
- Name things clearly. Good function names and comments lead to better completions.
- Ask Plan before Agent for bigger changes, so you agree on the approach first.
- Keep instructions short. A focused copilot-instructions.md beats a long one.
- Review every change. Treat Copilot's pull requests like any other code review.
Related Guides
- GitHub Copilot: features, plans and alternatives →Verified plans from Free to Enterprise.
- Claude Code Setup Guide →A terminal agent that connects to VS Code.
- OpenAI Codex CLI Setup Guide →Codex in the terminal and VS Code.
- Cursor AI Code Editor Setup Guide →An AI-first editor alternative.
- AI Tools for Developers →Compare coding agents, editors and builders.
Frequently Asked Questions
Is GitHub Copilot free?
Yes. Copilot Free costs nothing and includes 2,000 code completions per month with automatic model selection. Paid plans start at $10 per month for Pro.
How do I enable GitHub Copilot in VS Code?
Hover over the Copilot icon in the VS Code Status Bar, choose Use AI Features and sign in with GitHub. If you have no subscription, you are enrolled in Copilot Free and the extensions are installed for you.
Where do Copilot custom instructions go?
Repository-wide instructions go in .github/copilot-instructions.md. Path-specific instructions go in .github/instructions/NAME.instructions.md with an applyTo pattern. Copilot also reads AGENTS.md files.
How do I install the GitHub Copilot CLI?
Run npm install -g @github/copilot (Node.js 22 or later), brew install --cask copilot-cli, or winget install GitHub.Copilot on Windows. Then run copilot and type /login.
What is the Copilot cloud agent?
It is the new name for the Copilot coding agent. You assign a GitHub issue to Copilot, it works on the task in the background and opens a pull request for you to review.
Conclusion
Copilot is the easiest AI assistant to start with if your code lives on GitHub: sign in from VS Code, add a short .github/copilot-instructions.md, and you have completions, chat and agents in minutes. Add the Copilot CLI for terminal work and hand well-written issues to the cloud agent.
Compare Copilot with other tools in the AI tools directory.