fanyi  by afc163

CLI tool for quick Chinese/English translation

created 11 years ago
1,502 stars

Top 28.0% on sourcepulse

GitHubView on GitHub
Project Summary

Fānyì (翻译) is a command-line translation tool designed for quick Chinese-English translations. It targets developers and power users who frequently work with both languages and prefer terminal-based workflows. The tool leverages DeepSeek AI and Iciba for translation, offering improved speed and accuracy over previous versions.

How It Works

The tool utilizes a dual-backend approach, integrating with DeepSeek AI for advanced large language model-based translations and Iciba for more traditional dictionary-style lookups. This combination aims to provide both nuanced, context-aware translations and quick, accurate definitions. The project has undergone significant refactoring, removing less reliable or slower translation sources and dependencies like say commands, simplifying its architecture and improving performance.

Quick Start & Requirements

  • Install: npm i fanyi -g or bun i fanyi -g
  • Prerequisites: Node.js or Bun runtime.
  • Configuration: Global configuration can be managed via fanyi config set <key> <value>, with options for disabling backends (iciba, deepseek), color output, and setting LLM_API_KEY.
  • Docs: npm package page

Highlighted Details

  • Powered by DeepSeek AI and Iciba.
  • Supports single words and full sentences in both Chinese and English.
  • Features gradient color output for enhanced readability.
  • Includes a list command for viewing translation history.

Maintenance & Community

The project is actively maintained, with recent updates focusing on refactoring and improving translation sources. GitHub Actions are used for testing and code coverage.

Licensing & Compatibility

The project appears to be licensed under the MIT license, allowing for commercial use and integration with closed-source projects.

Limitations & Caveats

The tool has removed support for OpenAI and Youdao translation sources, as well as word pronunciation features, to simplify installation and improve compatibility, particularly on Linux.

Health Check
Last commit

5 days ago

Responsiveness

1 day

Pull Requests (30d)
8
Issues (30d)
1
Star History
22 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.