Jane-xiaoer

Hammerspoon AI Translator — AI skill for Claude Code

AI community

AI translation plugin for Hammerspoon — select text, hotkey, paste.

How to install Hammerspoon AI Translator

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Jane-xiaoer/hammerspoon-ai-translator and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Hammerspoon AI Translator does

AI translation plugin for Hammerspoon — select text, hotkey, paste. Chinese ↔ English auto-detected.

Alternatives in AI

  • Coralline — 🪸 Powerlevel10k-inspired statusline for Claude Code — paste one prompt and your AI interviews you, then insta 541 ★
  • Yt Transcriber — CLI app- Give it a YouTube URL and you get a transcription with possible speaker identification and optional s 337 ★
  • Setup Watch Skill — One-shot setup for Watch Skill — installs the engine, bootstraps ffmpeg/yt-dlp, registers the MCP server in ev 315 ★

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

  1. Run install.sh
  2. Fill in API key in config.lua
  3. Open Hammerspoon → click Reload Config
  4. 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