This repository contains two Alfred workflows for spell-checking and correcting text using AI models from Anthropic (Claude) and OpenAI. Follow the steps below to set up and configure the workflows.
- Python 3
- Aflred
- Alfred Powerpack
- Large Language Model:
- OpenAI API Key
- Create new api key here
- Anthropic API Key
- OpenAI API Key
- Install the command line tools by running this in the terminal:
xcode-select --install
- Than install the request library with pip via:
/usr/bin/python3 -m pip install --user requests
-
Open the Workflows:
- Download either the
Claude Spellfix.alfredworkflow
orOpenAI Spellfix.alfredworkflow
from this repository. - Double click the file to import it into Alfred.
- Download either the
-
Set the Hotkey:
- Open Alfred Preferences.
- Go to the "Workflows" tab.
- Select the
Claude Spellfix
orOpenAI Spellfix
workflow. - Set a hotkey to trigger the workflow.
-
Update the Environment Variables:
- Click the
{X}
button in the top right corner of Alfred Preferences. - Go to "Environment Variables."
- Set
ANTHROPIC_API_KEY
for the Claude workflow orOPENAI_API_KEY
for the OpenAI workflow, depending on which one you are configuring. - Optionally, you can also adjust the model in the environment variables section.
- Click the
-
Check and Customize Python Scripts:
- If you want to change the prompts used for spell-checking and correction, you can edit the Python scripts located in the
src
directory and update them in the workflow.src/claude_spellfixer.py
src/openai_spellfixer.py
- If you want to change the prompts used for spell-checking and correction, you can edit the Python scripts located in the
-
Select the right Python version
- Make sure the correct python version is selected. It defaults to
usr/bin/python3
(see image below)
- Make sure the correct python version is selected. It defaults to
This workflow allows you to highlight text anywhere on your Mac, trigger the workflow with a keyboard shortcut, and automatically spell-check and correct the text using AI. The corrected text will then replace the original text.
The quick brown fox jumpd over the lazy dog. This is an exmple of a sentence with multiple erors. Lets see how well the AI can correkt this text.
Now you are ready to use the Alfred AI Spellfix workflows to quickly correct text using the power of AI models in any app.
You can most likely make this work on Windows by using something like Wox. Let me know via the issues or comments if you found a solution!