imagine having a peer programmer who never takes a break and knows many programming languages that's GitHub co-pilot and today I'm going to show you everything you need to know to get started using it welcome back to GitHub for beginners last season we covered the basics of git and GitHub this season we're diving into something really really exciting GitHub co-pilot whether you're were new to developer a seasoned engineer or just curious about AI pair programming in this episode we will get you up and running with GitHub cpilot give you an overview of the different licenses available for you and use GitHub co-pilot for the very first time I'm cadesa and I'm so excited that you're here with me today now let's get into it okay so let's start at the beginning what is GitHub co-pilot getup co-pilot is an AI pair programmer that helps you write code faster it is designed to help with programming tasks and serves as your assistant while you're working in your editor and on github.com don't forget that part but it's more than just code completion it's a complete coding companion that can help you write code from natural language understand shell commands remember things you forgot describe changes in your pull requests and even help you with debug bugging plus so much more it is available in Visual Studio code Visual Studio jet brains idees neovim xcode on GitHub mobile and in your Terminals and on github.com you can use it with a variety of programming languages in your editor of choice now how do you gain access to GitHub co-pilot to use GitHub co-pilot you must have a GitHub account and a GitHub co-pilot license there are four license options available to you you can sign up for GitHub co-pilot for free or co-pilot Pro for individuals or you can get access from your job through a co-pilot business or an Enterprise license if you're a student or an educator you can get access to co-pilot Pro for free through GitHub education you can also get free access if you are a popular open source project maintainer to see a list of all the features available for each tier for each license click the link that pops up on the screen if you've never used GitHub co-pilot before I encourage you to sign up for co-pilot for free to give it a go it's really good once you sign up for GitHub co-pilot you are ready to install and use it in your editor installing GitHub copilot differs depending on where you're using it if you're using vs code navigate to the extensions Marketplace and search for GitHub co-pilot click on the extension that pops up and click install this will install two extensions gith up co-pilot which provides inline coding suggestions and its companion GitHub copilot chat a conversational AI assistant that helps you with coding specific tasks once installed you'll need to sign into vs code with your GitHub account that has access to GitHub co-pilot if you didn't previously authorize vs code in your GitHub account you're prompted to sign in to GitHub in vs code alternatively you can sign into GitHub in vs code by selecting the accounts menu in the activity bar and then sign in with GitHub to use GitHub co-pilot once you do that you're navigated to your browser where you can grant GitHub the necessary permissions needed for GitHub co-pilot click continue to authorize Visual Studio code to approve and you're all set return to your editor and you'll notice a compilot icon at the top next to the command center you'll also notice a co-pilot icon at the bottom of the editor where if you click it it may ask you to select the account you want to use then we'll show you the menu options where the status should say ready if you see these icons in your vs code you've successfully installed GitHub co-pilot and you're ready to use it now if you're using jet brains IDE let me show you how you can install GitHub cop pilot I'll be using pie charm today but these instructions are the same across jet brains editors open your editor of choice and navigate to the plugins Marketplace search for GitHub co-pilot and click install and restart your IDE open up a project and you'll notice a co-pilot icon on the right hand side of your editor you'll also notice two icons on the left hand side one with GitHub co-pilot with a question mark and the other with a chat icon select the first co-pilot with the question mark icon to get a brief overview of what GitHub co-pilot is and a welcome message click on the copilot with the chat icon to open up copilot chat where you can get help with programming related queries if you see these icons in your jet brains IDE you've successfully installed GitHub co-pilot if you didn't previously authorize jet brains in your GitHub account you're prompted to sign in to GitHub in your editor alternatively you can click on the co-pilot icon at the bottom and select login to GitHub click copy and open and click continue in your browser to approve the permissions needed press command V or control V to paste the code click continue and finally select authorized GitHub co-pilot plug-in return to your editor and you will see a message that GitHub copilot has been successfully installed now we can authorize GitHub copilot chat click on the chat icon and click the authorize button select copy and open and paste the code in your browser click authorize GitHub co-pilot for jet brains IDE return to your editor and you should see a greeting from GitHub copilot chat once you've done that you're now ready to use GitHub co-pilot in jet brains okay now that we have co-pilot installed in our editors let's take a look at how to use it for today's example I'll be using python in vs code create a new file called validate .pi once you start typing GitHub co-pilot will generate suggestions based on what it believes you want to do for example I can import the REM module and when I click enter co-pilot will give me suggested code based on what it believes I want to do because the file is named validate email email it provides code for validating an email I can click the tab key on my keyboard to accept a suggestion when I click the return key it keeps the fun going by providing the main function to run the code if I hover over the suggested code I can see the multiple options available to me I can also open the completions panel to see even more suggestions that's been generated and accept suggestions from there this is inline code complete inaction where that gray text represents ghost texts that have copilot suggestions if you try this on your machine and you got a different response that is okay one thing to keep in mind when you're working with GitHub co-pilot or any llm is that responses are nondeterministic this means that we're likely to get a different result each time we use GitHub co-pilot and the result I get May differ from the one that you get we can take this a step further by using GitHub copilot chat let's say we want to understand what this code means I'm seeing it for the first time and I want to get up to speed very quickly I can open up copilot chat and type SL explain and get a detailed explanation of what's happening in the code you'll notice that kilot chat has a view of the currently open fil as indicated by the icon right here when I click enter I get a nicely formatted explanation off the code now let's say I wanted to improve the reject and allow users to enter multiple email addresses I can make that query right here in copil a chat I can say allow users to enter multiple email addresses for validation and also improve the reject to be more robust then I get a plan and updated code block and a list of changes that were made I can click the apply and editor button button to accept the changes and GitHub co-pilot will go in and make the updates on my behalf now before we wrap up here let me take some time to address the elephant in the room there are so many co-pilots out there so what makes GitHub co-pilot different and what's the difference between GitHub co-pilot and other co-pilots well GitHub copilot is specifically designed for programming and because it works and exists where you work in your editor and on github.com there is no need to go back and forth between your browser or another application and your code you're able to truly stay focused and no longer contact switch so when you hear the words GitHub co-pilot know that it is referring to your personal AI paay programmer so we covered quite a bit today but you now know what GitHub co-pilot is how to get access to it how to install it authenticate and start using it you also know the difference between GitHub co-pilot and other co-pilot tools do let me know if you have any questions just drop them Below in the comments thanks so much for joining us today and if you want to learn more we've created a blog post that accompanies this episode click the link in the description to be taken there you can also ask your questions in the GitHub Community thread the link will be in the descriptions below remember to sign up for GitHub co-pilot if you haven't already done so to get started for free and join us in the next episode where we'll walk through essential features off GitHub co-pilot don't forget to subscribe to our channel so you don't miss any future episodes and until then Happy coding [Music]