Hammerspoon Ai Translator
Description
AI translation plugin for Hammerspoon — select text, hotkey, paste. Chinese ↔ English auto-detected.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
AI Translator for Hammerspoon
A macOS input helper that translates selected text using AI — Chinese ↔ English, auto-detected.
No switching apps. No copy-pasting to a translation window. Just select, hotkey, paste.
How it works
Select text → Option+Q → (AI translates) → Option+W → pasted
- Chinese selected → outputs English
- English selected → outputs Chinese
- Works in any app: WeChat, browser, notes, email
Install
**Requirements:** macOS, [Homebrew](https://brew.sh)
git clone https://github.com/Jane-xiaoer/hammerspoon-ai-translator
cd hammerspoon-ai-translator
bash install.sh
Then edit `~/.hammerspoon/ai-translator/config.lua` and fill in your API key.
Configuration
Open `config.lua` and set your provider and key:
-- Choose provider: "gemini" | "openai" | "custom"
config.provider = "gemini"
config.gemini = {
api_key = "YOUR_GEMINI_API_KEY", -- https://aistudio.google.com/app/apikey
model = "gemini-2.5-flash",
}
Supported providers
| Provider | Where to get key | Recommended model |
|---|---|---|
| Gemini (Google) | aistudio.google.com | gemini-2.5-flash |
| OpenAI | platform.openai.com | gpt-4o-mini |
| Custom | Any OpenAI-compatible endpoint | your model |
Change hotkeys
config.hotkey_translate = {{"alt"}, "q"} -- change to whatever you like
config.hotkey_paste = {{"alt"}, "w"}
First-time setup
- Run
install.sh - Fill in API key in
config.lua - Open Hammerspoon → click Reload Config
- macOS will ask for Accessibility permission — allow it (required for hotkeys to work in all apps)
License
MIT
📱 关注作者 / Follow Me
如果这个仓库对你有帮助,欢迎关注我。后面我会持续更新更多 AI Skill、桌面自动化、翻译工作流和效率工具。
If this repo helped you, follow me for more AI skills, desktop automation, translation workflows, and productivity tools.
- X (Twitter): [@x
Related Skills
Agency Agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject
AI Firecrawl
🔥 The API to search, scrape, and interact with the web for AI
AI Artifacts Builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web tech
AI CrewAI
Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewA
AI TrendRadar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的
AI mem0
| Universal memory layer for AI Agents | 51341 | 221 | 1 |
AI