SoluCLI Command-Line Tool
SoluCLI is Soluling's cross-platform command-line tool for moving files to and from the Soluling cloud - built for CI/CD pipelines, but just as usable from a terminal. It talks only to the backend REST API, so it runs anywhere Node.js does: Windows, Linux, and macOS.
Mostly, that means pushing the resource files you want localized - .resx,
.json, .xml, .html, and so on - into a cloud project, and
pulling the localized versions back once they're built. project create-source
creates the project itself from that first resource file, no .ntp needed - from
there, project add-source and project update-source push further
files into it. SoluCLI can also work with a project's whole .ntp file instead - the
same file the desktop application works with - which is mainly useful for keeping the cloud copy
in sync with your desktop one.
SoluCLI is not the same tool as SoluMake, Soluling's Windows-only build automation tool. SoluMake scans and builds your project locally, on your own machine, and sends only strings to the cloud. SoluCLI instead pushes files to the cloud and lets the cloud do the scanning and building - the same API-based workflow described on the Cloud Tools page, wrapped in a CLI so you don't have to write the HTTP calls yourself. If your build server runs Windows and you'd rather keep your source files off the cloud entirely, use SoluMake instead.
Install
SoluCLI is published as a single npm package with no platform-specific binaries - the same install command works on every platform:
npm install -g @soluling/solucli
This requires Node.js 18 or later. Once
installed, the solucli command is available globally.
Authenticate
Every command needs your Soluling credentials. Give them as options, or set them once as environment variables - handy for a CI/CD job where you don't want credentials on the command line:
| Option | Short | Environment variable |
|---|---|---|
--user |
-u |
SOLULING_USER |
--password |
-p |
SOLULING_PASSWORD |
--url |
-r |
SOLULING_URL |
--url defaults to https://www.soluling.com/api - you only need to set
it when pointing at a self-hosted or non-production instance.
If --user or --password is missing and running in an interactive
terminal, SoluCLI prompts for it instead - password input is masked as you type. In a
non-interactive context, such as a CI/CD job, there's nobody to answer a prompt, so it fails
immediately with the usual missing-option error rather than hanging.
Behind the scenes, SoluCLI signs in with a JWT access token the same way the
Translate web app does, and refreshes it automatically
before it expires - you never need to handle tokens yourself. The artifact
commands below don't need credentials at all.
Commands
Language lists (--languages, --target-languages) are
semicolon-separated, e.g. fi;sv - quote them ("fi;sv") in PowerShell
or a POSIX shell, since an unquoted ; there ends the command instead of being
passed through as part of the value.
project create-source - creates a new project by uploading a single resource file
as its first source:
solucli project create-source ./src/messages.json --original-language en --target-languages "fi;sv"
project create-empty - creates a new project with no file at all; push sources
into it afterwards with project add-source:
solucli project create-empty "My Project" --original-language en --target-languages "fi;sv"
project add-source - adds a resource file to a project as a new source, and
project update-source replaces an existing one's content:
solucli project add-source 123 ./src/messages.json solucli project update-source 123 messages.json ./src/messages.json
project sources lists a project's source files, and project remove-source
removes one:
solucli project sources 123 solucli project remove-source 123 messages.json
project add-language adds a language to translate into, and
project build queues a build of the project's localized files:
solucli project add-language 123 fi solucli project build 123 --languages "fi;sv" --publish
project download-source - downloads a source's built localized file for one
language. If the project has unpushed changes, it automatically builds and waits for that
first, so there's no separate project build step to remember - pass
--skip-build to download whatever's already built instead, even if it's stale:
solucli project download-source 123 messages.json fi ./out/messages.fi.json
For pushing or pulling a project's whole .ntp file instead - typically just for
initial setup - project create, project update, and
project download work the same way:
solucli project create MyProject.ntp --account myaccount --name "My Project" solucli project update 123 MyProject.ntp solucli project download 123 ./MyProject.ntp --timeout 1800
artifact languages and artifact get - list and download a project's
published build artifacts (the localized files themselves), without signing in at all:
solucli artifact languages <project-guid> solucli artifact get <project-guid> messages.fi.json ./out/messages.fi.json
Run solucli <command> --help for the full option list of any command.
Example: CI/CD pipeline
A typical build step pushes the latest version of a resource file, triggers a build, and pulls the localized file back into the build output:
export SOLULING_USER=<your-username> export SOLULING_PASSWORD=<your-password> solucli project update-source 123 messages.json ./src/messages.json solucli project build 123 --publish solucli project download-source 123 messages.json fi ./out/messages.fi.json
See Workflows for how this fits alongside the desktop application and the web apps in a larger localization setup.