Commit Helper uses Groq's lightning-fast models to craft clean, conventional commit messages from your staged git changes. It mirrors the commit type cheat sheet so you can stay consistent without leaving the editor.
Features
Reads git status --short and the staged diff to understand your change.
Optional context prompt lets you tell the LLM why you made the change.
Calls Groq's Chat Completions API (default model llama-3.3-70b-versatile) to produce a ready-to-use commit message.
Copies the result to your clipboard and opens an untitled git-commit buffer for quick review.
Stores your Groq API key securely using VS Code's secret storage, with an option to persist in .vscode/commit-helper.json for the workspace.
Getting Started
Install dependencies and build the extension:
npm install
npm run compile
Launch the extension in VS Code:
Press F5 inside this repository to start the Extension Development Host.
Set your Groq API key (once per machine/workspace):
Run the Commit Helper: Set Groq API Key command and paste a gsk_… key.
Accept the prompt to store it in .vscode/commit-helper.json if you want the whole workspace to reuse the key (note: stored in plaintext).
Stage your git changes, then run Commit Helper: Generate Commit Message.
(Optional) Update settings in VS Code:
commitHelper.model
commitHelper.temperature
commitHelper.maxCompletionTokens
Running Tests
The helper logic is covered with Mocha/Chai unit tests:
npm test
This command compiles TypeScript and runs the suite from out/test.
Configuration
Setting
Description
Default
commitHelper.model
Groq model id used for completions.
llama-3.3-70b-versatile
commitHelper.temperature
Sampling temperature for the LLM.
0.2
commitHelper.maxCompletionTokens
Max completion tokens requested.
300
commitHelper.persistKeyInWorkspace
Automatically write the API key to .vscode/commit-helper.json (plaintext).
false
Use Commit Helper: Clear Groq API Key if you need to rotate credentials. It removes the key from both secret storage and the workspace file (if present).
LLM Prompt Design
The extension sends the staged status, cached diff (trimmed to 12k characters), and any optional context you provide. The system prompt encodes the conventional commit rules from the included COMMIT_GUIDE.md, ensuring the LLM produces headers like feat(ui): add dark mode toggle with optional body/footers as needed.
Troubleshooting
“Groq API key is required” – Run Commit Helper: Set Groq API Key.
No staged changes – Stage files using git add before running the command.
Git errors – Ensure the workspace folder is a git repository with a valid git executable on your PATH.