Skip to content

ntcgrgr/ollama-commit-msg

Repository files navigation

Ollama AI Commit

VS Code Extension to generate conventional commit messages using a local Ollama model.

Features

  • Generates commit messages from git diff
  • Uses local model (gpt-oss:20b)
  • Allows editing before commit
  • One-click button in Source Control panel

Requirements

  • Ollama running locally
  • Model installed: gpt-oss:20b
  • Node.js + npm

Install model:

ollama pull gpt-oss:20b

Development (Build & Run)

Install dependencies:

npm install

Compile TypeScript:

npm run compile

Run extension in development mode:

Press F5 in VS Code.

This opens a new Extension Development Host window.


Build VSIX (for installation)

Install VS Code packaging tool:

npm install -g @vscode/vsce

Create VSIX package:

vsce package

This generates a .vsix file.


Install Extension

Option 1 (VS Code UI)

  • Open Extensions
  • Click ...
  • Select Install from VSIX
  • Choose the .vsix file

Option 2 (CLI)

First enable the code command:

  • Open VS Code
  • Press Cmd + Shift + P
  • Run: Shell Command: Install ‘code’ command in PATH
code --install-extension ollama-commit-msg-0.0.1.vsix

Usage

  1. Make changes in your project

  2. Trigger the command:

    • Click AI Commit in the Source Control panel
    • OR open the Command Palette (Cmd + Shift + P) and search for AI Commit
  3. Review or edit the generated message

  4. Press Enter to commit


Notes

  • Works fully locally (no external APIs)
  • Uses git diff as input
  • Large diffs are automatically truncated

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors