Getting Started with GitHub Copilot Chat in VSCode
Tags: tutorial, ai, githubcopilot, vscode
Published: 2023-08-21 18:40:33


[GitHub Copilot Chat](https://github.com/github-copilot/chat_waitlist_signup/join) is an extension that works in your Code Editor or IDE (VS Code or Visual Studio currently) that allows you to have conversations with GitHub Copilot right from your editor.You're able to get code suggestions, build, debug and tests applications with an AI model that understands natural language right from your editor. 

### Getting started
To get started using GitHub Copilot Chat in VSCode, ensure that you have access to the extension by checking your email for access privileges. You get access privileges [ through your organization](https://github.blog/2023-07-20-github-copilot-chat-beta-now-available-for-every-organization/) or by being taken off the[ waitlist for the private beta](https://github.com/github-copilot/chat_waitlist_signup/join) for individuals. You also need to ensure that you have an active GitHub Copilot subscription.

To verify your access, click on your GitHub profile and select "Try Copilot." If you have access to GitHub Copilot, you will see a message at the top of your settings page indicating such and if you don't have access, you will be routed to another page to start your 30-day free trial.

<table>
  <tr>
    <td>
      <figure>
        <img width="1508" alt="copilot-chat-have-access" src="https://user-images.githubusercontent.com/47188731/257664686-4e5fdacf-8e65-4021-81fa-656c52a8148a.png">
         <figcaption>You have access to GitHub Copilot</figcaption>
      </figure>
    </td>
    <td>
      <figure>
        <img width="1400" alt="copilot-chat-access-signup" src="https://user-images.githubusercontent.com/47188731/257663728-98ca93a1-7947-4597-ae71-e0360f062a88.png">
        <figcaption>You do not have access to GitHub Copilot</figcaption>
      </figure>
    </td>
  </tr>
</table>

### Installing GitHub Copilot Chat & asking your first question 

Once you verify those details, follow the steps below to start using GitHub Copilot Chat:

1. Search for "GitHub Copilot Chat" in the vscode extension marketplace, and click the blue install button. After the installation, you'll be prompted to login to your GitHub Account to validate your access to copilot chat.

![how to install copilot chat](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3heciw7xz6fri289pz0r.gif)

Be sure to sign in to the GitHub account that has access to your GitHub Copilot subscription and also that has access to Copilot Chat.

2. Once you've installed the extension, you're ready to use it! You'll see a message/chat icon appear on the side of your code editor, click that icon and start asking programming related questions.

You can start by asking a simple question like "How do I set up a new ruby project?" and it will provide you with a suggestion.

![Ask copilot chat how to setup ruby project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i1sqenu71snd3o6yr1uo.gif)

And that's how you start using copilot chat in VSCode. 

### Slash Commands + GitHub Copilot Chat

There are some really amazing slash commands that you have access to as well that makes it easier to ask for help, create vscode extensions or create unit tests. To start using Slash Commands with GitHub Copilot, type `/` in the input box and you'll see the multiple options come up.

<img width="811" alt="copilot-chat-slash-command" src="https://user-images.githubusercontent.com/47188731/257674956-c0988417-7945-4184-9c24-80d296e8505b.png">

Choose one of the options and then ask a question to get a suggestion. 

### Asking GitHub Copilot Chat questions about your code

To ask Copilot Chat specific questions about the code you're working on, open up the file in your editor, and navigate to the chat extension. 

Let's say for example this is your first time interacting with this particular repository, and you don't quite understand the code, you can ask copilot chat "what does this file mean?" and it will provide a suggested explanation of what the code is doing.

![copilot-explains-code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxiqlcvignw4s5aa3nle.gif)


### Using Code Suggestions from GitHub Copilot Chat 

Whenever you ask copilot chat for code suggestions, you can accept them by copying the suggestion from the chat interface or clicking the "Insert at Cursor" button. You can also insert the suggestion into a new file, or run the code in the terminal if applicable.

![use copilot chat code suggestions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g639h4u8m3y30vb466ui.gif)

I was able to use GitHub Copilot Chat to tell me how to insert two images side by side using markdown ☺️ I copied to provided code suggestion and pasted it here and voila! I had two images side-by-side. 💃🏽

### Opening a Copilot Chat session in your editor

To make your life a little easier, we've made it possible to open up a copilot chat session right in your editor, so you don't have to go back and forth between the chat interface and your files.

To do this, click on the chat icon on the side, and click the three dots at the top and select "Open session in editor" this will move the chat into your editor, similar to how a file would be open.

![open chat session in editor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wgodfs1hueptrgqlhw43.gif)

If you have any issues, questions, comments or concerns, feel free to leave them below and I'll try as best as possible to get you an answer! I hope you enjoy using GitHub copilot Chat as much as I do!

Happy Coding!