How to Use GitHub Copilot for Your First Project in Under 2 Hours
How to Use GitHub Copilot for Your First Project in Under 2 Hours
If you're just starting out in coding or looking to speed up your development process, GitHub Copilot can feel like magic. But diving into a tool like this can be intimidating, especially when you’re trying to ship your first project. In this guide, I’ll show you how to leverage GitHub Copilot to get your first project off the ground in under 2 hours. We’ll go step-by-step, so you can focus on building, not just learning.
Prerequisites
Before diving in, here’s what you need:
- GitHub Account: If you don’t have one, sign up for free.
- Visual Studio Code: Download and install this code editor.
- GitHub Copilot Subscription: As of June 2026, it’s $10/month after a free trial.
- Basic Knowledge of JavaScript: Familiarity with the language will help, but Copilot can assist you along the way.
Step 1: Install GitHub Copilot
- Open Visual Studio Code.
- Go to the Extensions tab (or press
Ctrl + Shift + X). - Search for "GitHub Copilot" and click "Install."
- Sign in with your GitHub account to activate your subscription.
Expected Output: A small GitHub Copilot icon will appear in the editor, indicating it’s ready to help.
Step 2: Start Your Project
- Create a new folder for your project.
- Open the terminal in VS Code and run
npm init -yto set up a new Node.js project. - Install any dependencies you might need. For example, if you’re building a simple web app, you might want to run:
npm install express
Expected Output: Your package.json file should now include Express as a dependency.
Step 3: Write Your First Code with Copilot
- Create a new file called
app.js. - Start typing a simple Express server setup. For instance, type
const express = require('express');and then start a new line withconst app = express();. - Watch as Copilot suggests code. Accept the suggestions by pressing
Tab.
Example Code Snippet
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
Expected Output: A functional Express server that displays "Hello World!" when accessed via the browser.
Step 4: Test Your Application
- In the terminal, run:
node app.js - Open your browser and go to
http://localhost:3000.
Expected Output: You should see "Hello World!" displayed in your browser.
Troubleshooting Common Issues
- Copilot Doesn't Suggest Code: Ensure you’re signed in, and that the extension is enabled.
- Server Not Starting: Double-check your code for any syntax errors or missing dependencies.
What's Next?
Once you’ve got your basic app running, consider adding features like routing, middleware, or database integration. GitHub Copilot can help you write these as well. Check out the documentation for Express and other libraries to see how you can extend your project.
Conclusion: Start Here
Using GitHub Copilot effectively can significantly reduce the time it takes to build your first project. With just a few steps, you can go from zero to a working application in under 2 hours. If you encounter challenges, remember that Copilot is a tool to assist you, not a replacement for understanding your code.
What We Actually Use
In our experience, GitHub Copilot is great for generating boilerplate code quickly, but remember it won't always write perfect solutions. Always review and test the code it suggests. If you’re looking for alternatives, tools like Tabnine and Codeium are worth exploring, especially if you want different perspectives on coding assistance.
Follow Our Building Journey
Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.