{"id":22495976,"url":"https://github.com/eeeXun/gtt","last_synced_at":"2025-08-03T03:31:31.490Z","repository":{"id":61991120,"uuid":"556831320","full_name":"eeeXun/gtt","owner":"eeeXun","description":"Google Translate TUI (Originally). Currently supports Apertium, Bing, ChatGPT, DeepL, DeepLX, Google, LibreTranslate, Reverso.","archived":false,"fork":false,"pushed_at":"2024-09-27T16:52:52.000Z","size":4369,"stargazers_count":251,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-03T01:35:39.795Z","etag":null,"topics":["apertium","bing","chatgpt","deepl","deeplx","google","libretranslate","reverso","translator","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eeeXun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-24T15:41:41.000Z","updated_at":"2024-11-10T02:12:58.000Z","dependencies_parsed_at":"2024-01-08T21:15:04.399Z","dependency_job_id":"154d19c2-16e1-4708-92e7-dc6881e417d6","html_url":"https://github.com/eeeXun/gtt","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeeXun%2Fgtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeeXun%2Fgtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeeXun%2Fgtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeeXun%2Fgtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eeeXun","download_url":"https://codeload.github.com/eeeXun/gtt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228519288,"owners_count":17932407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apertium","bing","chatgpt","deepl","deeplx","google","libretranslate","reverso","translator","tui"],"created_at":"2024-12-06T20:01:54.530Z","updated_at":"2024-12-06T20:04:01.504Z","avatar_url":"https://github.com/eeeXun.png","language":"Go","funding_links":[],"categories":["Go","\u003ca name=\"productivity\"\u003e\u003c/a\u003eProductivity"],"sub_categories":[],"readme":"# gtt\n\nGoogle Translate TUI (Originally)\n\nSupported Translator:\n[`Apertium`](https://www.apertium.org/),\n[`Bing`](https://www.bing.com/translator),\n[`ChatGPT`](https://chat.openai.com/),\n[`DeepL`](https://deepl.com/translator)(only free API),\n[`DeepLX`](https://github.com/OwO-Network/DeepLX),\n[`Google`](https://translate.google.com/)(default),\n[`Libre`](https://libretranslate.com/),\n[`Reverso`](https://www.reverso.net/text-translation)\n\n## ScreenShot\n\n![screenshot](https://github.com/eeeXun/gtt/assets/58657914/3841c2bf-62f7-434a-9e77-91c3748c5675)\n\n## ⚠️ Note for ChatGPT and DeepL\n\nChatGPT and DeepL translations require API keys, which can be obtained from\n[OpenAI API keys](https://platform.openai.com/account/api-keys) and\n[DeepL API signup](https://www.deepl.com/pro-api) pages, respectively. Note\nthat only the free API is supported for DeepL currently. Once you have your\nAPI key add it to `$XDG_CONFIG_HOME/gtt/server.yaml` or `$HOME/.config/gtt/server.yaml`.\nSee the example in [server.yaml](example/server.yaml) file.\n\n```yaml\napi_key:\n  chatgpt:\n    value: CHATGPT_API_KEY # \u003c- Replace with your API Key\n    # file: $HOME/secrets/chatgpt.txt # \u003c- You can also specify the file where to read API Key\n  deepl:\n    value: DEEPL_API_KEY # \u003c- Replace with your API Key\n    # file: $HOME/secrets/deepl.txt # \u003c- You can also specify the file where to read API Key\n```\n\n## DeepLX\n\nDeepLX is [self-hosted server](https://github.com/OwO-Network/DeepLX).\nYou must provide IP address and port at\n`$XDG_CONFIG_HOME/gtt/server.yaml` or `$HOME/.config/gtt/server.yaml`.\nThe api key for DeepLX is optional, depending on your setting.\nSee the example in [server.yaml](example/server.yaml) file.\n\n```yaml\napi_key:\n  deeplx:\n    value: DEEPLX_API_KEY # \u003c- Replace with your TOKEN\n    # file: $HOME/secrets/deeplx.txt # \u003c- You can also specify the file where to read API Key\nhost:\n  deeplx: 127.0.0.1:1188 # \u003c- Replace with your server IP address and port\n```\n\n## Libre\n\nIf you want to use official [LibreTranslate](https://libretranslate.com/), you have to obtain an API Key on their [website](https://portal.libretranslate.com/).\nAlternatively, if you want to host it by yourself, you must provide the IP address and port.\nMake sure add them to `$XDG_CONFIG_HOME/gtt/server.yaml` or `$HOME/.config/gtt/server.yaml`.\nSee the example in [server.yaml](example/server.yaml) file.\n\n```yaml\napi_key:\n  libre:\n    value: LIBRE_API_KEY # \u003c- Replace with your API Key\n    # file: $HOME/secrets/libre.txt # \u003c- You can also specify the file where to read API Key\nhost:\n  libre: 127.0.0.1:5000 # \u003c- Replace with your server IP address and port\n```\n\n## Install\n\n### Dependencies\n\nFor Arch Linux, you need `alsa-lib`.\nFor Ubuntu or Debian, you need `libasound2-dev`.\nFor RedHat-based Linux, you need `alsa-lib-devel`.\n\n[`xclip`](https://github.com/astrand/xclip) (optional) - for Linux/X11 to copy text.\n\n[`wl-clipboard`](https://github.com/bugaevc/wl-clipboard) (optional) - for Linux/Wayland to copy text.\n\nOr, if your terminal supports OSC 52, you can enable OSC 52 in page 2 of the pop out menu to copy text.\n\n### Arch Linux ([AUR](https://aur.archlinux.org/packages/gtt-bin))\n\n```sh\nyay -S gtt-bin\n```\n\n### Nix ❄️ ([nixpkgs-unstable](https://search.nixos.org/packages?channel=unstable\u0026show=gtt\u0026from=0\u0026size=50\u0026sort=relevance\u0026type=packages\u0026query=gtt))\n\nadd to your package list or run with:\n\n```sh\nnix-shell -p '(import \u003cnixpkgs-unstable\u003e {}).gtt' --run gtt\n```\n\nor with flakes enabled:\n\n```sh\nnix run github:nixos/nixpkgs#gtt\n```\n\n### Prebuild\n\nBinary file is available in [Release Page](https://github.com/eeeXun/gtt/releases) for Linux and macOS on x86_64.\n\n### From source\n\n#### go install\n\n```sh\ngo install -ldflags=\"-s -w\" github.com/eeeXun/gtt@latest\n```\n\nAnd make sure `$HOME/go/bin` is in your `$PATH`\n\n```sh\nexport PATH=$PATH:$HOME/go/bin\n```\n\n#### go build\n\n```sh\ngit clone https://github.com/eeeXun/gtt.git \u0026\u0026 cd gtt \u0026\u0026 go build -ldflags=\"-s -w -X main.version=$(git describe --tags)\"\n```\n\n### Run on Docker ([Docker Hub](https://hub.docker.com/r/eeexun/gtt/tags))\n\n```sh\ndocker run -it eeexun/gtt:latest\n```\n\n## Key Map\n\n`\u003cC-c\u003e`\nExit program.\n\n`\u003cEsc\u003e`\nToggle pop out menu.\n\n`\u003cC-j\u003e`\nTranslate from source to destination window.\n\n`\u003cC-s\u003e`\nSwap language.\n\n`\u003cC-q\u003e`\nClear all text in source of translation window.\n\n`\u003cC-y\u003e`\nCopy selected text.\n\n`\u003cC-g\u003e`\nCopy all text in source of translation window.\n\n`\u003cC-r\u003e`\nCopy all text in destination of translation window.\n\n`\u003cC-o\u003e`\nPlay text to speech on source of translation window.\n\n`\u003cC-p\u003e`\nPlay text to speech on destination of translation window.\n\n`\u003cC-x\u003e`\nStop playing text to speech.\n\n`\u003cC-t\u003e`\nToggle transparent.\n\n`\u003cC-\\\u003e`\nToggle Definition/Example \u0026 Part of speech.\n\n`\u003cTab\u003e`, `\u003cS-Tab\u003e`\nCycle through the pop out widget.\n\n`\u003c1\u003e`, `\u003c2\u003e`, `\u003c3\u003e`\nSwitch pop out menu.\n\n### Customize key map\n\nYou can overwrite the following key\n\n- `exit`: Exit program.\n- `translate`: Translate from source to destination window.\n- `swap_language`: Swap language.\n- `clear`: Clear all text in source of translation window.\n- `copy_selected`: Copy selected text.\n- `copy_source`: Copy all text in source of translation window.\n- `copy_destination`: Copy all text in destination of translation window.\n- `tts_source`: Play text to speech on source of translation window.\n- `tts_destination`: Play text to speech on destination of translation window.\n- `stop_tts`: Stop playing text to speech.\n- `toggle_transparent`: Toggle transparent.\n- `toggle_below`: Toggle Definition/Example \u0026 Part of speech.\n\nFor key to combine with `Ctrl`, the value can be `C-Space`, `C-\\`, `C-]`, `C-^`, `C-_` or `C-a` to `C-z`.\n\nFor key to combine with `Alt`, the value can be `A-Space` or `A-` with the character you want.\n\nOr you can use function key, the value can be `F1` to `F64`.\n\nSee the example in [keymap.yaml](example/keymap.yaml) file. This file should be located at `$XDG_CONFIG_HOME/gtt/keymap.yaml` or `$HOME/.config/gtt/keymap.yaml`.\n\n## Customize theme\n\nYou can create a theme with theme name. And you must provide the color of `bg`, `fg`, `gray`, `red`, `green`, `yellow`, `blue`, `purple`, `cyan`, `orange`.\n\nAnd note that:\n\n- `bg` is for background color\n- `fg` is for foreground color\n- `gray` is for selected color\n- `yellow` is for label color\n- `orange` is for KeyMap menu color\n- `purple` is for button pressed color\n\nSee the example in [theme.yaml](example/theme.yaml) file. This file should be located at `$XDG_CONFIG_HOME/gtt/theme.yaml` or `$HOME/.config/gtt/theme.yaml`.\n\n## Language in argument\n\nYou can pass `-src` and `-dst` in argument to set source and destination language.\n\n```sh\ngtt -src \"English\" -dst \"Chinese (Traditional)\"\n```\n\nSee available languages on:\n\n- [Apertium Translate](https://www.apertium.org/) for `Apertium`\n- [Bing language-support](https://learn.microsoft.com/en-us/azure/cognitive-services/translator/language-support#translation) for `Bing`\n- `ChatGPT` is same as `Google`. See [Google Language support](https://cloud.google.com/translate/docs/languages)\n- [DeepL API docs](https://www.deepl.com/docs-api/translate-text/) for `DeepL`\n- `DeepLX` is same as `DeepL`. See [DeepL API docs](https://cloud.google.com/translate/docs/languages)\n- [Google Language support](https://cloud.google.com/translate/docs/languages) for `Google`\n- [LibreTranslate Languages](https://libretranslate.com/languages) for `Libre`\n- [Reverso Translation](https://www.reverso.net/text-translation) for `Reverso`\n\n## Credit\n\n[soimort/translate-shell](https://github.com/soimort/translate-shell),\n[SimplyTranslate-Engines](https://codeberg.org/SimpleWeb/SimplyTranslate-Engines),\n[s0ftik3/reverso-api](https://github.com/s0ftik3/reverso-api)\nFor request method.\n\n[snsd0805/GoogleTranslate-TUI](https://github.com/snsd0805/GoogleTranslate-TUI) For inspiration.\n\n[turk/free-google-translate](https://github.com/turk/free-google-translate) For Google translate in Golang.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeeeXun%2Fgtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FeeeXun%2Fgtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeeeXun%2Fgtt/lists"}