The main goal of this project is to give fronted developers an easier way to use SimpleLocalize CLI in their workflows.
npm install @simplelocalize/cliThe package installs a small simplelocalize launcher into node_modules/.bin, so it's available for your
scripts in package.json. The launcher downloads the right SimpleLocalize CLI binary for your system
on first run (or during installation, when install scripts are allowed) and caches it per version.
{
"name": "My project",
"version": "1.0.0",
"private": true,
"dependencies": {
"@simplelocalize/cli": "^3.0.0"
},
"scripts": {
"start": "react-scripts start",
"sl:download": "simplelocalize download",
"sl:upload": "simplelocalize upload",
"sl:autotranslate": "simplelocalize auto-translate"
},
"simplelocalize": {
"cliVersion": "2.12.0"
}
}Learn more about SimpleLocalize CLI commands
You can also use npx to run SimpleLocalize CLI commands without installing the package
globally:
npx @simplelocalize/cli downloadThe npm package version is independent of the SimpleLocalize CLI version. The CLI version is resolved in this order:
SIMPLELOCALIZE_CLI_VERSIONenvironment variable, e.g.SIMPLELOCALIZE_CLI_VERSION=2.12.0 npx @simplelocalize/cli downloadsimplelocalize.cliVersionin the nearestpackage.jsonthat defines it (searched from the current directory upwards)- the default CLI version bundled with the installed package (
cliVersionin itspackage.json)
Use a full version, e.g. 2.12.0. See CLI releases for available versions.
We recommend pinning simplelocalize.cliVersion in your project, so every developer and CI run uses the same CLI.
Other environment variables:
SIMPLELOCALIZE_CLI_CACHE_DIR– where binaries are cached (default:~/.cache/simplelocalize/cli,%LOCALAPPDATA%\simplelocalize\clion Windows). Cache this directory in CI to skip downloads.SIMPLELOCALIZE_CLI_BINARY– path to an already installed CLI binary; skips the download entirely.
@simplelocalize/cli@2.x versions were tied to the CLI version (2.10.x installed CLI 2.10.0).
Since 3.0.0, pin the CLI version with simplelocalize.cliVersion instead. The launcher requires Node.js 18 or newer.