Ai Coding Tools

How to Use GitHub Copilot to Code Your First Project in Under 2 Hours

By BTW Team3 min read

How to Use GitHub Copilot to Code Your First Project in Under 2 Hours

If you're a beginner coder, you might feel overwhelmed by the idea of starting your first project. You want to build something, but figuring out how to code it can feel like trying to solve a Rubik's cube blindfolded. Enter GitHub Copilot, an AI-powered coding assistant that can help you write code faster and with less frustration. In this guide, I’ll show you how to leverage GitHub Copilot to create a simple project in under 2 hours.

Prerequisites: What You Need to Get Started

Before diving in, make sure you have the following ready:

  • GitHub Account: You'll need this to access Copilot and save your project.
  • Visual Studio Code (VSCode): This is the code editor where you'll be writing your code.
  • GitHub Copilot Subscription: Copilot costs $10/month or $100/year, with a free trial available for new users.
  • Basic Understanding of JavaScript: While GitHub Copilot helps a lot, having some foundational knowledge is still beneficial.

Step 1: Set Up Your Environment

  1. Install Visual Studio Code: Download and install it from here.
  2. Install the GitHub Copilot Extension: Open VSCode, go to Extensions, and search for "GitHub Copilot". Click "Install".
  3. Sign In to GitHub: Once installed, sign in to your GitHub account to activate Copilot.

Expected Output: You should see Copilot suggestions as you type code.

Step 2: Start a New Project

  1. Create a New Folder: This will be your project directory.
  2. Open the Folder in VSCode: Use the "Open Folder" option.
  3. Create a New File: Name it app.js. This is where you’ll write your JavaScript code.

Step 3: Write Your First Function with Copilot

Start coding a simple function. For example, let’s create a function that adds two numbers:

function add(a, b) {

Once you type this, GitHub Copilot will suggest completing the function. Accept the suggestion by pressing Tab.

Expected Output: The function should look like this:

function add(a, b) {
    return a + b;
}

Step 4: Build Out Your Project

Continue to use Copilot to build out your project. For example, if you want to create a simple calculator, you can write:

function subtract(a, b) {

Again, Copilot will suggest the rest. Repeat this for multiplication and division functions.

Example of Full Code:

function add(a, b) {
    return a + b;
}

function subtract(a, b) {
    return a - b;
}

function multiply(a, b) {
    return a * b;
}

function divide(a, b) {
    if (b === 0) {
        return "Error: Division by zero";
    }
    return a / b;
}

Expected Output: Your app.js file now has basic calculator functions.

Troubleshooting: What Could Go Wrong

  • Copilot Doesn't Suggest Code: Ensure you're signed in and that the extension is enabled.
  • Incorrect Suggestions: Sometimes Copilot suggests suboptimal code. Always review and modify as necessary.

What's Next: Expanding Your Project

Once you have your basic calculator working, consider adding features:

  • User Input: Use prompt() to get user input in the browser.
  • User Interface: Create a simple HTML interface to make it more user-friendly.
  • Deploying Your Project: Use GitHub Pages to host your project for free.

Conclusion: Get Started with GitHub Copilot Today

By following these steps, you should be able to code your first project using GitHub Copilot in under 2 hours. While Copilot is a powerful tool, remember that it’s not perfect. Always review and test your code.

If you’re looking for a practical way to jump into coding without getting bogged down by the details, GitHub Copilot is worth the investment.

Start Here:

Begin your coding journey with GitHub Copilot today and see how it can accelerate your learning and project-building process.

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

Best Codespaces: GitHub Codespaces vs Replit in 2026

Best Codespaces: GitHub Codespaces vs Replit in 2026 As we all know, coding environments can make or break your productivity as a builder. In 2026, two leading contenders in the co

Apr 10, 20263 min read
Ai Coding Tools

How to Increase Your Coding Efficiency with AI in 2 Hours

How to Increase Your Coding Efficiency with AI in 2026 As a solo founder or indie hacker, you know that time is your most precious resource. Every hour spent coding is an hour you

Apr 10, 20264 min read
Ai Coding Tools

The $100 AI Coding Toolkit: Affordable Tools for Aspiring Developers

The $100 AI Coding Toolkit: Affordable Tools for Aspiring Developers As an aspiring developer, diving into the world of coding can feel overwhelming, especially with the myriad of

Apr 10, 20265 min read
Ai Coding Tools

How to Implement AI Coding Tools in Your Workflow in Just 2 Hours

How to Implement AI Coding Tools in Your Workflow in Just 2 Hours If you're a solo founder or indie hacker, you probably feel the pressure of coding demands on your time. AI coding

Apr 10, 20264 min read
Ai Coding Tools

The Top 5 AI Coding Tools You Should Try This Year for Faster Development

The Top 5 AI Coding Tools You Should Try This Year for Faster Development As indie hackers and solo founders, we know that time is money. In 2026, the pressure to ship faster than

Apr 10, 20264 min read
Ai Coding Tools

Why Popular AI Coding Tools Are Overrated: A Critical Analysis

Why Popular AI Coding Tools Are Overrated: A Critical Analysis As a solo founder or indie hacker, you might feel the pressure to integrate the latest AI coding tools into your work

Apr 10, 20264 min read