linguistic-terminal

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: AGPL-3.0

README

ling

Translate text from the terminal. No API key, no config file, no account.

$ ling de en "hallo welt!"
Hello World!

$ ling a japanese "good morning"
おはよう

$ cat notes.md | ling a en > notes.en.md

Install

curl -fsSL https://raw.githubusercontent.com/iamlumi-dev/linguistic-terminal/main/install.sh | sh

Grabs the prebuilt binary for your platform (Linux and macOS, x86-64 and arm64), verifies its checksum and drops it in ~/.local/bin. Set LING_BINDIR to put it somewhere else. Uninstalling is rm $(which ling) — nothing else is written.

Other ways

Arch / CachyOS — from the included PKGBUILD:

git clone https://github.com/iamlumi-dev/linguistic-terminal
cd linguistic-terminal && makepkg -si

With Go (≥1.26):

go install github.com/iamlumi-dev/linguistic-terminal/cmd/ling@latest

From source:

git clone https://github.com/iamlumi-dev/linguistic-terminal
cd linguistic-terminal && make install     # PREFIX=/usr/local sudo make install

Usage

ling <from> <to> [text...]
<command> | ling <from> <to>

<from> and <to> take a short code or a full name, in English or German — de, german and deutsch all mean the same thing. As <from>, a (or auto) turns on language detection. <to> has to be explicit.

ling de en "hallo welt"              # hello world
ling a japanese "guten morgen"       # おはよう
ling deutsch englisch "wie geht's?"  # how are you?
ling a en hallo welt                 # quotes are optional

With no text argument, ling reads stdin. The translation goes to stdout and everything else to stderr, so it pipes like any other Unix tool:

git log -1 --format=%B | ling a en
ling a en < report.de.txt > report.en.txt

Input over ~3500 bytes is split at paragraph, sentence or word boundaries and translated in sequence, so whole files go through in one call.

Options
Flag Effect
-d, --detect print the detected source language to stderr
-l, --languages list the supported languages
-h, --help show help
-V, --version show version

Put text that starts with a dash after --: ling en de -- "--foo".

Exit codes: 0 success, 1 error (unknown language, network), 2 bad usage.

Typos get a suggestion instead of a shrug:

$ ling de englsh "test"
ling: target language: unknown language "englsh" — did you mean "English"?
       run 'ling --languages' for the full list

How it translates

Through the open translate.googleapis.com/translate_a/single endpoint — the one the Google Translate web UI uses. No key, no signup. It is unofficial, so Google could change it at any time; all of that lives in cmd/ling/translate.go, and swapping in DeepL or an LLM would touch that one file.

Nothing is stored or logged locally. The text you pass is sent to Google, which is worth knowing before you pipe anything confidential through it.

Development

make test    # language resolution, chunking, response parsing — all offline
make build

License

AGPL-3.0-or-later. If you modify ling and let others use it over a network, they get the right to your modified source.

Directories

Path Synopsis
cmd
ling command
ling translates text from the terminal.
ling translates text from the terminal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL