afc163/fanyi

A 🇨🇳 and 🇺🇸 translator in your command line

What it solves

Fānyì is a command-line interface (CLI) tool designed to provide quick and easy Chinese-English translation and word lookup. It eliminates the need to switch to a browser or a dedicated translation app by bringing translation capabilities directly into the terminal.

How it works

The tool fetches translation data from three distinct sources: traditional dictionary services (iciba.com and youdao.com) and a Large Language Model (LLM). By default, it works out of the box using a built-in free LLM proxy, but users can configure it to use any OpenAI-compatible LLM by providing their own API key, base URL, and model ID.

Who it’s for

Developers and command-line users who frequently translate between Chinese and English and want a fast, integrated experience without leaving their terminal.

Highlights

  • Multi-source translation: Combines results from iciba, youdao, and an LLM for comprehensive coverage.
  • Out-of-the-box LLM: Includes a free proxy for LLM translations, requiring no initial configuration or API keys.
  • Agent Integration: Provides an "Agent Skill" that allows AI agents like Claude Code to automatically invoke the translation tool.
  • Customizable LLM: Supports any OpenAI-compatible model via configuration.
  • Visual Enhancements: Features streaming output with semantic coloring and a dynamic spinner for LLM results.

Related

  • Project
  • Project
  • Project
  • Project
  • Project