{"id":17563774,"url":"https://github.com/styx11/whats","last_synced_at":"2025-06-18T18:38:39.142Z","repository":{"id":37677805,"uuid":"205846536","full_name":"Styx11/whats","owner":"Styx11","description":"🌐 a terminal translation tool","archived":false,"fork":false,"pushed_at":"2023-04-10T23:32:39.000Z","size":435,"stargazers_count":31,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T10:53:42.217Z","etag":null,"topics":["command-line-tool","nodejs","terminal","terminal-tool","translate","translation","translation-tool","translations-api"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/what-is-x","language":"TypeScript","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/Styx11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2019-09-02T11:54:42.000Z","updated_at":"2025-01-17T16:06:59.000Z","dependencies_parsed_at":"2025-04-18T02:39:18.636Z","dependency_job_id":"a2a063ad-f771-4a0e-8bd9-54ae9d5d9490","html_url":"https://github.com/Styx11/whats","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/Styx11/whats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fwhats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fwhats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fwhats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fwhats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Styx11","download_url":"https://codeload.github.com/Styx11/whats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fwhats/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260611387,"owners_count":23036331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["command-line-tool","nodejs","terminal","terminal-tool","translate","translation","translation-tool","translations-api"],"created_at":"2024-10-21T13:09:17.289Z","updated_at":"2025-06-18T18:38:34.127Z","avatar_url":"https://github.com/Styx11.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# whats 🔍\n一个作者本人也经常用的命令行翻译工具🤓\n\n***Inspired by [afc163/fanyi](https://github.com/afc163/fanyi), but more***\n\n![](https://img.shields.io/node/v/what-is-x)\n![](https://img.shields.io/npm/v/what-is-x?color=blue)\n![](https://img.shields.io/librariesio/github/styx11/whats)\n![](https://img.shields.io/github/license/styx11/whats)\n\n![](https://s2.ax1x.com/2019/12/24/lPYdyD.png)\n\n\u003c/div\u003e\n\n## ⭐️Features\n\n* 中英日文基本词语互译\n* 小语种中文翻译\n* 支持语言范围内的长句翻译\n* 文本关键字高亮\n* 中英文语音播放\n* 终端**自适应**的输出\n* 支持查询记录\n\n![](https://s2.ax1x.com/2019/11/09/MnFMh4.png)\n\n## 💾Install\n\n```\nnpm install -g what-is-x\n```\n🚨[注意](#关于-v046-及以上版本说明)\n\n## 💡Usage\n\n```\nUsage: whats \u003cquery\u003e [options]\n\nOptions:\n  -v, --vers                      output the current version\n  -h, --help                      output usage information\n  -f, --from        \u003csource\u003e      the source language to translate\n  -t, --to          \u003ctarget\u003e      the target language\n  -n, --normal                    normalize text color in your terminal\n  -s, --say                       use default system voice and speak\n  -r, --record   [limit | clear]  show the query record (limit records ouputs default: 6 or clear records)\n\nExamples:\n  $ whats love\n  $ whats bonjour -f fr\n  $ whats こんにちは -f ja -t en\n  $ whats I love you very much\n  $ whats -r clear // 清除查询记录\n  $ whats -r 10    // 限制查询结果数量\n```\n\n\n### 🇨🇳支持语言\n\n语言|目标语言|\n---|:--:|\n中文|英文、日文、韩文、法文、西班牙文、葡萄牙文、俄文、越南文、德文、阿拉伯文、印尼文、意大利文\n英文|中文、日文\n日文|中文、英文\n韩文|中文\n法文|中文\n西班牙文|中文\n葡萄牙文|中文\n意大利文|中文\n俄文|中文\n越南文|中文\n德文|中文\n阿拉伯文|中文\n印尼文|中文\n意大利文|中文\n\n### 🇺🇳各语言对应代码\n\n语言|代码|\n---|:--:|\n中文|zh-CHS\n英文|en\n日文|ja\n韩文|ko\n法文|fr\n西班牙文|es\n葡萄牙文|pt\n意大利文|it\n俄文|ru\n越南文|vi\n德文|de\n阿拉伯文|ar\n印尼文|id\n\n## 💬Notes\n\n1. 你的 Node 版本需 ≥ 7.6.0\n\n2. 本翻译工具拥有终端自适应的输出，即超过终端宽度的输出会被切分并排版，\n  例句的输出不会溢出终端窗口。一般情况下想要看到**全部的例句**建议的终端窗口大小最少为 `73 * 25`\n\n3. 请**不要混用**全角和半角符号，这会让程序难以判断句子的切分位置从而导致排版畸形的输出结果\n\n4. 测试版本目前支持基本词语的互译、小语种中文翻译、长句子翻译（中文字符数 \u003e 4 将被视为句子）\n\n5. 输出结果的文本颜色可能会因你的终端主题而有较大差异，\n  想要消除颜色带来的影响（**无颜色**输出）可以使用 `-n` 或 `--normal` 命令。\n  例如：\n    ```\n    $ whats up --normal\n    ```\n\n6. 除**中英文**互译外所有语言的翻译**必须**使用 `-f` 或 `--from` 标识源语言\n7. 在支持语言范围内，若无 `-t` 或 `--to` 命令标识，目标语言默认为**中文**\n8. 使用语音播放 `-s` 或 `--say` 时，可能会存在系统层次的问题，具体参考👉[say.js](https://github.com/Marak/say.js#feature-matrix)\n\n### 🚨关于 v0.4.6 及以上版本说明\n由于 MacOS 自 10.11 系统开始使用了 Rootless 机制，系统默认将会锁定 /system、/bin、/usr 这三个目录，\n因此全局环境下无法获取数据库读写权限，需要在终端输入如下命令：\n```\nsudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}\n```\n\n## 📄License\nMIT.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyx11%2Fwhats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyx11%2Fwhats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyx11%2Fwhats/lists"}