{"id":13459048,"url":"https://github.com/afc163/fanyi","last_synced_at":"2026-06-06T08:00:52.615Z","repository":{"id":12638223,"uuid":"15309697","full_name":"afc163/fanyi","owner":"afc163","description":"A 🇨🇳 and 🇺🇸 translator in your command line","archived":false,"fork":false,"pushed_at":"2026-06-05T07:44:06.000Z","size":420,"stargazers_count":1540,"open_issues_count":0,"forks_count":144,"subscribers_count":18,"default_branch":"main","last_synced_at":"2026-06-05T09:11:57.403Z","etag":null,"topics":["chinese","command-line","command-line-tools","groq","llama3","nodejs","translation","translator"],"latest_commit_sha":null,"homepage":"https://npmjs.com/fanyi","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afc163.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"afc163","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2013-12-19T11:09:46.000Z","updated_at":"2026-06-05T07:41:58.000Z","dependencies_parsed_at":"2024-01-03T04:12:40.355Z","dependency_job_id":"4d6852cf-5b02-4bc6-bedb-b20489b61d04","html_url":"https://github.com/afc163/fanyi","commit_stats":{"total_commits":213,"total_committers":20,"mean_commits":10.65,"dds":"0.14553990610328638","last_synced_commit":"8bba0afde33558b552a61745165eedd99ea3c413"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/afc163/fanyi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afc163%2Ffanyi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afc163%2Ffanyi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afc163%2Ffanyi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afc163%2Ffanyi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afc163","download_url":"https://codeload.github.com/afc163/fanyi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afc163%2Ffanyi/sbom","scorecard":{"id":169461,"data":{"date":"2025-08-11","repo":{"name":"github.com/afc163/fanyi","commit":"53a0c33cba6a59181b72434d0d37311c31600361"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Code-Review","score":3,"reason":"Found 8/22 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/echo.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/afc163/fanyi/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/afc163/fanyi/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/afc163/fanyi/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/afc163/fanyi/test.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":7,"reason":"SAST tool is not run on all commits -- score normalized to 7","details":["Warn: 12 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T16:00:13.303Z","repository_id":12638223,"created_at":"2025-08-16T16:00:13.303Z","updated_at":"2025-08-16T16:00:13.303Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33973868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chinese","command-line","command-line-tools","groq","llama3","nodejs","translation","translator"],"created_at":"2024-07-31T09:01:01.651Z","updated_at":"2026-06-06T08:00:52.609Z","avatar_url":"https://github.com/afc163.png","language":"JavaScript","funding_links":["https://ko-fi.com/afc163"],"categories":["JavaScript","bricks","Applications"],"sub_categories":["展望","Directory Navigation"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Fānyì (翻译)\n\nA 🇨🇳 and 🇺🇸🇬🇧 translator in your command line, powered by iciba, youdao and LLM.\n\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][github-actions-image]][github-actions-url]\n[![Codecov][codecov-image]][codecov-url]\n[![Agent Skill][skill-image]][skill-url]\n\n[npm-image]: http://img.shields.io/npm/v/fanyi.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/fanyi\n[github-actions-image]: https://github.com/afc163/fanyi/actions/workflows/test.yml/badge.svg\n[github-actions-url]: https://github.com/afc163/fanyi/actions/workflows/test.yml\n[codecov-image]: https://img.shields.io/codecov/c/github/afc163/fanyi/main.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/afc163/fanyi\n[download-image]: https://img.shields.io/npm/dm/fanyi.svg?style=flat-square\n[download-url]: https://npmjs.org/package/fanyi\n[skill-image]: https://img.shields.io/badge/Agent-Skill-d97757?style=flat-square\n[skill-url]: skills/fanyi\n\n![](https://github.com/user-attachments/assets/edf0d6f7-a3d1-496d-9422-71522198d61c)\n\n\u003c/div\u003e\n\n[fanyi@11.0.0](https://github.com/afc163/fanyi/releases/tag/v11.0.0) 正式发布！这一版**开箱即用、无需任何配置**：内置免费 LLM 代理，装上就能用大模型翻译。同时恢复了有道词典，LLM 结果支持流式语义着色，并新增了让 AI Agent 直接调用 fanyi 的 [Agent Skill](skills/fanyi)。依旧是你命令行中**最简单顺手快捷**的中英文翻译工具。\n\n- 🆓 内置免费 LLM 代理，无需 API Key 即可使用大模型翻译，开箱即用。\n- 🌊 LLM 结果流式输出 + 语义着色，边生成边上色，等待时显示实时耗时。\n- 📖 恢复有道词典翻译源，与 iciba、LLM 三路结果并列。\n- ✨ 全新青紫流光 spinner 与绿色微渐变词义着色，输出更灵动。\n- 🤖 新增 [Agent Skill](skills/fanyi)，让 Claude Code 等 AI Agent 自动调用 fanyi 翻译。\n- 🔧 支持自定义 LLM：配置 `LLM_API_KEY` / `LLM_API_BASE_URL` / `LLM_MODEL_ID` 接入任意 OpenAI 兼容模型。\n\n## Install\n\n```bash\n$ npm i fanyi -g\n```\n\nor\n\n```bash\n$ bun i fanyi -g\n```\n\n## Usage\n\n```bash\n$ fanyi word\n```\n\nFor short:\n\n```bash\n$ fy word\n```\n\nTranslation data is fetched from [iciba.com](https://iciba.com), [youdao.com](https://youdao.com) and an LLM, and only support translation between Chinese and English.\n\nTranslate one word.\n\n```bash\n$ fanyi love\n```\n\n```js\n love  [ lʌv ]  ~  fanyi.youdao.com\n\n - n. 恋爱；亲爱的；酷爱；喜爱的事物；爱情，爱意；疼爱；热爱；爱人，所爱之物\n - v. 爱，热爱；爱戴；赞美，称赞；喜爱；喜好；喜欢；爱慕\n - n. （英）洛夫（人名）\n\n 1. Love\n    爱,爱情,恋爱\n 2. Endless Love\n    无尽的爱,不了情,蓝色生死恋\n 3. puppy love\n    早恋,青春期恋爱,初恋\n\n love [ lʌv ] [ lʌv ]  ~  iciba.com\n\n - vt.\u0026vi. 爱，热爱；爱戴；喜欢；赞美，称赞；\n - vt. 喜爱；喜好；喜欢；爱慕；\n - n. 爱情，爱意；疼爱；热爱；爱人，所爱之物；\n\n 1. They happily reflect the desire for a fusional love that inspired the legendary LOVE bracelet Cartier.\n    快乐地反映出为富有传奇色彩的卡地亚LOVE手镯所赋予的水乳交融之爱恋情愫。\n 2. Love is the radical of lovely, loveliness, and loving.\n    Love是lovely,loveliness及loving的词根。\n 3. She rhymes\"love\"with\"dove\".\n    她将\"love\"与\"dove\"两字押韵。\n 4. In sports, love means nil.\n    体育中，love的意思是零。\n 5. Ludde Omholt with his son, Love, in S?derma a bohemian and culturally rich district in Stockholm.\n    LuddeOmholt和他的儿子Love在南城——斯德哥尔摩市的一个充满波西米亚风情的文化富饶区散步。\n```\n\nMore words.\n\n```bash\n$ fanyi make love\n```\n\nSupport Chinese, even sentence.\n\n```bash\n$ fanyi 和谐\n```\n\n```bash\n$ fanyi 子非鱼焉知鱼之乐\n```\n\n```bash\n$ fanyi list\n```\n\nAlso, you can use `list` command to see the history of your search.\n\n```js\n2022-08-17\n   test\n     n. 试验；考验；测验；化验；\n     vt. 测验；考查；考验；勘探；\n     vi. 受试验；受测验；受考验；测得结果；\n```\n\n## Configuration\n\nA configuration file can be put into `~/.config/fanyi/.fanyirc`, in the user's home directory.\n\nUse subcommand `fanyi config set \u003ckey\u003e \u003cvalue\u003e` to set configuration options.\n\nExample:\n\n```bash\n$ fanyi config list                                   // list all configuration options\n$ fanyi config set iciba false                        // disable iciba globally\n$ fanyi config set youdao false                       // disable youdao globally\n$ fanyi config set llm false                          // disable llm globally\n$ fanyi config set color false                        // disable color globally\n$ fanyi config set LLM_API_BASE_URL your-api-base-url // set LLM_API_BASE_URL\n$ fanyi config set LLM_API_KEY your-api-key           // set LLM_API_KEY\n$ fanyi config set LLM_MODEL_ID your-model-id         // set LLM_MODEL_ID\n```\n\nBy default fanyi works out of the box with **no configuration** — when no `LLM_API_KEY` is set, it routes LLM translation through a built-in free proxy, so you can use large-model translation immediately after install.\n\nIf you set `LLM_API_KEY` but leave `LLM_API_BASE_URL` and `LLM_MODEL_ID` empty, it will call `deepseek-chat` at [DeepSeek's Platform](https://platform.deepseek.com) by default.\n\nIf you want to use other LLMs, make sure you have properly set `LLM_API_KEY` `LLM_API_BASE_URL` and `LLM_MODEL_ID`. Also, the api endpoint should be [OpenAi Compatible](https://platform.openai.com/docs/api-reference/chat/create).\n\n## Agent Skill\n\nThis repo ships an [Agent Skill](skills/fanyi) so AI agents (Claude Code, Claude.ai, and other tools that support the Agent Skills spec) can call `fanyi` for you automatically — just say \"翻译一下 serendipity\" or \"和谐 用英语怎么说\" and the agent runs `fanyi` under the hood, returning the full iciba / youdao / LLM results.\n\n### Install\n\nFirst make sure the CLI is installed globally so the skill can invoke it (the skill auto-detects your package manager — `bun` / `pnpm` / `yarn` / `cnpm` / `tnpm` / `utoo` / `npm` — and installs it for you when it's missing):\n\n```bash\n$ npm i fanyi -g\n```\n\nThen install the skill into your agent's skills directory. For Claude Code:\n\n```bash\n$ git clone https://github.com/afc163/fanyi.git\n$ cp -r fanyi/skills/fanyi ~/.claude/skills/fanyi\n```\n\nOther agents: copy `skills/fanyi` into wherever your tool loads skills from.\n\n### Usage\n\nOnce installed, the skill triggers on any Chinese ↔ English translation or lookup request, even without naming the tool:\n\n- `翻译一下 serendipity`\n- `子非鱼焉知鱼之乐 用英语怎么说`\n- `serendipity 是什么意思`\n\nThe agent will run `fanyi \u003cword\u003e` and show you the dictionary and LLM results.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafc163%2Ffanyi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafc163%2Ffanyi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafc163%2Ffanyi/lists"}