GitHub Copilot has completely changed how developers write code. Powered by OpenAI’s Codex model, it can autocomplete lines, write entire functions, and even explain code snippets in plain English — all within your favorite editor, Visual Studio Code.
If you’re running Windows 11 and want to bring this powerful AI assistant into your workflow, this guide will show you how to install and set up GitHub Copilot in VS Code step by step.
What Is GitHub Copilot?
GitHub Copilot is an AI coding assistant developed by GitHub and OpenAI. It integrates directly with VS Code, helping you write code faster by predicting entire lines or blocks based on natural-language comments or partial code.
It supports dozens of programming languages like Python, JavaScript, C++, Go, Java, and more — and can even help you learn new frameworks by suggesting context-aware code snippets.
Why Use GitHub Copilot?
Here are some great reasons to install it:
- AI-Powered Suggestions: Get real-time code completions as you type.
- Multi-Language Support: Works across many popular languages and frameworks.
- Faster Development: Cuts down repetitive boilerplate coding.
- Smart Context Awareness: Learns from your current file, project, and comments.
- Secure and Trusted: Built by GitHub and OpenAI — fully integrated with your GitHub account.
Step 1: Install Visual Studio Code
If you don’t already have VS Code installed on your Windows 11 PC, here’s how to get it:
- Go to the official download page: https://code.visualstudio.com/
- Click Download for Windows.
- Run the installer and follow the on-screen setup wizard.
- Once installed, launch VS Code.
Tip: During setup, check the box “Add to PATH” so you can open VS Code directly from the Command Prompt or PowerShell.
Step 2: Sign in to Your GitHub Account
GitHub Copilot requires a GitHub account linked to your subscription (free trial available).
- Open VS Code.
- Click the Account icon in the bottom-left corner.
- Select Sign in with GitHub.
- Follow the on-screen prompts to authorize access in your browser.
Once signed in, your account name will appear in the bottom-left status bar.
Step 3: Install the GitHub Copilot Extension
Now it’s time to add Copilot to VS Code.
Method 1: From the Extensions Marketplace
- In VS Code, press Ctrl + Shift + X to open the Extensions view.
- In the search bar, type GitHub Copilot.
- Click the official extension by GitHub.
- Hit the Install button.
Once installed, you’ll see a small Copilot icon appear in the VS Code status bar.
Method 2: Via Command Palette
- Press Ctrl + Shift + P to open the Command Palette.
- Type:
ext install GitHub.copilot - Press Enter and wait for installation to finish.
Step 4: Activate Copilot and Sign In
After installation, you’ll need to authorize Copilot with your GitHub account.
- When prompted, click Sign in to GitHub Copilot.
- A browser window will open asking you to authorize Copilot.
- Approve the permissions and return to VS Code.
Once successfully connected, you’ll see: “GitHub Copilot is now active.”
Note: If you already have a GitHub Copilot subscription, it will automatically activate. Otherwise, you can start a free 30-day trial.
Step 5: Verify Copilot Is Working
To confirm everything is set up correctly:
- Create a new file — for example,
test.pyorindex.js. - Type a comment describing what you want to do, such as:
# Write a Python function that returns the factorial of a number - Wait a second — GitHub Copilot will automatically suggest code in gray text.
- Press Tab to accept the suggestion.
If it works — congratulations! Copilot is now live in your VS Code editor.
Step 6: Customize Copilot Settings
You can fine-tune how Copilot behaves inside VS Code.
- Press Ctrl + Shift + P and type:
GitHub Copilot: Settings - Options you can adjust:
- Enable/disable inline suggestions
- Toggle completions for specific languages
- Control automatic popup suggestions
- You can also open the Settings UI via:
File → Preferences → Settings → Extensions → GitHub Copilot
Tip: You can disable Copilot temporarily by clicking its icon in the bottom-right status bar.
Step 7: (Optional) Install GitHub Copilot Chat
For an even better experience, install GitHub Copilot Chat — a companion extension that lets you interact with the AI directly in a chat panel.
- Open the Extensions Marketplace again (
Ctrl + Shift + X). - Search for GitHub Copilot Chat.
- Click Install and restart VS Code.
Now you can ask Copilot questions like “Explain this function” or “Optimize this loop” directly inside VS Code!
Wrapping Up
Installing GitHub Copilot in Visual Studio Code on Windows 11 is quick, straightforward, and can significantly improve your development speed.
With Copilot active, you’ll experience smart, AI-powered coding assistance that can autocomplete functions, refactor logic, and even explain code — all in real time.
Once you’ve installed it, pair it with GitHub Copilot Chat for an even more interactive and intelligent coding workflow.