https://github.com/phenomen/gtai
A CLI interface for Google Translate LLM using the Advanced Translation V3 API with support for custom glossaries and file translation
https://github.com/phenomen/gtai
Last synced: 3 months ago
JSON representation
A CLI interface for Google Translate LLM using the Advanced Translation V3 API with support for custom glossaries and file translation
- Host: GitHub
- URL: https://github.com/phenomen/gtai
- Owner: phenomen
- License: mit
- Created: 2025-06-27T15:02:24.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-14T14:36:19.000Z (12 months ago)
- Last Synced: 2026-02-08T10:49:38.648Z (5 months ago)
- Language: TypeScript
- Size: 73.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Translate AI CLI
A CLI interface for **Google Translate LLM** using the [Advanced Translation V3 API](https://cloud.google.com/translate/docs/advanced/translate-text-advance) with support for custom glossaries and file translation.
## Features
- 🌐 LLM-powered text translation with language pairs
- 📚 Custom glossary support for domain-specific translations
- ⚙️ Persistent settings
- 📄 File translation (TXT and MD files; PDF support coming soon)
## Setup
### 1. Bun Runtime
[Install Bun](https://bun.sh/). The CLI uses the Bun API and does not support Node.js runtime.
### 2. Google Cloud Project
- Create a project on [Google Cloud](https://cloud.google.com).
- Enable billing for your project.
- Enable the Cloud Translation API and Cloud Storage API (APIs & Services → Library).
### 3. Google Cloud Storage Bucket
(Optional) The Google Translation API requires glossaries to be uploaded to Google Cloud Storage. If you intend to use glossaries, you need to create a storage bucket.
- Cloud Storage → Buckets → Create bucket (default settings are fine).
**Note:** your glossaries needs to be in [unidirectional format](https://cloud.google.com/translate/docs/advanced/glossary#unidirectional_glossaries). Equivalent term sets are not supported.
### 4. Service Account
- Create a service account (IAM & Admin → Service Accounts → Create service account).
- Add the following roles: Cloud Translation API Editor (`roles/cloudtranslate.editor`) and Storage Admin (`roles/storage.admin`).
### 5. Authentication Key
- Click on your service account and navigate to the Keys tab.
- Add key → Create new key → JSON.
- Download the JSON key file and save it as `service-account.json`.
- Place your service account key in your working directory (where you launch `gtai`).
## Usage
```bash
bunx gtai@latest
```
Follow the interactive prompts to configure your translation settings and start translating.