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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read