Ai Coding Tools

How to Use GitHub Copilot to Write Your First Script in Under 30 Minutes

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Script in Under 30 Minutes

If you’re like many indie hackers and side project builders, you might feel overwhelmed when it comes to coding. Maybe you’ve dabbled in scripting but never felt confident enough to dive deep. Here’s the good news: GitHub Copilot can help you write your first script in under 30 minutes. This isn't just hype; I’ve done it, and I’m here to walk you through the process with practical steps.

Prerequisites: What You Need Before Starting

Before we dive in, make sure you have the following:

  1. GitHub Account: Sign up if you don’t have one.
  2. Visual Studio Code (VS Code): Download and install it. Copilot works best here.
  3. GitHub Copilot Subscription: This costs $10/month after a free trial. You can check GitHub's pricing page for details.
  4. Basic Understanding of JavaScript: While Copilot can help you, some familiarity with the syntax will make things smoother.

Step 1: Set Up GitHub Copilot in VS Code

  1. Open Visual Studio Code.
  2. Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side.
  3. Search for "GitHub Copilot" and click "Install."
  4. Once installed, sign in with your GitHub account to activate Copilot.

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

Step 2: Create a New File for Your Script

  1. In VS Code, create a new file and name it script.js.
  2. Start by typing a comment about what you want your script to do. For example:
    // This script will fetch weather data from an API and log it to the console.
    

Expected Output: Copilot will suggest code snippets based on your comment.

Step 3: Let Copilot Help You Write the Script

  1. After your comment, start typing a function. For example:
    async function fetchWeather() {
    
  2. Copilot should automatically suggest the rest of the function. If it doesn’t, you can use the Tab key to accept suggestions.

Expected Output: A full function that fetches weather data from an API.

Step 4: Test Your Script

  1. To run your script, open the terminal in VS Code.
  2. Type node script.js to execute your script.

Expected Output: The weather data should appear in your console.

Troubleshooting: What Could Go Wrong

  • Copilot Isn’t Suggesting Code: Ensure you’re connected to the internet and have signed in properly. You may also need to refresh VS Code.
  • Errors in Your Script: Double-check your API keys or endpoint URLs if the fetch doesn’t work. Copilot can help suggest fixes, but you should verify them.

What’s Next: Building Upon Your Script

Now that you’ve written your first script, consider these next steps:

  1. Enhance Functionality: Try adding features like user input for different locations.
  2. Explore Other Languages: Copilot supports languages like Python and Ruby, so why not branch out?
  3. Integrate with Your Projects: Use your new skills to automate tasks in your side projects.

Conclusion: Start Here

If you’re looking to speed up your coding process or even learn as you go, start by using GitHub Copilot with VS Code. It’s an investment of about $10/month that can save you countless hours. Dive in, follow these steps, and you’ll have a working script in no time.

What We Actually Use

For our projects, we rely on GitHub Copilot for quick snippets and to overcome writer's block. While it's not perfect and sometimes suggests less-than-ideal solutions, it significantly speeds up our workflow, especially for repetitive tasks.

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