Let's talk about a very exciting product that was recently launched by GitHub, which is called GitHub Copilot.
GitHub Copilot is your new AI Pair programmer, powered by OpenAI. It helps you to write utilify functions, tests, and explore new API(s) without having to lookup for answers on internet. It generates or autocomplete code for you.
It is already enabled on my account 🎉, so I can use it right now.
Once it is enabled, you can install it in Visual Studio Code
Let's start with some simple and basic utilify functions.
When Copilot gives you a suggestion and you hover the mouse on last character, it gives you options to navigate between Next and Previous , Accept current suggestion or Open Copilot which shows list of all the suggestions available.
These were some simple utility functions, maybe we should give a try to use Node.js default modules, such as
Depending on the what function name you use, Copilot gives different suggestions.
Okay, enough of simple examples, let's quickly build a simple CLI based application that fetch user GitHub details (
Now let's start using copilot. The very first thing is to extract username from arguments as the user will be passing it dynamically
khattakdev is a GitHub Handle
Copilot is an awesome tool that works for creating utility functions, writing test cases, and exploring new API(s). It also works for comments and it gives you multiple suggestions.