GitHub Copilot shifts to usage-based pricing June 1 - why that's no surprise
Back to Tutorials
toolsTutorialbeginner

GitHub Copilot shifts to usage-based pricing June 1 - why that's no surprise

April 27, 20263 views5 min read

Learn how to set up and use GitHub Copilot, the AI coding assistant that's shifting to usage-based pricing. Create a Python project and experience AI-powered code suggestions.

Introduction

In this tutorial, you'll learn how to set up and use GitHub Copilot, the AI-powered coding assistant that's shifting to usage-based pricing. You'll create a simple Python project and see how Copilot can help you write code faster. This tutorial is designed for complete beginners who want to understand how AI coding tools work and how to get started with them.

Prerequisites

Before starting this tutorial, you'll need:

  • A GitHub account (free at github.com)
  • A code editor that supports GitHub Copilot (Visual Studio Code is recommended)
  • Basic understanding of Python programming concepts
  • Python installed on your computer

Step-by-step Instructions

Step 1: Create a GitHub Account and Enable Copilot

Why this step matters

GitHub Copilot requires a GitHub account to function. You'll need to sign up or log in to access the service and set up your billing information.

  1. Visit github.com and create a free account if you don't already have one
  2. Sign in to your GitHub account
  3. Navigate to github.com/copilot
  4. Click on "Get Copilot" to start the setup process
  5. Choose your subscription plan (free tier is available for students and individuals)

Step 2: Install Visual Studio Code

Why this step matters

GitHub Copilot integrates directly with Visual Studio Code, making it the most popular choice for developers. VS Code provides the best user experience for Copilot.

  1. Visit code.visualstudio.com
  2. Download the appropriate version for your operating system (Windows, macOS, or Linux)
  3. Run the installer and follow the setup instructions
  4. Launch Visual Studio Code once installation is complete

Step 3: Install the GitHub Copilot Extension

Why this step matters

The Copilot extension adds AI-powered coding assistance to your code editor. Without this extension, you won't be able to use Copilot's features.

  1. In Visual Studio Code, press Ctrl+Shift+X (or Cmd+Shift+X on Mac) to open the Extensions panel
  2. Search for "GitHub Copilot" in the search bar
  3. Click on the GitHub Copilot extension by GitHub
  4. Click the "Install" button
  5. Restart Visual Studio Code when prompted

Step 4: Sign In to GitHub Copilot

Why this step matters

Signing in links your GitHub account to Copilot, allowing it to access your GitHub repositories and provide personalized suggestions.

  1. After restarting VS Code, look for the Copilot icon in the left sidebar (it looks like a robot)
  2. Click on the Copilot icon
  3. Select "Sign in to GitHub"
  4. Follow the prompts to authenticate with your GitHub credentials
  5. Allow Copilot to access your GitHub account when prompted

Step 5: Create a Simple Python Project

Why this step matters

Creating a project allows you to practice using Copilot with real code. This simple project will demonstrate how Copilot suggests code as you type.

  1. Open Visual Studio Code
  2. Create a new folder on your computer for this project (e.g., "copilot-demo")
  3. Open this folder in VS Code using "File" → "Open Folder"
  4. Create a new file named "calculator.py"
  5. Start typing Python code to see Copilot suggestions in action

Step 6: Try Copilot's Code Suggestions

Why this step matters

This is where you'll experience the power of AI coding assistance. Copilot will suggest code completions as you type, helping you write code faster.

  1. In your calculator.py file, type the following code:
# Simple calculator program

def add(x, y):
    
  1. As you type, you'll notice a suggestion box appears below your cursor
  2. Press Tab to accept Copilot's suggestion
  3. Try typing a few more functions like subtraction, multiplication, or division
  4. Example: Type "def subtract" and see what suggestions appear

Step 7: Understanding Usage-Based Pricing

Why this step matters

With the new pricing model, you'll need to monitor your usage. Understanding how this works helps you manage your coding time and resources effectively.

  1. After using Copilot for a while, check your GitHub billing settings
  2. Visit your GitHub account settings and navigate to "Billing and plans"
  3. Look for the Copilot usage section to see how many credits you've used
  4. Remember that in the new model, you'll need sufficient credits to continue using Copilot

Step 8: Practice with a Complete Example

Why this step matters

Putting everything together with a complete example helps solidify your understanding of how Copilot works in practice.

  1. Start with a new Python file called "todo_app.py"
  2. Try to write a simple to-do list application using Copilot's suggestions
  3. Example: Type "class TodoList:" and see what Copilot suggests for methods
  4. Use Copilot to help you complete functions like adding items, removing items, and displaying the list

Summary

In this tutorial, you've learned how to set up GitHub Copilot for the first time. You've installed the necessary software, created a project, and practiced using AI-powered code suggestions. Understanding the new usage-based pricing model is important as it affects how you'll use the tool. Remember that with Copilot, you'll need to keep track of your credits to continue using the service. This tutorial gives you a solid foundation for using AI coding assistants and preparing for the new pricing structure that GitHub is implementing.

Source: ZDNet AI

Related Articles