Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fettle

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.

Requirements

Install

  1. Install Hammerspoon:
    brew install --cask hammerspoon
  2. Install the script. If you don't already use Hammerspoon, symlink this repo's init.lua into place:
    ln -sf "$(pwd)/init.lua" ~/.hammerspoon/init.lua
    Already have a ~/.hammerspoon/init.lua? Don't overwrite it — instead add dofile("/path/to/fettle/init.lua") to your existing config.
  3. Add your API key (kept outside this repo so it can never be committed):
    echo "sk-ant-your-key-here" > ~/.hammerspoon/fettle-key.txt
    chmod 600 ~/.hammerspoon/fettle-key.txt
    Or launch it first and use the menu-bar Edit API key… item.
  4. Grant Accessibility permission. Launch Hammerspoon, then System Settings → Privacy & Security → Accessibility → enable Hammerspoon. (It needs this to read and replace text in other apps.)
  5. Click the Hammerspoon menu-bar icon → Reload Config. You should see a "fettle loaded" flash.

Usage

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.

Configuration

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.

Privacy & cost

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.

How it works

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.

Status

A working prototype. It does one thing well. Contributions and forks welcome.

About

Recreate Grammarlys dropped "tab to autocorrect": one hotkey fixes typos, grammar & tense in place, anywhere on macOS. A tiny Hammerspoon utility, bring-your-own LLM key.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages