Skip to main content

Y-Translator CLI

An AI-powered command-line translator that converts between English and Chinese.

Installation

From PyPI (pip)

pip install y-translator-cli

Install from PyPI:

uv tool install y-translator-cli

Or install from source:

git clone https://github.com/yourusername/y-translator.git
cd y-translator
uv tool install -e .

Usage

Start the translator:

trans

Or translate text directly:

trans "Hello, world!"
trans "你好,世界!"

Options:

  • -h, --help: Show help message
  • -v, --version: Show version information
  • --verbose: Enable debug mode
  • --model MODEL: Specify AI model to use (default: qwen3.6-flash)
  • --api-key KEY: Set DashScope API key
  • -n, --no-stream: Disable streaming mode

Environment Variables

You can set the following environment variables:

  • DASHSCOPE_API_KEY: Your DashScope API key
  • AI_MODEL: AI model to use (default: qwen3.6-flash)

Examples

  1. Start the translator:
trans
  1. Enable debug mode:
trans --verbose
  1. Use a specific model:
trans --model qwen3.6-flash
  1. Disable streaming output:
trans -n

Development

Installation for Development

# Clone the repository
git clone https://github.com/yourusername/y-translator.git
cd y-translator

# Install with uv
uv sync --dev

Dependencies

The project depends on the following packages:

  • prompt_toolkit>=3.0.0 - Interactive command-line interface
  • agno>=0.1.0 - AI agent framework (with DashScope provider)
  • python-dotenv>=0.19.0 - Environment variable management
  • socksio - SOCKS proxy support

Building the Package

# Build with uv
uv build

Publishing to PyPI

  1. Get PyPI API Token:

    • Login to https://pypi.org
    • Go to Account settings → API tokens
    • Create a new API token (recommended: project-scoped, e.g., y-translator-cli)
  2. Upload to PyPI with uv:

    uv publish
    
  3. Version Bump (if version already exists): PyPI does not allow overwriting existing versions. If you get a "File already exists" error:

    • Update __version__ in translator/__init__.py
    • Rebuild: uv build
    • Upload again: uv publish

License

MIT License

Metadata

Release files for y-translator-cli 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for y-translator-cli 0.1.5
File Size Uploaded Provenance Actions
y_translator_cli-0.1.5.tar.gz 5.8 kB Without provenance Details for y_translator_cli-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for y-translator-cli 0.1.5
File Interpreter ABI Platform Actions
y_translator_cli-0.1.5-py3-none-any.whl Python 3 none any Details for y_translator_cli-0.1.5-py3-none-any.whl

Total release size: 12.1 kB

Release files / y_translator_cli-0.1.5.tar.gz

Download URL y_translator_cli-0.1.5.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c021b37d4c93ee825522c2e6178afbed98b1ef8df8ab709af345b1efd7c9e22c
BLAKE2b-256 checksum
How to use checksums
93e417c4ac0adfaeb921f2707bb90696ccfb6dc8fef46b7172f90df5b88ddb91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.10

Release files / y_translator_cli-0.1.5-py3-none-any.whl

Download URL y_translator_cli-0.1.5-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5ac7814531a2f6e2e14af86e761a030b1000b4538f86bac6ddbc88841fed37c
BLAKE2b-256 checksum
How to use checksums
4ab323dd87987de9668e870f93b27b46bb49b9d386d8bf5618bd2fd3f79ce3ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.10

Security for y-translator-cli 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page