WordSmith is a powerful CLI tool that leverages OpenAI's API to translate words, phrases, and sentences. It supports context-aware translations, batch processing from files, and customizable target languages, making it an essential tool for multilingual communication and language learning.
MIT License
WordSmith is a command-line tool for translating words, phrases, and words in context of a sentence.
Ensure you have Ruby installed on your system (version 2.7 or higher recommended).
Install the WordSmith gem:
gem install word_smith
ws --set-openai-api-key YOUR_API_KEY
ws --set-openai-org-id YOUR_ORG_ID
Replace YOUR_API_KEY
and YOUR_ORG_ID
with your actual OpenAI credentials.
Basic usage:
ws [word/phrase] [options]
Examples:
ws hello
ws good morning
ws a /random/ sentence
ws -f words.txt
ws hello --target-language Spanish
ws hello --no-cache
Options:
-f, --file [FILE_PATH]
: Read words from a file--target-language [LANGUAGE_CODE]
: Specify target language for translation--no-cache
: Translate without using cache-h, --help
: Show help-v, --version
: Show versionSet OpenAI API key:
ws --set-openai-api-key [key]
Set OpenAI Organization ID:
ws --set-openai-org-id [key]
MIT