A VS Code extension that analyzes your code and generates comprehensive test cases using Groq AI.
Features
Analyze code and generate test cases with a single click
Line-by-line code analysis with bug detection and fix suggestions
Automatic error detection with inline fix suggestions
File selection and analysis with detailed diagnostics
Integration with Groq API (LLaMA 3-70B model)
Support for multiple programming languages
React + TypeScript frontend
Secure API key handling
JSON-formatted test cases ready to implement
Keyboard shortcuts for quick access to all features
Installation
From VSIX
Download the latest .vsix file from the releases page
Open VS Code
Go to Extensions view (Ctrl+Shift+X)
Click on the "..." menu in the top-right corner
Select "Install from VSIX..." and choose the downloaded file
From Source
Clone this repository
Run npm install to install dependencies
Copy .env.example to .env and add your Groq API key
Run npm run watch to start the development server
Press F5 to launch the extension in a new VS Code window
API Key Setup (Required)
GenTestX requires a Groq API key to function. You can get one for free at https://console.groq.com/.
Setting Up Your API Key
When you first use the extension, it will automatically prompt you to enter your API key. Simply click "Yes" and enter your Groq API key when prompted.
Manually Setting Your API Key
You can also set your API key manually in VS Code settings:
Open VS Code settings (File > Preferences > Settings)
Search for "GenTestX"
Enter your Groq API key in the "Groq API Key" field
For Developers
If you're developing the extension locally:
Create a .env file in the root directory of the extension
Add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
Security Note
Your API key is stored securely in your VS Code settings and is never shared with anyone except Groq's API service. The extension does not include any hardcoded API keys.
Usage
Method 1: Using the Command
Open a file with code you want to analyze
Select the code you want to analyze (or don't select anything to analyze the entire file)
Open the command palette (Ctrl+Shift+P or Cmd+Shift+P)
Run the command "GenTestX: Analyze Code and Generate Tests"
View the analysis results in the panel that opens
Method 2: Using the Sidebar
Click on the GenTestX icon in the activity bar
Paste your code in the input box
Choose between Chat mode or GenTestx AI mode from the dropdown
Click "Generate Test Cases" or type your prompt and click "Send"
View the analysis results in the panel above
Method 3: Line-by-Line Analysis
Open a file with code you want to analyze
Place your cursor on the line you want to analyze
Press Ctrl+Shift+L (or Cmd+Shift+L on Mac)
View the analysis results in the notification
Click "Fix Issue" if a fix is suggested
Method 4: Full File Analysis
Open a file with code you want to analyze
Press Ctrl+Shift+F (or Cmd+Shift+F on Mac)
View the analysis results as diagnostics in the Problems panel
Hover over the underlined code to see the issue details
Click the lightbulb icon or press Ctrl+. to see and apply suggested fixes
Method 5: Select and Analyze File
Press Ctrl+Shift+O (or Cmd+Shift+O on Mac)
Select a file from the quick pick menu
The file will open and be automatically analyzed
View the analysis results as diagnostics in the Problems panel