@sonenta/cli 0.3.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Verbumia
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,115 @@
1
+ # @verbumia/cli
2
+
3
+ Command-line interface for [Verbumia](https://verbumia.ca) translation
4
+ management. Sits next to the API and the React SDK; calls into the public
5
+ HTTP surface using a Verbumia API key.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @verbumia/cli
11
+ # or
12
+ npx @verbumia/cli --help
13
+ ```
14
+
15
+ ## Quick start
16
+
17
+ ```bash
18
+ # 1. Authenticate (the key must carry the `mcp:*` scope — see Auth below)
19
+ verbumia login --host https://api.verbumia.dev --token vrb_live_<prefix>.<secret>
20
+
21
+ # 2. Bind the current directory to a project
22
+ verbumia init --project 069fc15d-… --version main
23
+
24
+ # 3. Import an i18next file in one shot
25
+ verbumia import locales/fr/common.json
26
+ ```
27
+
28
+ ## Configuration
29
+
30
+ Two files are involved:
31
+
32
+ - **`verbumia.config.json`** — per-project, committed to the repo.
33
+ Contains the host + project_uuid + version_slug. Any command resolves
34
+ it by walking up from the current directory.
35
+
36
+ - **`~/.verbumia/credentials`** — per-user, never committed.
37
+ JSON file with mode `0600` keyed by host so the same user can hold
38
+ credentials for multiple Verbumia deployments simultaneously
39
+ (e.g. cloud + local dev + self-hosted prod). The currently active
40
+ host is recorded as `default`.
41
+
42
+ The credentials file shape:
43
+
44
+ ```json
45
+ {
46
+ "default": "https://api.verbumia.dev",
47
+ "hosts": {
48
+ "https://api.verbumia.dev": { "api_key": "vrb_live_…", "user_email": "…" },
49
+ "https://api.dev.verbumia.ca": { "api_key": "vrb_live_…" }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Commands
55
+
56
+ All project commands talk to the metered MCP surface
57
+ (`/v1/mcp/projects/{id}/…`) and require an API key carrying the **`mcp:*`**
58
+ scope (see [Auth](#auth)).
59
+
60
+ | Command | Purpose |
61
+ |--------------------|-------------------------------------------------------------------------|
62
+ | `login` / `logout` | Store / remove an API key for a host |
63
+ | `whoami` | Show the active host + masked key |
64
+ | `init` | Scaffold `verbumia.config.json` in the current dir |
65
+ | `projects list` | List projects the key can reach |
66
+ | `keys list` | List keys (`namespace_slug/key_name`) |
67
+ | `import <files…>` | One-shot import of i18next JSON (nested or flat) — creates keys + upserts translations |
68
+ | `push` | Push the whole local `locales/` tree in one import call |
69
+ | `pull` | Pull translations into `locales/<lang>/<namespace>.json` |
70
+ | `export` | Export translations as i18next JSON (flat, or `--nested`) |
71
+ | `status` | Diff local `locales/` against the remote project |
72
+ | `releases publish` | Trigger a CDN release (publish bundles) |
73
+ | `snapshot` | Emit a build-time `initialBundles` module for `@verbumia/react-i18next` |
74
+ | `missing` | List runtime-detected missing keys |
75
+
76
+ Mutating commands accept `--dry-run` and print a `created / updated / unchanged`
77
+ summary.
78
+
79
+ ### Sync workflow
80
+
81
+ ```bash
82
+ # import an i18next file (language + namespace inferred from the path)
83
+ verbumia import locales/fr/common.json
84
+ # …or a bare file with an explicit namespace
85
+ verbumia import --namespace common fr.json
86
+
87
+ # preview, then push the whole locales/ tree in ONE call
88
+ verbumia push --dry-run
89
+ verbumia push
90
+
91
+ # pull remote translations back to disk; diff before committing
92
+ verbumia pull --language fr
93
+ verbumia status
94
+
95
+ # publish to the CDN; generate a build-time SDK fallback bundle
96
+ verbumia releases publish
97
+ verbumia snapshot --out src/verbumia-bundles.ts
98
+ ```
99
+
100
+ ## Auth
101
+
102
+ Every call emits `Authorization: ApiKey <prefix>.<secret>` (capital A, lowercase
103
+ k) against the MCP surface, so the API key must carry the **`mcp:*`** scope.
104
+ Generate one in the dashboard at *Org Settings → API Keys*. The key is supplied
105
+ by you — via `verbumia login`, the `VERBUMIA_TOKEN` env var (handy for CI), or
106
+ `~/.verbumia/credentials` — and is never hard-coded.
107
+
108
+ > **0.2.0 migration (breaking):** the whole CLI moved from the project REST
109
+ > surface (`/v1/projects/…`, project-scoped keys) to the MCP surface
110
+ > (`/v1/mcp/projects/…`). Re-issue your CLI key with the `mcp:*` scope —
111
+ > project-scoped keys now return `403`.
112
+
113
+ ## License
114
+
115
+ MIT
package/bin/sonenta.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import("../dist/index.js").catch((err) => {
3
+ console.error(err);
4
+ process.exit(1);
5
+ });
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ // Deprecated alias for `sonenta` — kept functional (deprecate-not-remove).
3
+ // Synchronous stderr write so the notice shows even on fast-exit commands
4
+ // like --version (process.exit drops queued process.emitWarning output).
5
+ console.error(
6
+ "[deprecated] `verbumia` is now `sonenta`. This alias still works but will be removed in a future major.",
7
+ );
8
+ import("../dist/index.js").catch((err) => {
9
+ console.error(err);
10
+ process.exit(1);
11
+ });
@@ -0,0 +1,2 @@
1
+
2
+ export { }