{"slug": "localcommit-offline-conventional-git-commits-with-local-llms", "title": "LocalCommit: Offline Conventional Git Commits with Local LLMs", "summary": "A developer built LocalCommit, an open-source TypeScript CLI that reads staged Git diffs and generates Conventional Commit messages using locally hosted open-weights models via Ollama, keeping source code entirely off cloud APIs. The tool targets engineers bound by client NDAs who need Conventional Commits for automated changelogs but cannot send diffs to proprietary LLM services, and it works offline with no API keys required.", "body_md": "*This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend ([https://dev.to/challenges/hacktoberfest-weekend-2026-10-01](https://dev.to/challenges/hacktoberfest-weekend-2026-10-01))*\n\nI built LocalCommit, a lightweight CLI tool that inspects your staged git diffs and drafts concise Conventional Commit messages (feat(auth): add refresh token rotation) running entirely on your local machine using Ollama.\n\nI built this for my friend Manish, a software engineer working under strict client non-disclosure agreements. Manish's team requires strict Conventional Commits for automated changelogs and semantic releases, but company policy strictly forbids piping source code or git diffs to proprietary cloud LLM APIs (like OpenAI or Anthropic). Whenever Manish makes multi-file changes across large codebases, writing detailed conventional commit messages by hand slows down their workflow.\n\nLocalCommit solves this by reading git diff --staged and running inference on an open-weights model locally. Zero tokens leave the machine, no API keys are required, and the tool works even when working offline on a train or during an internet outage.\n\nHere is how running LocalCommit looks in terminal:\n\n``` bash\n$ git add src/auth/token.ts src/middleware/jwt.ts\n$ npx localcommit\n[localcommit] Checking staged changes...\n[localcommit] Sending diff to qwen2.5-coder:3b...\n\nProposed commit message:\n  feat(auth): implement refresh token rotation and validation\n\nCommit with this message? [y/N/e (edit)/r (regenerate)]: y\n[main 7f2a1b9] feat(auth): implement refresh token rotation and validation\n 2 files changed, 48 insertions(+), 6 deletions(-)\nYou can confirm with [y] to commit immediately, hit [e] to edit in place, [r] to regenerate with a slightly different phrasing, or [n] to cancel without touching git state.\n```\n\nThe source code and setup instructions are open source on GitHub:\n\nLocal-first CLI for generating conventional commit messages with Ollama.\n\nLocalCommit reads your staged Git diff, generates a Conventional Commit message with the configured local model, and asks for confirmation before committing.\n\n`model` file (default: `qwen2.5-coder:3b`)\nIf Ollama is not installed, follow the platform-specific instructions in\n[INSTRUCTION.md](https://github.com/Gaurav5189/LocalCommit/INSTRUCTION.md).\n\n```\nnpm run setup\n```\n\nThe setup command verifies Node.js and Git, checks that Ollama is running,\ndownloads `qwen2.5-coder:3b` if it is missing, installs dependencies, and\nbuilds the project.\n\nIf setup reports that Ollama is unavailable, install it and start the Ollama\nservice by following [INSTRUCTION.md](https://github.com/Gaurav5189/LocalCommit/INSTRUCTION.md).\n\nStart Ollama in a separate terminal if it is not already running:\n\n```\nollama serve\n```\n\nStage your changes in a Git repository, then run:\n\n```\nnpx localcommit\n```\n\nInside a checkout of this project, `npx localcommit` resolves the local package\nbinary. To use it from…\n\nLocalCommit is written in TypeScript and connects to Ollama ([https://ollama.com/](https://ollama.com/)) running locally:\n\n`/api/show` endpoints at runtime to discover the exact context window allocated by your environment.\nOpen-weights models and local runtimes like Ollama make use cases possible that cloud AI endpoints fundamentally cannot support:\n\nThe development session where I debugged the container connectivity issues and fixed the Ollama host resolution:\n\nThis project is open source and available under the MIT License.", "url": "https://wpnews.pro/news/localcommit-offline-conventional-git-commits-with-local-llms", "canonical_source": "https://dev.to/gaurav0s/localcommit-offline-conventional-git-commits-with-local-llms-opk", "published_at": "2026-10-04 21:20:48+00:00", "updated_at": "2026-10-04 21:42:22.838641+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models", "ai-products"], "entities": ["LocalCommit", "Ollama", "Git", "qwen2.5-coder:3b", "TypeScript", "Manish", "GitHub", "MIT License"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/localcommit-offline-conventional-git-commits-with-local-llms", "markdown": "https://wpnews.pro/news/localcommit-offline-conventional-git-commits-with-local-llms.md", "text": "https://wpnews.pro/news/localcommit-offline-conventional-git-commits-with-local-llms.txt", "jsonld": "https://wpnews.pro/news/localcommit-offline-conventional-git-commits-with-local-llms.jsonld"}}