Skip to content

@sonenta/cli

CLI · npm · MIT

A small, scriptable command line for everything you'd otherwise click through the dashboard: import an existing i18next project, push and pull translations, diff CI against the remote, publish a CDN release, and snapshot bundles for an offline-first build. MIT, on npm.

npm only, there is no Homebrew formula for the CLI. Requires Node 18 or newer, and installs the sonenta command.

Fenêtre de terminal
# install once, globally
npm i -g @sonenta/cli
# or run without installing
npx @sonenta/cli <command>

Every call sends Authorization: ApiKey <prefix>.<secret> with the mcp:* scope. Log in once to store the key in ~/.sonenta/credentials, or set SONENTA_TOKEN in CI.

Fenêtre de terminal
# interactive: stores the key per host in ~/.sonenta/credentials (0600)
sonenta login --host https://api.sonenta.com
API key: snt_live_••••••••.••••••••••••••••
saved for https://api.sonenta.com
# CI: no prompt, key read from the environment
export SONENTA_TOKEN=snt_live_<prefix>.<secret>
sonenta push

sonenta init writes a sonenta.config.json in your repo (resolved by walking up from the working directory). Credentials live separately, per user, and are never committed.

// sonenta.config.json, committed to your repo, no secrets here
{
"host": "https://api.sonenta.com",
"project_uuid": "<project_uuid>",
"version_slug": "main"
}
// ~/.sonenta/credentials, mode 0600, per user, never commit
{ "default": "https://api.sonenta.com",
"hosts": {
"https://api.sonenta.com": { "api_key": "snt_live_..." }
} }

Grouped by what you're doing, set up auth and config, inspect a project, or sync translations. Every command runs against the MCP surface and respects sonenta.config.json.

Store an API key for a host.

FlagDescription
--host <url>API host to authenticate against.
--token <key>Pass the key non-interactively instead of the prompt.
Fenêtre de terminal
sonenta login --host https://api.sonenta.com

Remove stored credentials for a host. No flags.

Fenêtre de terminal
sonenta logout

Show the active host and a masked key. No flags.

Fenêtre de terminal
sonenta whoami

Scaffold sonenta.config.json for a project.

FlagDescription
--project <uuid>Project UUID to write into the config (required).
--version <slug>Version slug to target (defaults to main).
--forceOverwrite an existing config file.
Fenêtre de terminal
sonenta init --project <uuid> --version main

List the projects your key can reach. No flags.

Fenêtre de terminal
sonenta projects list

List keys as namespace_slug/key_name.

FlagDescription
--namespace <slug>Restrict to one namespace.
Fenêtre de terminal
sonenta keys list --namespace common

Diff your local locales/ against the remote.

FlagDescription
--language <code>Limit the diff to one language.
--namespace <slug>Limit the diff to one namespace.
--src <dir>Source directory (defaults to locales).
Fenêtre de terminal
sonenta status

List runtime-detected missing keys.

FlagDescription
--language <code>Filter by language.
--namespace <slug>Filter by namespace.
--limit <n>Cap the number of rows.
Fenêtre de terminal
sonenta missing --limit 50

One-shot i18next import, nested or flat; creates keys, upserts translations, idempotent.

FlagDescription
--dry-runPreview only; sends nothing.
--status <draft|translated>Incoming status (default translated).
--language <code>Force the language instead of inferring it from the path.
--namespace <slug>Force the namespace (required for a bare <lang>.json).
--version <slug>Target a non-default version.
Fenêtre de terminal
sonenta import locales/fr/common.json

Push the whole local locales/ tree in one import call.

FlagDescription
--src <dir>Source directory (defaults to locales).
--dry-runPreview only; sends nothing.
--status <state>Incoming status (default translated).
Fenêtre de terminal
sonenta push --dry-run

Write remote translations to locales/<lang>/<namespace>.json (flat).

FlagDescription
--language <code>Limit to one language.
--namespace <slug>Limit to one namespace.
--dest <dir>Destination directory (defaults to locales).
Fenêtre de terminal
sonenta pull --language fr

Export as i18next JSON, flat by default, --nested for trees.

FlagDescription
--nestedEmit nested trees instead of flat keys.
--out <dir>Write files to a directory instead of stdout.
Fenêtre de terminal
sonenta export --nested --out ./dump

Trigger a CDN release: the published bundle becomes the production version.

FlagDescription
--version <slug>Version to publish (defaults to main).
--dry-runPreview only; publishes nothing.
Fenêtre de terminal
sonenta releases publish

Fetch the public CDN bundles into a build-time module for offline-first SDK fallback.

FlagDescription
--format <ts|json>Output format: ts (default) or json.
--out <file>Write to a file instead of stdout.
--cdn <base>CDN base (defaults to https://cdn.sonenta.com).
Fenêtre de terminal
sonenta snapshot --out src/sonenta-bundles.ts

Every command, with all its flags and examples: see the full CLI reference.