Skip to content

Instantly share code, notes, and snippets.

@eonist
Created December 16, 2025 12:30
Show Gist options
  • Select an option

  • Save eonist/adfc2c102bbcf68d4e420764bb6732ec to your computer and use it in GitHub Desktop.

Select an option

Save eonist/adfc2c102bbcf68d4e420764bb6732ec to your computer and use it in GitHub Desktop.
git summary with apple intelligence hack

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.

How to set it up (No new downloads)

You can build a simple "bridge" that takes your git diff, sends it to Apple Intelligence, and pipes the result back to your commit.

1. Create the Shortcut

  1. Open the Shortcuts app on macOS.
  2. Click + to create a new shortcut.
  3. Name it SummarizeCommit.
  4. 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.
  5. 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").
  6. 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.

2. Run it from your Terminal

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 -

Why this is the best approach for you

  • 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.

Limitation

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

@eonist
Copy link
Author

eonist commented Dec 16, 2025

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 CLI: Apple officially supports running shortcuts from the command line using the shortcuts run command, which can accept piped input[1]
  • Apple Intelligence in Shortcuts: macOS supports intelligent actions in shortcuts that can summarize text, and the new "Use Model" action allows using on-device Apple Intelligence or Private Cloud Compute for custom prompts[2]
  • AI-powered git commit messages: Several other approaches exist using external AI services (Claude, OpenAI, JetBrains AI) to generate commit messages from git diffs, but these use cloud APIs rather than local Apple Intelligence[3][4]

Why This Hack Is Unique

The Gist's approach is distinctive because it:

  • Uses on-device Apple Intelligence rather than cloud-based AI APIs
  • Requires no API keys or third-party services
  • Leverages the native shortcuts run CLI tool to pipe terminal output directly to Apple's summarization features

The 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

@eonist
Copy link
Author

eonist commented Dec 16, 2025

Web Mentions of the Apple Intelligence Git Diff Summary Hack

Based on my research, there are several related mentions and similar implementations of using Apple Intelligence to generate git commit messages, though I did not find direct references to the specific gist you linked. Here's what exists in the broader ecosystem:

Similar Tools and Implementations

cmtly by tofa84[1][2][3]
A CLI tool that uses Apple Foundation Models to generate git commit messages from staged diffs. This is very similar to the approach in your gist, but uses Foundation Models framework directly rather than the Shortcuts app. It was recently posted on Hacker News.

swift-commit-gen[4][5]
A Swift-based command-line tool that inspects Git repositories, summarizes staged and unstaged changes, and generates commit messages using AI.

YouTube Tutorial[6]
There's a Japanese video demonstration titled "Generate git commit msg by Apple Intelligence in shortcuts.app with macOS Tahoe (26) Demo" from September 2025. This appears to demonstrate the exact technique described in your gist.

Apple Intelligence in Shortcuts - General Coverage

Official Apple Support Documentation[7][8][9]
Apple's official guides extensively cover the new Apple Intelligence actions in Shortcuts, including:

  • The "Summarize" action
  • The "Use Model" action for custom prompts
  • Integration with both on-device and Private Cloud Compute models

Tech Media Coverage[10][11][12]
Multiple tech publications have covered Apple Intelligence integration in Shortcuts:

  • Bloomberg reported on Shortcuts getting Apple Intelligence integration
  • WIRED and MacDailyNews highlighted the new AI-powered actions for summarizing text and running custom prompts
  • Matthew Cassinelli documented various Apple Intelligence shortcuts for real-world applications

Similar AI Commit Message Tools

While not using Apple Intelligence specifically, there are many similar approaches:

  • AutoCommit and other AI-powered tools that use LLMs to analyze git diffs[13]
  • AICommit on Reddit - handles large diffs with Gemini/OpenAI[14]
  • Multiple GitHub repositories for AI-generated commit messages[15][16][17][18]

Key Observations

No Direct Mentions Found: I could not find specific discussions or references to the exact gist URL (adfc2c102bbcf68d4e420764bb6732ec) on mainstream tech sites, Reddit, Hacker News, or Twitter/X.

Growing Ecosystem: The technique of using Apple Intelligence for git workflows is emerging, with Foundation Models framework being the primary programmatic approach, while your gist demonstrates a creative workaround using Shortcuts app.[19][20]

Similar Mindshare: The concept of AI-generated commit messages is well-established, but the specific approach of piping git diff through Apple Intelligence via Shortcuts appears to be relatively novel or not yet widely documented online.

The hack appears to be an innovative application of Apple Intelligence's summarization capabilities that hasn't gained widespread attention yet, though the underlying concept (AI + git diffs) is actively being explored through various other implementations.

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment