GithubHelp home page GithubHelp logo

yaku-cli's Introduction

yaku-cli

Yet another small tool to translate texts from your command line using DeepL API (and other services such as OpenAI Chat Completion)

Yaku means "translation" in Japanese (or it could mean a yak of course).

Prerequisites

This is not a scraping tool. You need a proper DeepL API auth key or an OpenAI API key to use this tool.

You can sign up and get a DeepL API auth key here. (I'm not involved in DeepL in any way)

DISCLAIMER: YOU MIGHT BE BILLED THAN YOU ARE EXPECTED. READ THE LICENSE AND UNDERSTAND THAT THISE SOFTWARE COMES WITHOUT WARRANTY OF ANY KIND BEFORE YOU USE IT.

Installation

go install github.com/goura/yaku-cli/cmd/yaku@latest

yaku will be installed under your GOBIN (go env GOBIN if you want the path).

Usage

DeepL

% export YAKU_DEEPL_AUTH_KEY="<YOUR_DEEPL_API_KEY>"

% echo "おはよう!" | yaku -s ja -t id
Pagi!

OpenAI (much experimental)

% export YAKU_OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"

% echo "Saya tidak mau bekerja, tapi saya mau uang" | yaku -e openai -s id -t ja
私は働きたくないですが、お金が欲しいです。

For source and target languages we internally use golang.org/x/text/language so that we can take BCP 47 language tags such as en-US or just a language tag such as en or ja. We convert those to DeepL's language codes internally.

For OpenAI's Chat Completion, we don't know which language they are capable of, so we just pass the language tag to OpenAI's Chat Completion API (gpt-3.5-turbo).

License & disclaimer

See LICENSE

yaku-cli's People

Contributors

goura avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.