@radicalstorage-lingo/cli
v0.3.1
Published
Lingo CLI — pull/push translations as JSON at build time.
Maintainers
Readme
@radicalstorage-lingo/cli
Pulls/pushes translations as JSON at build time. Authenticates with a Lingo
API key (LINGO_API_KEY env, or stored locally by lingo login). The
published binary is a self-contained bundle — no postinstall, no native
deps.
Install
npm i -D @radicalstorage-lingo/cli
# or run without installing:
npx lingo --helpQuick start
npx lingo init --project <id-or-slug>
npx lingo login --api-key lgo_live_xxxxx
npx lingo pulllingo.config.json
{
"projectId": "prj_xxxxx",
"apiUrl": "http://localhost:3000",
"languages": [],
"format": "json-nested",
"outDir": "messages",
"typesOut": ".lingo/types.ts",
"pull": "translated"
}projectId— the project's id or its slug. Leave it blank in a fresh config andlingo loginwill fill it in automatically, as long as the key can only see one project.languages— which languagespull/push/status/diffoperate on. An empty array (the default fromlingo init) or omitting the key means every language in the project. A non-empty list restricts every command to just those languages.format—json-nested(default) orjson-flat.pull— which valueslingo pullwrites into the bundle:translated(default) — every value with real text, regardless of status. Machine-translated copy ships immediately as draft text that's safe to use right away.approved— only values that have cleared review.all— deprecated alias fortranslated.
Untranslated (missing, empty) values are never written — a key is either pulled with real text or omitted entirely.
Commands
| Command | What it does |
| --- | --- |
| lingo init [--project <id-or-slug>] [--api-url <url>] [--out <dir>] [-y, --yes] | lingo init is an interactive wizard; lingo init --yes (or a non-TTY shell) is non-interactive and writes from flags + defaults. |
| lingo login [--api-key <key>] | Store the key in ~/.lingo/credentials.json. If the config's projectId is blank, fills it in from the key's own project. |
| lingo pull [--out <dir>] | Download translations → messages/{lang}.json + generate .lingo/types.ts. --out overrides outDir from the config for that run. |
| lingo push [-y, --yes] | Upload changed local values to existing keys (preview unless --yes). |
| lingo status | Summarize local vs remote drift per language. |
| lingo diff | Per-key drift (added / changed / removed). |
Auth
lingo login --api-key lgo_live_xxxxx # interactive / local
LINGO_API_KEY=lgo_live_xxxxx lingo pull # CINotes
pushonly updates values for keys that already exist remotely; create new keys in the app first (it warns and skips unknown keys).statusis read-only and safe as a CI guard.
License
MIT
