LangMate is a macOS app that rephrases selected text in place using AI. Select any text, press Cmd+Ctrl+R, and watch it get rephrased instantly.
- Rephrase in Place: Select text in any app, press Cmd+Ctrl+R, and the text is replaced with a rephrased version
- Menu Bar App: Runs quietly in the background with a menu bar indicator
- Multiple Language Models: Supports OpenAI GPT-4 and Ollama (llama3)
- macOS 10.13 or higher
- Go 1.16 or higher
- OpenAI API key
-
Clone the repository:
git clone https://github.com/niuguy/langmate.git cd langmate -
Build the macOS app:
./scripts/build_app.sh
-
Install to Applications:
cp -r LangMate.app /Applications/
-
Configure your API key:
echo 'OPENAI_API_KEY=sk-your-api-key-here' > ~/.langmate.env
-
Grant Accessibility permission:
- Open System Settings → Privacy & Security → Accessibility
- Click + and add
/Applications/LangMate.app - Enable the toggle
-
Launch the app from Spotlight or Applications folder
You can also run LangMate directly from the terminal:
# Build the binary
go build -o langmate
# Run with default settings (GPT-4, English)
./langmate
# Run with different model or language
./langmate -m llama -l fr- Open LangMate (it appears as "LM" in your menu bar)
- Select any text in any application
- Press Cmd+Ctrl+R
- The menu bar shows "Rephrasing..." while processing
- Your selected text is replaced with the rephrased version
-m, --model: Model to use -gpt(OpenAI GPT-4.1) orllama(Ollama llama3). Default:gpt-l, --lang: Target language code (e.g.,en,fr,es). Default:en
Create ~/.langmate.env with your API key:
OPENAI_API_KEY=sk-your-api-key-here
Alternatively, set the environment variable:
export OPENAI_API_KEY="sk-your-api-key-here"- Ensure LangMate has Accessibility permission in System Settings
- After rebuilding, remove and re-add the app in Accessibility settings
- Make sure
~/.langmate.envcontains your API key - Check Console.app for any error messages
Contributions are welcome! Please feel free to submit a pull request or open an issue.
Distributed under the MIT License. See LICENSE for more information.