CodeForgeAI - Visual Studio Code Extension for Code Generation
CodeForgeAI is an advanced Visual Studio Code extension that empowers you to effortlessly generate code snippets by providing comments. With the help of artificial intelligence, powered by OpenAI's GPT-3.5 language model, CodeForgeAI enhances your coding productivity and streamlines the development process.
Features
Seamless code generation: Simply annotate your code files with comments specifying the code you want to generate, and CodeForgeAI will automatically produce the desired code snippets for you.
AI-driven code completion: CodeForgeAI employs cutting-edge AI technology to provide intelligent code completion suggestions, aiding you in writing code more effectively.
Customizable code templates: Tailor CodeForgeAI to your project's specific needs by creating custom code templates that align with your preferred coding style and conventions.
Multi-line and single-line comment support: CodeForgeAI accommodates both single-line and multi-line comments, allowing you to generate code from various comment formats.
API key configuration: Configure your OpenAI API key through Visual Studio Code's settings, ensuring seamless integration with the CodeForgeAI extension.
Building and Installing Locally (For Developers)
Clone the CodeForgeAI repository from GitHub:
git clone https://github.com/karthik137/code-forge-ai.git
Install the project dependencies by running the following command in the terminal:
npm install
Build the extension by running the following command in the terminal:
vsce package
This will generate a .vsix file in the root of the project.
To install the extension locally, open Visual Studio Code and go to Extensions view (Ctrl+Shift+X).
Click on the "..." (More Options) button and choose "Install from VSIX...".
Select the .vsix file generated in the previous step.
Visual Studio Code will install the extension and you can start using CodeForgeAI.
Configuring the API Key
Open the Visual Studio Code settings by going to File > Preferences > Settings (or by using the keyboard shortcut Ctrl+,).
Search for "CodeForgeAI" to find the extension-specific settings.
Enter your OpenAI API key in the "CodeForgeAI: Api Key" setting. This will allow the extension to connect to the OpenAI service for code generation.
Save the settings file.
Getting Started
Install the CodeForgeAI extension from the Visual Studio Code Marketplace.
Configure your OpenAI API key in Visual Studio Code's settings to enable seamless code generation.
Open a code file in Visual Studio Code.
Add comments in the code file to specify the desired code snippets you want to generate. Select the comments containing the code description that you want to generate. You can select either single-line or multi-line comments.
To trigger the code generation, you have two options:
Option 1: Use the keyboard shortcut Ctrl+Shift+P to open the command palette, then type "CodeForgeAI" and press Enter.
Option 2: Right-click in the code editor, select "CodeForgeAI" from the context menu.
CodeForgeAI will process the comments using AI-powered models and generate the corresponding code snippets.
The generated code will be inserted at the appropriate locations in your code file, saving you time and effort.
Example
To generate a simple JavaScript function that calculates the sum of two numbers, add a comment like this:
// Generate a function to calculate the sum of two numbers
Trigger the code generation using one of the methods mentioned above, and CodeForgeAI will generate the following code snippet:
Use ctrl+shift+p and search CodeForgeAI and enter. Make sure you have selected the commented text before triggering the CodeForgeCommand and CodeForgeAI will generate the following code snippet:
function calculateSum(num1, num2) {
return num1 + num2;
}
Feedback and Contributions
We welcome your feedback and contributions to make CodeForgeAI even better. If you encounter any issues or have suggestions for new features, please submit them in the project's issue tracker on GitHub.
Let's elevate your coding experience with the power of AI and unleash your productivity with CodeForgeAI!
Feel free to customize and expand upon this usage description based on your specific features, guidelines, and project details.
License
GPL-3.0