Integrating Chatgpt to VSCode
The Developers Assistant
Hey guys, COLLINS here with another helpful tip on how to code with Chatgpt as an assistant, kinda like the way autopilot works for pilots.
We all have used CHATGPT once or twice to access better ways to program or code but you have to go through the hassle of leaving your IDE and opening your browser
What if I told you that we could use CHATGPT in our IDE without switching between browser and IDE, it goes beyond that, you could get an explanation for your code and more. Sounds nice right?
Well here's how to integrate CHATGPT into your visual studio code editor
ADDING CHATGPT TO VISUAL STUDIO CODE
Open your browser, I know you are already skeptical thinking, wasn't this supposed to prevent me from going to my browser? Trust me this would be the last time I tell you to open your browser. so open your browser and go to CHATGPT API KEY. You will need to log in to your CHATGPT account if you have one or sign up if don't have one.
If you have logged in, You should see a page like the one above.
Click on the button that says
CREATE NEW SECRET KEY
When you tap on it, You should get a secret key that begins with "SK" for example
SK-********************************
Copy the secret key, you are going to need it.
Open Visual studio code and click on the extension tab.
In the search bar, you are going to type "CODEGPT" to bring up an image like the one below
In your case, you are only going to see the "install" button, I have already downloaded it, Which is why it shows the "disable" and "uninstall" button. You might also notice the CHATGPT logo on my sidebar which I have moved to the right.
Next up we will click on the gear icon
this will show us a dropdown for extension settings which we need to configure our CODEGPT
Now after clicking the "EXTENSION SETTINGS" we are provided with the input field where we can put in our secret key which we copied earlier on
Paste the secret key we copied from
CHATGPT API KEY in the API KEY section and ET VIOLA, You have CHATGPT in your visual studio code.
you can access CODEGPT by either clicking on the CHATGPT logo on your sidebar like the one below
or could highlight a section of your code and ask CODEGPT to explain it to you like the one below
There are many things you could do with the CODEGPT.
I hope you enjoy your new assistant