AI News HubLIVE
In-site rewrite2 min read

Show HN: GitPT – AI commit messages with Apple's on-device Foundation Models

GitPT is a git command alias that uses on-device LLMs to write commit messages. It summarizes diffs file by file to fit small context windows, supporting Apple Foundation Models, Ollama, LM Studio, and remote APIs.

SourceHacker News AIAuthor: bartaxyz

Notifications You must be signed in to change notification settings

Fork 0

Star 11

BranchesTags

Open more actions menu

Folders and files

NameName

Last commit message

Last commit date

Latest commit

History

51 Commits

51 Commits

.github/workflows

.github/workflows

assets

assets

scripts

scripts

src

src

tests

tests

.gitignore

.gitignore

.npmignore

.npmignore

.releaserc.json

.releaserc.json

CODE_OF_CONDUCT.md

CODE_OF_CONDUCT.md

CONTRIBUTING.md

CONTRIBUTING.md

LICENSE

LICENSE

README.md

README.md

commitlint.config.js

commitlint.config.js

package-lock.json

package-lock.json

package.json

package.json

tsconfig.json

tsconfig.json

Repository files navigation

GitPT (Git Prompt Tool) is a git command alias that writes your commit messages with an LLM, built for on-device models. Use it anywhere you use git: every command it doesn't change passes straight through, so you can replace git with it and lose nothing. The one command that changes is commit, which writes the message for you.

Big remote models already write commits fine. The harder case is the small local model on your machine (Apple's Foundation Models, Ollama, LM Studio), which holds only a few thousand tokens. A real diff is much larger, so GitPT summarizes it file by file until it fits the model's context window, then writes the message from that summary. Remote APIs (OpenAI, Anthropic, OpenRouter) work too.

The diff is summarized to fit the model's context window before the message is written.

New: Apple Foundation Models. On macOS 27 and later, GitPT runs on Apple's built-in on-device model. No API key, no signup, nothing leaves your Mac. Run gitpt setup and choose Apple Foundation Models.

Install

npm install -g gitpt

Setup

gitpt setup # pick a model

Optional: alias git so GitPT runs everywhere you already type git.

alias git=gitpt

Use

With plain git, you write the message yourself:

git add . git commit -m "fix: handle empty staged diff" # you write the message

With GitPT, you don't:

gitpt add . gitpt commit # GitPT writes it from the diff

gitpt commit reads your staged diff, writes the message, and opens it in your editor. Save and close to commit.

Commands

gitpt commit: write a commit message from staged changes. Respects -m and your commitlint rules.

gitpt model: pick or switch the model. Each provider keeps its own key.

gitpt setup / gitpt config / gitpt reset: configure, show, or clear settings.

gitpt pr create: draft a pull request title and description with the gh CLI (experimental).

Models

On-device: Apple's Foundation Models on macOS 27 or later (no API key), or any OpenAI-compatible local server such as Ollama or LM Studio.

Remote: OpenAI, Anthropic, OpenRouter. Bring an API key.

Requests and bugs

Want a feature or hit a bug? Open an issue.

License

MIT

About

Git Prompt Tool - AI commit messages, built for on-device models (incl. Apple Foundation Models)

Resources

Readme

License

MIT license

Contributing

Contributing

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

11 stars

Watchers

1 watching

Forks

0 forks

Report repository

Releases 8

v1.6.1

Latest

Jun 18, 2026

+ 7 releases

Packages 0

Uh oh!

There was an error while loading. Please reload this page.

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

TypeScript 76.0%

JavaScript 24.0%