How to Use GitHub Copilot for Your First Project in 2 Hours
How to Use GitHub Copilot for Your First Project in 2026
If you’re anything like me, diving into a new coding project can feel like staring at a blank canvas, paralyzed by possibilities. Enter GitHub Copilot. This AI-powered coding assistant can help you write code faster and more efficiently, but how do you actually get started? Let’s break it down so you can kick off your first project in just two hours.
Prerequisites: What You Need to Get Started
Before you jump in, here’s what you’ll need:
- GitHub Account: Free to sign up.
- Visual Studio Code (VS Code): Download it here.
- GitHub Copilot Subscription: $10/month after a free trial.
- Basic understanding of JavaScript or Python: This guide assumes you’re familiar with basic coding concepts.
Setting Up GitHub Copilot
- Install VS Code: If you haven’t done this yet, download and install VS Code.
- Sign Up for GitHub Copilot: Navigate to the GitHub Copilot page and choose the subscription that fits your needs. You can start with the free trial.
- Install the Copilot Extension: In VS Code, go to the Extensions panel (or press
Ctrl+Shift+X), search for "GitHub Copilot," and install it. - Authenticate: You’ll need to sign in to your GitHub account to authenticate the extension.
Starting Your First Project
Let’s say you want to build a simple web application using JavaScript. Here’s how to set it up:
- Create a New Project Folder: Open your terminal and run:
mkdir my-first-project cd my-first-project - Initialize a New Node.js Project: Run:
npm init -y - Install Express: For a simple web server, install Express:
npm install express - Create Your Main File: Create a file called
app.js:touch app.js
Using GitHub Copilot to Write Code
Now, let’s leverage Copilot to speed things up. Open app.js and start coding:
- Start with a Comment: Type
// Create an Express serverand wait for Copilot to suggest code. You should see a suggestion pop up—hitTabto accept it. - Add Routes: Type
// Add a route to return "Hello World"and again, let Copilot suggest the code. - Run Your Server: At the end of your file, type
// Listen on port 3000and accept the suggestion. - Test Your Application: In your terminal, run:
Open your browser and navigate tonode app.jshttp://localhost:3000to see "Hello World!"
Troubleshooting Common Issues
- Copilot Not Suggesting Code: Ensure you’re logged into GitHub and that the extension is enabled in VS Code.
- Errors in Code: Don’t hesitate to tweak Copilot’s suggestions; it’s not perfect! Always test your code.
What’s Next: Building on Your Foundation
Now that you have your server running, consider adding more features:
- Create additional routes to handle different endpoints.
- Integrate a database like MongoDB for data storage.
- Explore deploying your app using platforms like Heroku or Vercel.
Conclusion: Start Here
You can realistically set up your first project and get GitHub Copilot to help you code in about two hours. It’s a powerful tool that can greatly reduce the friction of starting new projects, but remember, it’s not a replacement for understanding the code you’re writing.
With your first project up and running, continue learning and experimenting with Copilot’s capabilities.
Follow Our Building Journey
Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.