Generate Translations
payloadcms/payload
A skill your agent uses when new translation keys are added to packages to generate new translations strings
用命令行工具 fanyi(别名 fy)做中英互译与查词,一次返回词典(iciba、youdao)和大模型三方结果。适用于单词、短语、习语谚语、单句短句的中英翻译,以及查释义、音标、例句、相关词。触发场景如"翻译一下 xxx"、"xxx 是什么意思"、"xxx 用英语怎么说"、"和谐 翻译成英文"——即使没说"用 fanyi"也应优先用本…
$ npx skills add afc163/fanyi --skill fanyi -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install afc163/fanyi fanyi --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/afc163/fanyi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/fanyi .claude/skills/fanyi && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "fanyi" agent skill from https://github.com/afc163/fanyi/tree/main/skills/fanyi into .claude/skills/fanyi/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fanyi", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/afc163/fanyi/tree/main/skills/fanyiType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add afc163/fanyi --skill fanyi -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install afc163/fanyi fanyi --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afc163/fanyi.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/fanyi .agents/skills/fanyi && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "fanyi" agent skill from https://github.com/afc163/fanyi/tree/main/skills/fanyi into .agents/skills/fanyi/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fanyi", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add afc163/fanyi --skill fanyi -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install afc163/fanyi fanyi --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afc163/fanyi.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/fanyi .cursor/skills/fanyi && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "fanyi" agent skill from https://github.com/afc163/fanyi/tree/main/skills/fanyi into .cursor/skills/fanyi/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fanyi", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/afc163/fanyi.git --path skills/fanyi--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add afc163/fanyi --skill fanyi -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install afc163/fanyi fanyi --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afc163/fanyi.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/fanyi .gemini/skills/fanyi && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "fanyi" agent skill from https://github.com/afc163/fanyi/tree/main/skills/fanyi into .gemini/skills/fanyi/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fanyi", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install afc163/fanyi fanyiInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add afc163/fanyi --skill fanyi -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/afc163/fanyi.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/fanyi .github/skills/fanyi && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "fanyi" agent skill from https://github.com/afc163/fanyi/tree/main/skills/fanyi into .github/skills/fanyi/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fanyi", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add afc163/fanyi --skill fanyi -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install afc163/fanyi fanyi --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afc163/fanyi.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/fanyi .opencode/skills/fanyi && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "fanyi" agent skill from https://github.com/afc163/fanyi/tree/main/skills/fanyi into .opencode/skills/fanyi/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fanyi", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
fanyi用命令行工具 fanyi(别名 fy)做中英互译与查词,一次返回词典(iciba、youdao)和大模型三方结果。适用于单词、短语、习语谚语、单句短句的中英翻译,以及查释义、音标、例句、相关词。触发场景如"翻译一下 xxx"、"xxx 是什么意思"、"xxx 用英语怎么说"、"和谐 翻译成英文"——即使没说"用 fanyi"也应优先用本…
Fanyi is an agent skill from afc163/fanyi. 用命令行工具 fanyi(别名 fy)做中英互译与查词,一次返回词典(iciba、youdao)和大模型三方结果。适用于单词、短语、习语谚语、单句短句的中英翻译,以及查释义、音标、例句、相关词。触发场景如"翻译一下 xxx"、"xxx 是什么意思"、"xxx 用英语怎么说"、"和谐 翻译成英文"——即使没说"用 fanyi"也应优先用本 skill,比口头翻译更准更全。不适用:长句、段落、整篇文章等长文本翻译(改由模型直接翻),以及非中英语言、文案润色、写代码等需求。
Its SKILL.md is about 770 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Writing & Content, covering Translation. It works with Node.js, npm and pnpm. The repository describes itself as: A 🇨🇳 and 🇺🇸 translator in your command line. The licence is MIT.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit c853e6b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
bunpnpmyarnnpmFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pnpm, yarn and npm, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
LLM_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Fanyi loads about 766 tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 133 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from afc163/fanyi at commit c853e6b, republished under its MIT licence (© afc163). 133 words, ~766 tokens.
.claude/skills/fanyi/SKILL.md (or your agent's skills folder).fanyi(短别名 fy)是一个命令行中英互译工具。它会同时返回 iciba 词典、youdao 词典和大模型(LLM)三方的翻译结果:词典给出权威释义、音标、词形、相关词、词组和例句,LLM 给出贴合语境的翻译。仅支持中文 ↔ 英文。
适合:单词、短语、习语谚语、单句短句的中英互译与查词。这类内容词典能给出结构化释义,放进命令行参数也自然。
不适合:长句、整段落、整篇文章、文档的翻译。原因有两点——一是这种长文本作为命令行参数既笨拙又容易被 shell 拆坏;二是 fanyi 的输出是按"查词/短句"组织的(音标、词性、例句那一套),长文反而读起来累赘。遇到长文本翻译,直接由模型自己翻更合适,不要套用本 skill。一个简单的判断:如果内容超过一句话、或明显是要"通顺译完一段",就别用 fanyi。
直接靠模型口头翻译,容易漏掉音标、词性、常用搭配和真实例句,单词的多个义项也容易给得不全。fanyi 把词典的结构化数据和大模型的语境翻译合在一起,一条命令就能拿到最完整的结果,所以遇到中英查词/短句翻译时优先调用它,而不是自己直接翻。
核心命令就是把要翻译的内容作为参数传给 fanyi:
fanyi <要翻译的内容>fy 是完全等价的短别名,任选其一即可:
fy <要翻译的内容>翻译单个英文单词(会返回释义、音标、相关词、例句):
fanyi love翻译短语或多个词(直接跟在后面,不用引号):
fanyi make love
fanyi world peace中译英 / 翻译中文(单字、词、甚至整句都支持):
fanyi 和谐
fanyi 子非鱼焉知鱼之乐含空格或特殊字符的句子用引号包起来,避免被 shell 拆开:
fanyi "How are you doing today?"
fanyi "纸上得来终觉浅"&、|、$ 等 shell 特殊字符时才用双引号包裹。用户问"我之前查过哪些词""最近查的单词"时,用 list 子命令:
fanyi list # 查看当天的查询记录(默认)
fanyi list -r 7 # 查看最近 7 天
fanyi list -d 2026-06-06 # 查看指定某天注意 fanyi list 默认只返回当天记录。要看更早的历史,用 -r <天数> 指定回溯范围,或用 -d <日期> 看某一天。
fanyi 默认即可用。只有当用户明确想调整时才动配置:
fanyi config list # 查看当前配置
fanyi config set iciba false # 关闭 iciba 源
fanyi config set llm false # 关闭大模型翻译
fanyi config set color false # 关闭彩色输出
fanyi config set LLM_API_KEY <your-key> # 用自己的大模型 API Key
fanyi config set LLM_API_BASE_URL <your-url> # 自定义 OpenAI 兼容接口地址
fanyi config set LLM_MODEL_ID <model-id> # 指定模型 ID配置写入 ~/.config/fanyi/.fanyirc。
运行翻译命令前,先确认 fanyi 可用(例如 command -v fanyi)。如果提示 command not found,直接帮用户装上,不要只丢一条命令让用户自己敲。
安装步骤:
探测用户机器上有哪些包管理器,按下面顺序取第一个可用的即可(它们大多兼容 npm 的全局安装语义):
for pm in bun pnpm yarn cnpm tnpm utoo npm; do
command -v "$pm" >/dev/null 2>&1 && echo "$pm"
done用探测到的包管理器全局安装,各工具的全局安装命令:
| 包管理器 | 安装命令 |
|---|---|
| bun | bun add -g fanyi |
| pnpm | pnpm add -g fanyi |
| yarn | yarn global add fanyi |
| cnpm | cnpm i fanyi -g |
| tnpm | tnpm i fanyi -g |
| utoo | utoo i fanyi -g(或 utoo add -g fanyi) |
| npm | npm i fanyi -g |
优先选 bun / pnpm(更快);都没有就回退到 npm。装完再跑一次翻译命令即可。
为什么这样做:用户的本意是想翻译,卡在"没装工具"这一步上很扫兴。帮他用现成的包管理器一键装好、然后立刻给出翻译结果,体验最顺。注意全局安装在某些环境(如系统 Node)可能需要权限,若报 EACCES 之类的权限错误,再把命令和 sudo 提示交给用户判断,不要擅自加 sudo 执行。
© afc163, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/fanyi of afc163/fanyi.
Open the folder on GitHubat commit c853e6b
Fanyi next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Fanyi this skillafc163/fanyi | 1.6k | — | ~766 | Automated safety check: Pass | MIT | |
| Generate Translationspayloadcms/payload | 45k | — | ~1.1k | Automated safety check: Pass | MIT | |
| Plane UI Translationmakeplane/plane | 61k | — | ~16k | Automated safety check: Pass | AGPL-3.0 | |
| Aholo Viewer Docsmanycoretech/aholo-viewer | 1.1k | — | ~341 | Automated safety check: Pass | MIT | |
| Adding Translation Keyvexl-it/vexl | 125 | — | ~632 | Automated safety check: Pass | GPL-3.0 | |
| Bunbrianlovin/agent-config | 377 | 1 repos | ~484 | Automated safety check: Notes | None |
payloadcms/payload
A skill your agent uses when new translation keys are added to packages to generate new translations strings
makeplane/plane
Sets the rules for translating and updating Plane's UI strings across locales: do-not-translate terms, plural forms, placeholders and AI translation review.
manycoretech/aholo-viewer
Guides writing and maintaining Aholo Viewer documentation: README, AGENTS.md, architecture notes, bilingual manual pages and AI collaboration guides.
vexl-it/vexl
How to add or change a user-facing string in the Vexl app and translate it into all shipped locales.
brianlovin/agent-config
Use Bun instead of Node.js, npm, pnpm, or vite. An agent skill from brianlovin/agent-config.
vexl-it/vexl
Translations audit — fill missing keys in every shipped locale, re-translate keys whose English changed, delete stale ones, flag suspicious values.
Categories
用命令行工具 fanyi(别名 fy)做中英互译与查词,一次返回词典(iciba、youdao)和大模型三方结果。适用于单词、短语、习语谚语、单句短句的中英翻译,以及查释义、音标、例句、相关词。触发场景如"翻译一下 xxx"、"xxx 是什么意思"、"xxx 用英语怎么说"、"和谐 翻译成英文"——即使没说"用 fanyi"也应优先用本…. Fanyi is an agent skill from afc163/fanyi.
Fanyi fits situations like: tasks that involve Translation.
Run `npx skills add afc163/fanyi --skill fanyi -a claude-code`. Or copy the skill folder (skills/fanyi in afc163/fanyi) into .claude/skills/fanyi in your project. Claude Code loads it when a task matches its description.
Run `npx skills add afc163/fanyi --skill fanyi -a codex`. Or copy the skill folder (skills/fanyi in afc163/fanyi) into .agents/skills/fanyi in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add afc163/fanyi --skill fanyi -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fanyi, .gemini/skills/fanyi, .github/skills/fanyi and .opencode/skills/fanyi in your project.
Going by SKILL.md and its folder, Fanyi needs the command-line tools its instructions call (bun, pnpm, yarn and npm) and credentials named LLM_API_KEY. Our summary lists: Node.js; A credential in LLM_API_KEY.
SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Fanyi is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 766 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Fanyi: Generate Translations (payloadcms/payload, 45k stars), Plane UI Translation (makeplane/plane, 61k stars), Aholo Viewer Docs (manycoretech/aholo-viewer, 1.1k stars) and Adding Translation Key (vexl-it/vexl, 125 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
afc163 (a GitHub user) maintains it in afc163/fanyi, which has 1,554 GitHub stars. The repository was last updated on September 7, 2026.
Source: afc163/fanyi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.