<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marta Wiśniewska</title>
    <description>The latest articles on DEV Community by Marta Wiśniewska (@marta_winiewska_861b124b).</description>
    <link>https://dev.to/marta_winiewska_861b124b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3571251%2F9c228bae-b8ff-4d04-896e-d1b1b4a64e20.jpg</url>
      <title>DEV Community: Marta Wiśniewska</title>
      <link>https://dev.to/marta_winiewska_861b124b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marta_winiewska_861b124b"/>
    <language>en</language>
    <item>
      <title>Gemma 3 + macOS Shortcuts: AI at the Press of a Hotkey</title>
      <dc:creator>Marta Wiśniewska</dc:creator>
      <pubDate>Fri, 17 Oct 2025 15:26:04 +0000</pubDate>
      <link>https://dev.to/marta_winiewska_861b124b/gemma-3-macos-shortcuts-ai-at-the-press-of-a-hotkey-4hij</link>
      <guid>https://dev.to/marta_winiewska_861b124b/gemma-3-macos-shortcuts-ai-at-the-press-of-a-hotkey-4hij</guid>
      <description>&lt;p&gt;I’ve always loved small, fast workflows that make the computer feel like an extension of thought.&lt;br&gt;&lt;br&gt;
A few weeks ago, while juggling docs, terminals, and editors, I realized: &lt;em&gt;why not bring AI directly to the clipboard?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Gemma 3&lt;/strong&gt; running locally through &lt;strong&gt;Ollama&lt;/strong&gt;, and a &lt;strong&gt;macOS Shortcut&lt;/strong&gt; bound to a hotkey, we can get instant grammar fixes, translations, and command synthesis in seconds — entirely offline.&lt;/p&gt;

&lt;p&gt;No web UI, no IDE plugins, just:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;copy → press → paste → done&lt;/strong&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Build This Instead of Using Built-In Grammar Tools?
&lt;/h2&gt;

&lt;p&gt;Most apps already try to help you write “better”: Google Docs, Slack, Notion, even IDEs highlight typos.&lt;br&gt;&lt;br&gt;
But none of them feel as &lt;strong&gt;consistent&lt;/strong&gt; or &lt;strong&gt;fast&lt;/strong&gt; as a hotkey you can call anywhere - terminal, browser, or email.&lt;/p&gt;

&lt;p&gt;Here’s what this Shortcut + Gemma 3 combo gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency across apps&lt;/strong&gt; - One shortcut works everywhere, no context switching.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom behavior&lt;/strong&gt; - A one-line prompt defines your tone, brevity, formatting, or dialect.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy &amp;amp; offline use&lt;/strong&gt; - Everything runs locally via Ollama. Nothing leaves your machine.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Beyond grammar&lt;/strong&gt; - The same setup can do translation, summarization, regex generation, or log cleanup.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Why Gemma 3 for Hotkeys?
&lt;/h2&gt;

&lt;p&gt;Hotkey workflows live or die by latency.&lt;br&gt;&lt;br&gt;
Gemma 3 offers parameter sizes like &lt;strong&gt;270M&lt;/strong&gt;, &lt;strong&gt;1B&lt;/strong&gt;, and &lt;strong&gt;4B&lt;/strong&gt; - small enough to run smoothly on &lt;strong&gt;Apple Silicon&lt;/strong&gt; and most modern CPUs.&lt;/p&gt;

&lt;p&gt;On my M2 Pro, the &lt;code&gt;4B&lt;/code&gt; model responds in under a second for short text.&lt;br&gt;&lt;br&gt;
That’s fast enough to keep flow intact, even mid-sentence.&lt;/p&gt;

&lt;p&gt;Smaller quantized versions (4-bit) reduce memory footprint further, which helps when you’ve got your editor, browser, Docker, and Slack all open - because, let’s be honest, that’s how we all work.&lt;/p&gt;


&lt;h2&gt;
  
  
  Privacy and Offline Capability
&lt;/h2&gt;

&lt;p&gt;Once Gemma 3’s weights are downloaded, everything happens locally.&lt;br&gt;&lt;br&gt;
No data leaves your machine - perfect for working with code, logs, or internal docs.&lt;/p&gt;

&lt;p&gt;You can even work offline on a plane or behind a firewall. The Shortcut still fires instantly.&lt;/p&gt;


&lt;h2&gt;
  
  
  Developer Integration and Simplicity
&lt;/h2&gt;

&lt;p&gt;Gemma 3’s instruction-tuned variants respond to natural, concise prompts like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Fix grammar”&lt;br&gt;&lt;br&gt;
“Translate to French”&lt;br&gt;&lt;br&gt;
“Summarize this paragraph”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That aligns perfectly with small, predictable tasks you want on a hotkey.  &lt;/p&gt;

&lt;p&gt;Ollama exposes both a &lt;strong&gt;CLI&lt;/strong&gt; and a &lt;strong&gt;local API&lt;/strong&gt; (compatible with OpenAI’s Chat Completions format).&lt;br&gt;&lt;br&gt;
That means you can integrate through simple shell pipes like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pbpaste | ollama run gemma3:4b | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you can call a local HTTP endpoint from a Shortcut.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setup: macOS + Ollama + Gemma 3
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install Ollama
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install ollama
ollama --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Pull the Model
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama pull gemma3:4b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other sizes you can try:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variant&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;gemma3:270m&lt;/td&gt;
&lt;td&gt;Ultra-light, very fast&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gemma3:1b&lt;/td&gt;
&lt;td&gt;Balance of size and speed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gemma3:4b&lt;/td&gt;
&lt;td&gt;Great for grammar &amp;amp; translation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gemma3:12b+&lt;/td&gt;
&lt;td&gt;Highest quality, slower&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Then verify the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "hello" | ollama run gemma3:4b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see a reply - you’re good to go.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prompt Files
&lt;/h2&gt;

&lt;p&gt;I keep my prompts in plain .txt files under ~/prompts.&lt;br&gt;
That makes versioning and editing easy.&lt;/p&gt;

&lt;p&gt;Here’s an example for grammar correction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are an expert copy editor. Given the text, return the same text with grammar, spelling, and punctuation corrected only.

Rules:

* Do not rephrase, shorten, or change meaning or tone.
* Preserve Markdown, emojis, URLs, and code blocks.
* Keep the author's dialect if evident; otherwise default to American English.
* Apply the minimal change necessary.
* Output only the corrected text - no explanations or code fences.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Clipboard → Model → Clipboard
&lt;/h2&gt;

&lt;p&gt;This small shell script connects everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/zsh
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

TEXT="$(pbpaste)"
PROMPT_FILE="$HOME/prompts/grammar_correction_prompt.txt"
PROMPT=$(&amp;lt;"$PROMPT_FILE")

OUTPUT="$(
printf '%s\n\n%s\n' "$PROMPT" "$TEXT" 
| ollama run gemma3:4b
)"

printf "%s\n" "$OUTPUT" | pbcopy
echo "✅ Done! Paste corrected text and enjoy."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can already run it manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pbpaste | ./grammar_correct.sh | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Building the Shortcut
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Shortcuts&lt;/strong&gt; on macOS.&lt;/li&gt;
&lt;li&gt;Create a new Shortcut → &lt;em&gt;Run Shell Script&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Set the shell to /bin/zsh.&lt;/li&gt;
&lt;li&gt;Paste the script above.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Details&lt;/strong&gt;, enable &lt;em&gt;Use as Quick Action&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Assign a keyboard shortcut — mine is ⌃⌘G.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now the loop is complete:&lt;br&gt;
&lt;strong&gt;Copy → Press Hotkey → Paste → Done.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Testing It
&lt;/h2&gt;

&lt;p&gt;Copy any text - maybe an email draft or a snippet of documentation.&lt;br&gt;
Press your shortcut, then paste.&lt;br&gt;
You’ll see corrected text instantly, without ever leaving your current app.&lt;/p&gt;

&lt;p&gt;I’ve been using this daily - for proofreading commits, cleaning up release notes, or rewording code comments.&lt;br&gt;
It’s one of those automations that quietly changes how you work.&lt;/p&gt;




&lt;h2&gt;
  
  
  When to Use (and When Not To)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Great for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clipboard-sized text: short paragraphs, commit messages, doc comments.&lt;/li&gt;
&lt;li&gt;Low-latency tasks - speed matters more than reasoning.&lt;/li&gt;
&lt;li&gt;Privacy-sensitive material - logs, code, internal text.&lt;/li&gt;
&lt;li&gt;Offline or restricted environments.&lt;/li&gt;
&lt;li&gt;Repeatable micro-automations you want to trigger anywhere.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Not ideal for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-file code refactors or big design reasoning.&lt;/li&gt;
&lt;li&gt;Anything that needs long context memory.&lt;/li&gt;
&lt;li&gt;Interactive IDE features like autocomplete or refactoring hints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it as a &lt;em&gt;command-line Copilot&lt;/em&gt; - but local, minimal, predictable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;There’s something deeply satisfying about an AI workflow that feels &lt;em&gt;native&lt;/em&gt; - not glued on.&lt;br&gt;
Gemma 3 + macOS Shortcuts achieves exactly that: no login, no latency, no cloud.&lt;/p&gt;

&lt;p&gt;If you love building small tools that make your daily flow smoother, this one’s worth 15 minutes of setup.&lt;br&gt;
It quickly becomes muscle memory - copy, hotkey, paste, done.&lt;/p&gt;

&lt;p&gt;For more detailed instruction visit &lt;a href="https://medium.com/@marta.wisniewska19.10/gemma-3-macos-shortcuts-ai-at-the-press-of-a-hotkey-11199aecfb41" rel="noopener noreferrer"&gt;Full post&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
