tencent-translate-cli
v1.0.2
Published
Interactive command-line translation tool for Chinese to English using Tencent Cloud API
Downloads
11
Maintainers
Readme
Tencent Translate CLI
Translate Chinese to English in your terminal using Tencent Cloud API.
Install
npm install -g tencent-translate-cliSetup
- Get API keys from Tencent Cloud Console
- Enable Translation Service
- Set environment variables:
macOS/Linux:
# Add to ~/.zshrc or ~/.bashrc
echo 'export TENCENT_SECRET_ID=your_secret_id' >> ~/.zshrc
echo 'export TENCENT_SECRET_KEY=your_secret_key' >> ~/.zshrc
source ~/.zshrcWindows:
setx TENCENT_SECRET_ID "your_secret_id"
setx TENCENT_SECRET_KEY "your_secret_key"Or use .env file:
echo "TENCENT_SECRET_ID=your_secret_id" > .env
echo "TENCENT_SECRET_KEY=your_secret_key" >> .envUsage
Run the translator:
tt
# or
tencent-translateType Chinese text and press Enter to translate. Type exit to quit.
$ tt
> 你好世界
Translation: Hello World
> 今天天气很好
Translation: The weather is very good today
> exit
Goodbye!Features
- Interactive CLI interface
- Real-time translation
- Global installation
- Environment variable support
.envfile support
Troubleshooting
"Service has not been opened" error: Enable the service at TMT Console
Authentication issues: Check your API keys at API Management
License
MIT © john
