A tiny CLI translator. Translates between English and Russian using one of two pluggable providers.
go build -o janus ./cmdjanus hello # → привет (default provider: lara)
janus --provider=mymemory hello # use MyMemory instead
janus привет # direction is auto-detected from the inputThe first letter decides direction: Latin → en→ru, otherwise ru→en.
| Name | Auth | Notes |
|---|---|---|
lara |
required (account access keys) | Default. Uses the official Lara Go SDK. |
mymemory |
optional (anonymous works) | HTTP only. |
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.
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.