@radicalstorage-lingo/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +82 -0
- package/dist/cli.cjs +25505 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Amin Ahrabian
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# `@radicalstorage-lingo/cli`
|
|
2
|
+
|
|
3
|
+
Pulls/pushes translations as JSON at build time. Authenticates with a Lingo
|
|
4
|
+
API key (`LINGO_API_KEY` env, or stored locally by `lingo login`). The
|
|
5
|
+
published binary is a self-contained bundle — no `postinstall`, no native
|
|
6
|
+
deps.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i -D @radicalstorage-lingo/cli
|
|
12
|
+
# or run without installing:
|
|
13
|
+
npx lingo --help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx lingo init --project <id-or-slug>
|
|
20
|
+
npx lingo login --api-key lgo_live_xxxxx
|
|
21
|
+
npx lingo pull
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## `lingo.config.json`
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"projectId": "prj_xxxxx",
|
|
29
|
+
"apiUrl": "http://localhost:3000",
|
|
30
|
+
"languages": [],
|
|
31
|
+
"format": "json-nested",
|
|
32
|
+
"outDir": "messages",
|
|
33
|
+
"typesOut": ".lingo/types.ts",
|
|
34
|
+
"pull": "translated"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- `projectId` — the project's id **or its slug**. Leave it blank in a fresh
|
|
39
|
+
config and `lingo login` will fill it in automatically, as long as the key
|
|
40
|
+
can only see one project.
|
|
41
|
+
- `languages` — which languages `pull` / `push` / `status` / `diff` operate
|
|
42
|
+
on. An empty array (the default from `lingo init`) or omitting the key
|
|
43
|
+
means **every language in the project**. A non-empty list restricts every
|
|
44
|
+
command to just those languages.
|
|
45
|
+
- `format` — `json-nested` (default) or `json-flat`.
|
|
46
|
+
- `pull` — which values `lingo pull` writes into the bundle:
|
|
47
|
+
- `translated` (default) — every value with real text, regardless of
|
|
48
|
+
status. Machine-translated copy ships immediately as draft text that's
|
|
49
|
+
safe to use right away.
|
|
50
|
+
- `approved` — only values that have cleared review.
|
|
51
|
+
- `all` — deprecated alias for `translated`.
|
|
52
|
+
|
|
53
|
+
Untranslated (missing, empty) values are never written — a key is either
|
|
54
|
+
pulled with real text or omitted entirely.
|
|
55
|
+
|
|
56
|
+
## Commands
|
|
57
|
+
|
|
58
|
+
| Command | What it does |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `lingo init [--project <id-or-slug>] [--api-url <url>]` | Write a starter `lingo.config.json`. |
|
|
61
|
+
| `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. |
|
|
62
|
+
| `lingo pull` | Download translations → `messages/{lang}.json` + generate `.lingo/types.ts`. |
|
|
63
|
+
| `lingo push [-y, --yes]` | Upload changed local values to **existing** keys (preview unless `--yes`). |
|
|
64
|
+
| `lingo status` | Summarize local vs remote drift per language. |
|
|
65
|
+
| `lingo diff` | Per-key drift (added / changed / removed). |
|
|
66
|
+
|
|
67
|
+
## Auth
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
lingo login --api-key lgo_live_xxxxx # interactive / local
|
|
71
|
+
LINGO_API_KEY=lgo_live_xxxxx lingo pull # CI
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Notes
|
|
75
|
+
|
|
76
|
+
- `push` only updates values for keys that already exist remotely; create
|
|
77
|
+
new keys in the app first (it warns and skips unknown keys).
|
|
78
|
+
- `status` is read-only and safe as a CI guard.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|