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 model to use, so the whole thing stays featherweight and costs you only fractions of a cent per fix.
- macOS
- Hammerspoon (free) — the runtime that hosts the script
- An Anthropic API key (pay-as-you-go)
- 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 your API key (kept outside this repo so it can never be committed):
Or launch it first and use the menu-bar Edit API key… item.
echo "sk-ant-your-key-here" > ~/.hammerspoon/fettle-key.txt chmod 600 ~/.hammerspoon/fettle-key.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 model — Haiku (fast & cheap), Sonnet (balanced), or Opus (best). Your choice is remembered.
- Edit API key… — opens the key file.
- Reload config.
Everything tweakable lives at the top of init.lua:
HOTKEY_MODS/HOTKEY_KEY— change the shortcut.MODELS— add or remove models from the picker.SYSTEM_PROMPT— currently set to British English; change if you'd prefer US spelling or different behaviour.
Each correction sends the text of the focused field to Anthropic's API over HTTPS. Don't use it on anything you wouldn't send to a cloud service. Cost is pay-as-you-go on your own key — pennies a day for typical personal use.
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.