Skip to content

DmitriyKost/janus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

janus

A tiny CLI translator. Translates between English and Russian using one of two pluggable providers.

Build

go build -o janus ./cmd

Usage

janus hello                      # → привет   (default provider: lara)
janus --provider=mymemory hello  # use MyMemory instead
janus привет                     # direction is auto-detected from the input

The first letter decides direction: Latin → en→ru, otherwise ru→en.

Providers

Name Auth Notes
lara required (account access keys) Default. Uses the official Lara Go SDK.
mymemory optional (anonymous works) HTTP only.

Configuration

All configuration is via environment variables.

Variable Used by Required Purpose
JANUS_PROVIDER janus no Default provider when --provider isn't passed.
LARA_ACCESS_KEY_ID lara yes Lara access key ID.
LARA_ACCESS_KEY_SECRET lara yes Lara access key secret.
MYMEMORY_BASE_URL mymemory no Override API endpoint (defaults to the public service).
MYMEMORY_API_KEY mymemory no Authenticate the request; empty = anonymous.

Precedence for provider selection: --provider flag > JANUS_PROVIDER env > compiled-in default (lara).

Credentials are loaded lazily — picking mymemory does not require Lara keys to be set, and vice versa.

Layout

cmd/            # CLI entry: flags, wiring, exit codes
internal/
  translate/    # Translator interface
  lara/         # Lara provider (SDK-backed)
  mymemory/     # MyMemory provider (HTTP)
  config/       # env-based config loaders

Adding a provider: implement translate.Translator in a new package and add a case to newTranslator in cmd/main.go.

About

'en|ru' and vise-versa CLI translate tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages