fettle (v., British) — to put something in good order; to fix, tidy, or repair.
A tiny macOS utility that brings back the feature Grammarly quietly dropped: select nothing, just hit one hotkey and the text in the field you're typing in gets its typos, grammar, and tense fixed in place.
Press ⌥ Space (Option+Space) in any text field — a message, a document, an email — and fettle grabs what's there, cleans it up with an LLM, and pastes the corrected version straight back. No window to paste into, no leaving the app you're in.
It's deliberately small: no bundled AI model, no backend, no account. You bring your own API key and pick which provider/model to use, so the whole thing stays featherweight and costs you only fractions of a cent per fix — or nothing, on Groq's free tier.
- macOS
- Hammerspoon (free) — the runtime that hosts the script
- An API key from at least one supported provider:
git clone https://github.com/anothersmith/fettle.git
cd fettle
./install.shThe script installs Hammerspoon (via Homebrew) if it's missing, links the
init.lua, saves your API key(s), opens the Accessibility settings pane, and
starts Hammerspoon. The only step it can't do for you is flick the
Accessibility toggle on — macOS won't let software grant itself that.
- Install Hammerspoon:
brew install --cask hammerspoon
- Install the script. If you don't already use Hammerspoon, symlink this
repo's
init.luainto place:Already have aln -sf "$(pwd)/init.lua" ~/.hammerspoon/init.lua
~/.hammerspoon/init.lua? Don't overwrite it — instead adddofile("/path/to/fettle/init.lua")to your existing config. - Add at least one API key (kept outside this repo so it can never be
committed):
Or launch it first and use the menu-bar Edit … key… items.
# Anthropic (optional) echo "sk-ant-your-key-here" > ~/.hammerspoon/fettle-key.txt # Groq (optional) echo "gsk_your-key-here" > ~/.hammerspoon/fettle-groq-key.txt chmod 600 ~/.hammerspoon/fettle-*.txt
- Grant Accessibility permission. Launch Hammerspoon, then System Settings → Privacy & Security → Accessibility → enable Hammerspoon. (It needs this to read and replace text in other apps.)
- Click the Hammerspoon menu-bar icon → Reload Config. You should see a "fettle loaded" flash.
Type in any text field, then hit ⌥ Space. That's it.
⚠️ Don't use it in a terminal. Like any paste-based tool, fettle replaces the field by pasting — and at a shell prompt, pasted text containing a newline can execute. It's built for messages, documents, and email fields, not command lines.
The ✍️ menu-bar icon lets you:
- Pick a provider + model — Anthropic (Haiku / Sonnet / Opus) or Groq (GPT-OSS 20B / 120B). Your choice is remembered.
- Choose your spelling — match your own writing (auto), or force British or American. Remembered like the model choice.
- Edit … key… — opens the relevant provider's key file.
- Reload config.
- Groq · GPT-OSS 20B — fastest (~0.2s), free tier. Great default for quick messages.
- Groq · GPT-OSS 120B — a little more quality, still faster than Anthropic.
- Anthropic · Haiku / Sonnet / Opus — top quality; Haiku lands around ~0.7s.
Correction is an easy task, so the small fast models handle typos, tense, and British spelling well. Reach for Anthropic when you want the most careful touch.
Everything tweakable lives at the top of init.lua:
HOTKEY_MODS/HOTKEY_KEY— change the shortcut.PROVIDERS— add or remove providers/models, or update a model id if a provider retires one (e.g. amodel_decommissionederror).- Spelling (auto / British / American) is a menu-bar setting now — no code
edit needed. The correction wording itself lives in
systemPrompt()and theDIALECTStable at the top ofinit.luaif you want to tweak it.
Each correction sends the text of the focused field to whichever provider you have selected (Anthropic or Groq) over HTTPS. Don't use it on anything you wouldn't send to a cloud service — switching provider is one menu click. Cost is pay-as-you-go on your own key — pennies a day, or free within Groq's free tier.
Hotkey → Cmd+A, Cmd+C to grab the field → send text to the model →
paste the corrected result back → restore your previous clipboard. The
"clipboard trick" is what lets it work system-wide without per-app integration.
A working prototype. It does one thing well. Contributions and forks welcome.
