Verily, one of the myriad ways wherein AI doth transform the world doth lie in the realm of intelligent code completion and the translation of natural language into code. In this realm, OpenAI hath stood at the vanguard, wielding its GPT-3 series Codex model and the most recent GPT-4 model. Shouldst thou seek to employ ChatGPT within Visual Studio Code itself, peruse this tutorial to learn of CodeGPT. ‘Tis an AI assistant that doth dwell within VS Code, whereupon thou canst engage it in conversation, utilize its prowess to uncover errors in code, debug code, and more. Not only that, with but a simple comment, thou canst beseech CodeGPT to conjure code in any language thou dost desire. Apart from this, thou canst inquire of it to expound upon a snippet of code, refactor said code, pen documentation, and more. With all that now behind us, let us delve into the art of installing and utilizing CodeGPT in VS Code.
‘Tis in this treatise that we doth impart the steps required to install and operate CodeGPT in VS Code. Moreover, we doth expound upon the utilization of the latest alternative to ChatGPT for coding – GitHub Copilot X – within thine IDE such as VS Code. Peruse yon table below to navigate swiftly to the section that doth kindle the most interest in thee.
Alas, no headings doth reveal themselves. First, methinks thou must save or update the post ere continuing.
How to Establish CodeGPT in VS Code
A plethora of extensions in VS Code do seek to provide the finest integration with ChatGPT, yet ’tis CodeGPT by Daniel San that mayhap reigns supreme (visit https://www.codegpt.co). Deeply intertwined with VS Code, this extension doth support a plethora of features. Thou canst engage CodeGPT in conversation, generate code through a comment, expound upon and pose queries regarding selected code, scour StackOverflow for solutions, refactor code, and more.
The greatest boon of all lies in the fact that thou needst not lay out any coin for the extension. However, verily, thou must possess sufficient credits to engage the OpenAI API. Shouldst thou wish to harness the latest GPT-4 model, access to the GPT-4 API is a prerequisite. Thus, without further ado, let us commence.
-
Unveil Visual Studio Code and navigate to the “Extensions” menu on the left. Therein, search for “codegpt” and opt for “Code GPT” from the search results. Alternatively, thou canst click hither to directly access the CodeGPT extension within VS Code.
- Following this, clicketh “Install,” whereupon Code GPT shall be appended to VS Code in a matter of scant seconds.
- Upon completion of the installation, mere usage of the “Ctrl + Shift + P” shortcut shall unfurl the command bar. Therein, type “codegpt” and proceed to “Set API KEY.”
- Aye, it shall then request thine OpenAI API key.
- To procure the API key from OpenAI, direct thy steps to https://platform.openai.com/account/api-keys and select “Create new secret key”. Thereupon, copy the API key.
Note: The API key doth only appear upon its generation, and thou canst not view or copy it at a later time. Hence, we strongly advise thee to forthwith copy and paste the API key.
- Now, doth paste the API key within Visual Studio Code and press Enter. Verily, thou art nigh unto completion.
How to Employ CodeGPT in VS Code
Upon successful endowment of the API key unto the CodeGPT extension in VS Code, thou art now primed to employ its faculties. Below dost unfold the diverse scenarios wherein this ChatGPT extension for coding shall prove its mettle:
- To breed code, simply append a comment for the task at hand and engage the “Ctrl + Shift + I” keys in unison.
- Hereupon shall the code burgeon forth on the right. Thou may then copy and transpose the code unto thine principal block.
- Besides this, thou mayst select code, right-click thereupon, and bid CodeGPT to expound upon the code, refashion it, ascertain issues, debug, and more.
- By unpacking the code for the bespoke ChatGPT-powered AI bot we did instruct thee to fashion in a recent guide, we did underscore a portion of the text. Behold, the explanation of our code by CodeGPT.
- Thou may also unveil the extension directly from the left sidebar and converse with CodeGPT should any further queries besiege thee.
- Lastly, to tailor CodeGPT, bestow a click upon its icon in the left sidebar and open “Settings”. Therein, thou may opt for thine OpenAI model, maximum tokens per request, temperature, language, and more.
How to Enlist GitHub Copilot in VS Code
Recently, GitHub hath heralded its Copilot X initiative, wherein the colossal power of OpenAI models, encompassing Codex and GPT-4, doth converge. Shouldst thou seek a more streamlined solution, GitHub Copilot doth proffer all this for $10 a month or $100 per annum. Opting for the yearly plan doth also include a 2-month complimentary trial.
With GitHub Copilot X, thou may converse with the AI, entreat it to script code, debug the code, expound upon snippets, garner enlightenment from documentation, and much more. Furthermore, GitHub Copilot is not confined solely to Visual Studio Code but doth also embrace other IDEs like JetBrains, Neovim, and Visual Studio. Let it not slip thy mind that it doth support over a dozen programming languages, encompassing Python, JavaScript, Go, TypeScript, Ruby, and beyond. To wield GitHub Copilot in VS Code, employing the GPT-4 model for code completion and suggestions, hearken unto the instructions below.
- Unveil VS Code and navigate to the “Extensions” menu on the left sidebar. Therein, seek out “copilot” and install “GitHub Copilot“.
- Subsequently, click on “Sign in to GitHub” nestled in the bottom-right corner.
- Thereupon, ingress thy GitHub account and select thy plan. As illustrated, thou may assay this extension for 60 days ere deeming fit to remunerate for the service.
- Upon fulfilling this, thou may access GitHub Copilot within thine IDE, replete with context-aware suggestions, bolster for pull requests, PR descriptions, CLI assistance, and more.
Thus, thou hast been schooled in the deployment of the CodeGPT extension in VS Code, thereby augmenting thy productivity by leaps and bounds. As per a recent study, AI assistance in coding can serve to heighten developers’ efficiency by delegating repetitive tasks unto the AI, permitting the developer to divert their focus toward more meaningful endeavors. Thus, shouldst thou find thyself captivated by the new incarnation of OpenAI and desirous of employing ChatGPT-4 sans charge, hearken unto our article for an array of splendid resources. Shouldst thou desire to operate a ChatGPT-like LLM offline within thy PC, peruse our exhaustive guide. Shouldst thou possess queries, pray reveal them within the comment section below.
Support our work ❤️
If you enjoyed this article, consider leaving a tip to help us keep publishing great content.






































