Code Like a Pro With The CodeGPT Using Visual Studio Code

Mohasin Hossain
3 min readJan 14, 2024

Today I will show you how to use CodeGPT in VS Code and write 10x faster code with it. You must love it I guarantee!

Obtaining CodeGPT API Key:

  1. Sign Up: Visit the CodeGPT platform’s website and sign up for an account. This may involve creating an account with OpenAI or the specific provider offering the CodeGPT API.
  2. Access API Key: After signing up, navigate to your account settings or developer console to obtain your API key. This key is crucial for authenticating your requests to the CodeGPT API.

Setting up CodeGPT Extension in VS Code:

Once you have your API key, follow these steps to integrate it into the CodeGPT extension in VS Code:

  1. Open VS Code: Launch Visual Studio Code on your computer.
  2. Navigate to Extensions: Click on the Extensions icon in the Activity Bar on the side of the window.
  3. Search for CodeGPT: In the Extensions view, find the CodeGPT extension. If you haven’t installed it yet, you can search for it and install it.
  4. Configure Extension: Once installed, look for settings (Ctrl+Shift+P). After opening the settings UI search for CodeGpt and enter your API key like below Image.
  5. Save and Reload: Save your settings and reload VS Code. This step ensures that the extension recognizes and applies the API key.

Using CodeGPT with API Key:

Now that your CodeGPT extension is configured with the API key, you can use its features within VS Code. As you write code, CodeGPT will now utilize the provided API key for enhanced code suggestions, autocompletions, and other intelligent features.

Let’s see some example how CodeGPT will do anything or even everything for you!

You can do more like the commands below:

  • Ask CodeGPT: will provide a prompt for you to enter any query
  • CodeGPT: Explain selection: will explain what the selected code does
  • CodeGPT: Refactor selection: will try to refactor the selected code
  • CodeGPT: Find problems: looks for problems/errors in the selected code, fixes and explains them
  • CodeGPT: Optimize selection: tries to optimize the selected code
  • CodeGPT: write documentation: write documentation for selected code

If you need any further help please let me know in comment.

That’s it! Hope you found this helpful!!!

--

--

Mohasin Hossain

Senior Software Engineer | Mentor @ADPList | Backend focused | PHP, JavaScript, Laravel, Vue.js, Nuxt.js, MySQL, TDD, CI/CD, Docker, Linux