Software development assistant based on GPT. Auto-complete code, give software architecture suggestions, debug, simulate executions, and all the other functions that GPT can perform if good prompts are used.
Use GPT-3.5-turbo (current ChatGPT) or GPT-4 (if you have access!).
Autocode: Select a code snippet and GPT will automatically generate new code (works better if you specify using comments what you want GPT to write!). If no code is selected, all the code before the cursor's position will be passed to GPT (20,000 chars ~ 4,000 tokens is the max length).
- Autorun: GPT simulates how the selected code would run, giving details about variables values, exceptions raised, bugs and information about runtime and compilation.
- Autorun in Sequence: GPT simulates, sequentially and step-by-step, how the selected code would run. Analyzes the possible inputs and outputs from the program.
- Autorun with Example: GPT simulates, sequentially and step-by-step, how the selected code would run, giving an example as if GPT were a user.
Ask Problem: Select a code snippet and ask GPT about a problem that the code snippet has or might have.
Autochange: Select a code snippet and ask GPT to change something about it.
Explain: Select a code snippet and ask GPT to explain what it does.
Ask Free: Select a code snippet and ask GPT anything you want. If no code is selected, GPT will not receive any code and the prompt will only consist of the message that you typed.
Design Patterns Suggestions: Select a code snippet and GPT will tell you the best design patterns to apply.
Design Pattern: Select a code snippet, enter the name of a design pattern and GPT will apply it to the code snippet.
More features coming soon...
How to use
Setup your settings. Go to
File/Preferences/Settings and type
GPT Developer. You will see two fields:
Open AIKey. Choose a model and enter your OpenAI key. You can see more details about how to fill them in the Extension Settings section.
Go to your code and start playing with GPT! You can see all the commands that this extension provides by going to
View/Command Palette... (or using the default shortcut
Ctrl + Shift + P). An input box will appear; type
>GPT Developer: and all the commands will be displayed. To execute a command, just click on it.
This extension contributes the following settings:
gpt-developer.openAIKey: Your OpenAI API key. Leave this field blank if you already have a key in the OPENAI_API_KEY environment variable and you want to use it instead. Your data is completely secure! This key will be stored in your computer, so only you have access to it. If for some reason you don't want to store your key in this settings attribute, just set the OPENAI_API_KEY environment variable and leave this field blank.
gpt-developer.model: The model from OpenAI that you want to use (e.g.
gpt-developer.maxTokens: Maximum number of tokens that GPT will generate. The higher this value, the more tokens will be used. There's the possibility that, considering also the number of input tokens (length of the selected code), the token limit of the model is surpassed and it will not be possible to receive a response from the model.
Fix 1 bug.
Fix environment variable name.
Added Esoteric, Refactorize, Design Patterns Suggestions and Design Pattern commands.
Added Autorun Example and Autorun Sequential commands.
Fix 1 bug.
Escape HTML for all code generated by GPT.
Fix 3 bugs.
HTML content generated by GPT is now correctly displayed as plain text.
Added max tokens configuration.
Added Ask Free command.
Added Autocode, Autorun, Ask Problem and Autochange.
I'll be updating this extension frequently, making as many interesting and useful features as possible!