What is GitHub Copilot and how do I use it?

Yasmine Leung

GitHub Copilot’s newest upgrade features OpenAi’s new GPT-4 technology to assist software developers in their next project.

OpenAI unveiled their upgraded chatbot GPT-4 on March 13, 2023, which has already been applied to services such as Duolingo, Khan Academy, and Morgan Stanley.

One of the benefits of Chat GPT‘s successor is its ability to write code and even produce a website, but GitHub has taken it a step forward by applying OpenAI’s technology to their existing GitHub Copilot tool.

Here’s everything you need to know about the upgrade and how to use GPT-4 in your own coding dilemmas.

Photo credit should read CFOTO/Future Publishing via Getty Images

What is GitHub Copilot?

GitHub Copilot is an artificial intelligence tool that assists programmers in their code. Launched in June 2022, it is designed to make coding easier and faster by suggesting solutions and functions in real-time from the editor.

Users are able to describe the logic they want and Copilot will immediately suggest code to implement the solution.

The latest 2023 version with GPT-4’s model has been named GitHub Copilot X, and will include chat and voice features to make it even more convenient.

It is a chat interface that sits within an IDE sidebar window, such as Visual Studio and VS Code. Copilot X has the ability to recognize what the developer has typed, as well as the visible error messages. It can provide an in-depth analysis of the code blocks and propose bug fixes.

If you’re struggling to envision it, think of it as GitHub’s version of Microsoft Edge’s Bing Chat, which uses the same OpenAI technology. Bing Chat is an AI assistant that offers relevant suggestions depending on your search results, all of which are presented in a human-like text conversation.

As for GitHub’s Copilot Voice, developers will be able to verbally give language prompts and Copilot should write the desired code and run it on demand.

How to use Github Copilot

Copilot is available for $10 per month for individuals and $19 per month for business users. Individuals can sign up for a free trial by creating an account on the GitHub Copilot website.

Those wanting to try the new version will have to join Copilot X’s wait list.

To use GitHub Copilot in Visual Studio Code (VSC):

  1. Make sure you have an active GitHub Copilot subscription and have VSC installed.
  2. In the VSC Marketplace, go to the GitHub Copilot extension page and select Install.
  3. Click Open Visual Studio Code in the popup.
  4. In the “Extension: GitHub Copilot” tab in VSC, click Install
  5. If you have not previously authorized VSC in your GitHub account, you will need to sign in to GitHub in VSC.
  6. GitHub will request permissions for GitHub Copilot in your browser; click Authorize Visual Studio Code
  7. In VSC’s “Visual Studio Code” dialog box, click Open to confirm the authentication.

CoPilot is useful for Javascript, Python, C++, Ruby, and Go, but here is how to prompt your first suggestion with JavaScript. It can apply to other languages also.

  1. In VSC, create a new JavaScript (*.js) file.
  2. In the .js file, you can type a function header and Copilot will automatically show a suggestion in light grey text.

Related Topics