Yes, you can. You can use Apple Intelligence’s local on-device models to generate commit messages without downloading anything new.
The "secret" backdoor to accessing these models from the terminal is the Shortcuts app, which has a command-line interface (shortcuts) and exposes Apple Intelligence actions.
You can build a simple "bridge" that takes your git diff, sends it to Apple Intelligence, and pipes the result back to your commit.
- Open the Shortcuts app on macOS.
- Click + to create a new shortcut.
- Name it
SummarizeCommit. - Search for the "Summarize" action (part of Apple Intelligence / Writing Tools) and drag it in.
- Note: If you see a generic "Summarize Text" action, use that.
- Configure the action:
- Set it to Summarize [Shortcut Input].
- (Optional) Click "Show More" on the action to see if you can tweak the style (e.g., "Concise").
- Crucial Step: In the shortcut settings (sidebar "i" icon), check "Use as Quick Action" or ensure "Services Menu" is enabled (this often helps with input handling), but the CLI tool usually works regardless.
(Advanced): If you have macOS Sequoia 15.2+, look for a "Describe" or "Use Model" action which might let you pass a custom prompt like "Write a git commit message for this diff." If not, the standard "Summarize" will give you a paragraph summary, which is a good starting point.
You can now pipe your git diff directly into this shortcut.
# Preview the message
git diff --cached | shortcuts run "SummarizeCommit"
# Automatically create the commit
git diff --cached | shortcuts run "SummarizeCommit" | git commit -F -- Zero Downloads: Uses the models already baked into macOS Sequoia.
- Zero Cost: No API keys.
- Privacy: Apple Intelligence runs locally on-device (for summarization).
- Hardware Optimized: It uses the Neural Engine (NPU), so it won't spike your CPU or drain battery like running a raw Llama model in Python would.
The standard "Summarize" tool is trained to write... summaries. It might output: "This update modifies the login function to handle null values."
It might not follow strict conventional commit formats (like fix: handle null values in login).
If you need strict formatting (e.g., "feat:", "fix:"), the Qwen2.5-Coder-0.5B model (from my previous answer) is superior because you can give it a custom instruction ("You are a git commit generator..."). Apple's "Summarize" tool doesn't always accept custom system instructions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Based on the search results, there are no direct mentions of this specific hack (using Apple Intelligence Shortcuts from the command line to summarize git diffs) on the web beyond the Gist you referenced. This appears to be a novel approach that combines several existing Apple features in a creative way.
Related Concepts Found
The technique described in the Gist leverages documented Apple features that exist separately:
shortcuts runcommand, which can accept piped input[1]Why This Hack Is Unique
The Gist's approach is distinctive because it:
shortcuts runCLI tool to pipe terminal output directly to Apple's summarization featuresThe closest related content found was a YouTube video about using Apple Shortcuts with Apple Intelligence for various automations, but none specifically mentioned git workflow integration. This suggests the Gist may be documenting an original technique not yet widely shared in developer communities.[5][6]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41