@sonenta/cli 0.3.0 → 0.3.1
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/README.md +26 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @sonenta/cli
|
|
2
2
|
|
|
3
|
-
Command-line interface for [
|
|
3
|
+
Command-line interface for [Sonenta](https://sonenta.com) translation
|
|
4
4
|
management. Sits next to the API and the React SDK; calls into the public
|
|
5
|
-
HTTP surface using a
|
|
5
|
+
HTTP surface using a Sonenta API key.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g @
|
|
10
|
+
npm install -g @sonenta/cli
|
|
11
11
|
# or
|
|
12
|
-
npx @
|
|
12
|
+
npx @sonenta/cli --help
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
# 1. Authenticate (the key must carry the `mcp:*` scope — see Auth below)
|
|
19
|
-
|
|
19
|
+
sonenta login --host https://api.sonenta.com --token vrb_live_<prefix>.<secret>
|
|
20
20
|
|
|
21
21
|
# 2. Bind the current directory to a project
|
|
22
|
-
|
|
22
|
+
sonenta init --project 069fc15d-… --version main
|
|
23
23
|
|
|
24
24
|
# 3. Import an i18next file in one shot
|
|
25
|
-
|
|
25
|
+
sonenta import locales/fr/common.json
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Configuration
|
|
29
29
|
|
|
30
30
|
Two files are involved:
|
|
31
31
|
|
|
32
|
-
- **`
|
|
32
|
+
- **`sonenta.config.json`** — per-project, committed to the repo.
|
|
33
33
|
Contains the host + project_uuid + version_slug. Any command resolves
|
|
34
34
|
it by walking up from the current directory.
|
|
35
35
|
|
|
36
|
-
- **`~/.
|
|
36
|
+
- **`~/.sonenta/credentials`** — per-user, never committed.
|
|
37
37
|
JSON file with mode `0600` keyed by host so the same user can hold
|
|
38
|
-
credentials for multiple
|
|
38
|
+
credentials for multiple Sonenta deployments simultaneously
|
|
39
39
|
(e.g. cloud + local dev + self-hosted prod). The currently active
|
|
40
40
|
host is recorded as `default`.
|
|
41
41
|
|
|
@@ -43,10 +43,10 @@ The credentials file shape:
|
|
|
43
43
|
|
|
44
44
|
```json
|
|
45
45
|
{
|
|
46
|
-
"default": "https://api.
|
|
46
|
+
"default": "https://api.sonenta.com",
|
|
47
47
|
"hosts": {
|
|
48
|
-
"https://api.
|
|
49
|
-
"https://api.dev.
|
|
48
|
+
"https://api.sonenta.com": { "api_key": "vrb_live_…", "user_email": "…" },
|
|
49
|
+
"https://api.dev.sonenta.ca": { "api_key": "vrb_live_…" }
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
```
|
|
@@ -61,7 +61,7 @@ scope (see [Auth](#auth)).
|
|
|
61
61
|
|--------------------|-------------------------------------------------------------------------|
|
|
62
62
|
| `login` / `logout` | Store / remove an API key for a host |
|
|
63
63
|
| `whoami` | Show the active host + masked key |
|
|
64
|
-
| `init` | Scaffold `
|
|
64
|
+
| `init` | Scaffold `sonenta.config.json` in the current dir |
|
|
65
65
|
| `projects list` | List projects the key can reach |
|
|
66
66
|
| `keys list` | List keys (`namespace_slug/key_name`) |
|
|
67
67
|
| `import <files…>` | One-shot import of i18next JSON (nested or flat) — creates keys + upserts translations |
|
|
@@ -70,7 +70,7 @@ scope (see [Auth](#auth)).
|
|
|
70
70
|
| `export` | Export translations as i18next JSON (flat, or `--nested`) |
|
|
71
71
|
| `status` | Diff local `locales/` against the remote project |
|
|
72
72
|
| `releases publish` | Trigger a CDN release (publish bundles) |
|
|
73
|
-
| `snapshot` | Emit a build-time `initialBundles` module for `@
|
|
73
|
+
| `snapshot` | Emit a build-time `initialBundles` module for `@sonenta/react-i18next` |
|
|
74
74
|
| `missing` | List runtime-detected missing keys |
|
|
75
75
|
|
|
76
76
|
Mutating commands accept `--dry-run` and print a `created / updated / unchanged`
|
|
@@ -80,21 +80,21 @@ summary.
|
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
# import an i18next file (language + namespace inferred from the path)
|
|
83
|
-
|
|
83
|
+
sonenta import locales/fr/common.json
|
|
84
84
|
# …or a bare file with an explicit namespace
|
|
85
|
-
|
|
85
|
+
sonenta import --namespace common fr.json
|
|
86
86
|
|
|
87
87
|
# preview, then push the whole locales/ tree in ONE call
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
sonenta push --dry-run
|
|
89
|
+
sonenta push
|
|
90
90
|
|
|
91
91
|
# pull remote translations back to disk; diff before committing
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
sonenta pull --language fr
|
|
93
|
+
sonenta status
|
|
94
94
|
|
|
95
95
|
# publish to the CDN; generate a build-time SDK fallback bundle
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
sonenta releases publish
|
|
97
|
+
sonenta snapshot --out src/sonenta-bundles.ts
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
## Auth
|
|
@@ -102,8 +102,8 @@ verbumia snapshot --out src/verbumia-bundles.ts
|
|
|
102
102
|
Every call emits `Authorization: ApiKey <prefix>.<secret>` (capital A, lowercase
|
|
103
103
|
k) against the MCP surface, so the API key must carry the **`mcp:*`** scope.
|
|
104
104
|
Generate one in the dashboard at *Org Settings → API Keys*. The key is supplied
|
|
105
|
-
by you — via `
|
|
106
|
-
`~/.
|
|
105
|
+
by you — via `sonenta login`, the `SONENTA_TOKEN` env var (handy for CI), or
|
|
106
|
+
`~/.sonenta/credentials` — and is never hard-coded.
|
|
107
107
|
|
|
108
108
|
> **0.2.0 migration (breaking):** the whole CLI moved from the project REST
|
|
109
109
|
> surface (`/v1/projects/…`, project-scoped keys) to the MCP surface
|