Smart Git Commit Generator
Generate English Conventional Commit suggestions from staged Git changes in VS Code Desktop. Generate locally with Git and rules, or send staged text diffs to an OpenAI-compatible model you select.
Install
Requires VS Code Desktop 1.90 or later, Git, and the built-in Git extension.
- Marketplace — In the VS Code Extensions view, search for
IrfanYasin.smart-git-commit once the listing is available.
- VSIX — Run Extensions: Install from VSIX… from the Command Palette and select the packaged
.vsix file.
Usage
- Open a Git repository in a trusted VS Code workspace. Save your edits, then select + next to the files you want to stage in Source Control. The sidebar shows the unstaged file count for the selected repository.
- Open Smart Git Commit from the Activity Bar and select the repository.
- Select Generate Locally or configure an AI model. Choose a suggestion and edit its type, scope, and one-line subject as needed.
- Select Copy Message or Apply to Source Control. Apply fills the chosen repository’s commit input and asks before replacing an existing message. Commit manually in Source Control.
Binary files and private file contents are excluded from code analysis. Renames are detected using Git similarity rules. Heavily edited moves may appear as a deletion and an addition. If the patch exceeds the analysis budget, suggestions can rely on file metadata. Review recommendations to confirm they describe your intent.
Generate with AI
Get an API key
The API key comes from the account or administrator of the OpenAI-compatible server. Model access depends on the permissions of that key.
- Open the provider dashboard at ai.reynaldsilva.my.id. If your administrator directs you to the LAN instance, open 10.0.76.87:9101 from the appropriate network or VPN.
- Sign in using the account provided or authorized by the server administrator. Find the section for API keys, access tokens, or credentials. The exact menu labels vary by server configuration.
- If your account can create keys, create one for Smart Git Commit. If the dashboard offers model permissions, grant access to the models you plan to use. If the menu is unavailable or you cannot create a key, request a key with model access from the administrator.
- Copy the key into the VS Code prompt in the next section. VS Code stores it in SecretStorage. Keep the key out of repository files, settings files, screenshots, and commit messages.
Connect VS Code and choose a model
- Open the Smart Git Commit sidebar and select Select AI Model, or run Smart Git Commit: Select AI Model from the Command Palette.
- Select the endpoint that corresponds to your key. Use HTTPS for an encrypted connection. The LAN option sends the key and staged diff over unencrypted HTTP and requires confirmation.
- Enter your API key and select a model from the list returned by the server. To switch models or replace a key, run Select AI Model again.
- Stage your changes, then select Generate with AI. Review the suggested subject before applying it. Generate Locally remains available for offline use.
The extension uses GET /v1/models to list models and POST /v1/chat/completions to generate suggestions. Generate with AI sends eligible staged text patches to the selected server, up to 48 KB of collected patch data per request. Binary files and recognized sensitive files are excluded. Review staged source files for confidential content before using remote generation.
Troubleshooting
| Symptom |
What to check |
| HTTP 401 or 403 |
Confirm the key belongs to the selected endpoint and has model access. Reopen Select AI Model to replace it. |
| The model list is empty or a model is missing |
Ask the server administrator which models are available to your account and whether they support chat completions. |
| HTTP 404 |
Check with the administrator that the server exposes the OpenAI-compatible /v1/models and /v1/chat/completions routes. |
| The server cannot be reached |
Try the HTTPS endpoint or check that the LAN endpoint is reachable from your network or VPN. |
| The generate buttons are disabled |
Stage at least one file in the selected repository. For AI generation, also select a model. |
Development
Use Node.js 24 and npm. Run npm ci, npm test, and npm run compile. Press F5 to launch the Extension Development Host. Run npm run test:vscode in a graphical session. Set VSCODE_EXECUTABLE_PATH to use a local VS Code executable. Without that variable, the test runner downloads VS Code.
Package with npm run package, then install with code --install-extension smart-git-commit-0.2.1.vsix. The manifest uses the Marketplace publisher ID IrfanYasin.
Find the settings under Smart Git Commit in VS Code Settings. Default analysis uses staged changes, suggests five messages, includes inferred scopes, and checks subjects against a 100-character limit. Auto-refresh is enabled and automatic generation on staging is opt-in.