The Localizely CLI is a command line tool that helps you sync localization files between your project and the Localizely platform.
Localizely is a translation management platform that helps you translate texts in your app for targeting multilingual market.
The Localizely CLI can be installed on all major platforms (MacOS, Linux, and Windows).
You can find more details about the installation below.
Download the binary for your platform, unzip it, and place the executable in the path. That's it.
Run the Localizely CLI from Docker.
docker run --rm localizely/localizely-cliNote: This requires you to have Docker installed on your system.
Clone the repo and build from the source.
Clone the repository
git clone https://github.com/localizely/localizely-cli.gitMove to the project directory
cd localizely-cliDownload project dependencies
go mod downloadBuild the project
go buildAfter successfully completing the above steps, you should see the executable for your platform in the root of the project.
Note: This requires you to have Go installed on your system.
Below you can find a brief description of the available commands.
Configure your Localizely client.
This command offers two modes: interactive and template. The first one will guide you through the configuration of your Localizely client. The second one will generate a template file that needs to be updated with your config data.
After executing this command, a configuration file (localizely.yml) will be created for you.
The interactive mode
localizely-cli initThe template mode
localizely-cli init --mode templateNote: API token entered through interactive mode is saved in the ~/.localizely/credentials.yaml file.
Pull localization files from Localizely.
Depending on your workflow, you can use this command by relying on the external configuration (the localizely.yml file), or by passing your configuration through flags.
Rely on the external configuration
localizely-cli pullPass configuration through flags
localizely-cli pull \
--api-token 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
--project-id 01234567-abcd-abcd-abcd-0123456789ab \
--file-type json \
--files "file[0]=lang/en.json","locale_code[0]=en","file[1]=lang/de_DE.json","locale_code[1]=de-DE" \
--export-empty-as empty \
--include-tags new,updated \
--exclude-tags removedPush localization files to Localizely.
Depending on your workflow, you can use this command by relying on the external configuration (the localizely.yml file), or by passing your configuration through flags.
Rely on the external configuration
localizely-cli pushPass configuration through flags
localizely-cli push \
--api-token 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
--project-id 01234567-abcd-abcd-abcd-0123456789ab \
--files "file[0]=lang/en.json","locale_code[0]=en","file[1]=lang/de_DE.json","locale_code[1]=de-DE" \
--overwrite \
--reviewed=false \
--tag-added new,new-feat-x \
--tag-updated updated,updated-feat-x \
--tag-removed removedUpdate Localizely CLI to the latest version.
This command checks if there is a newer version of the localizely-cli available. If there is, you will be prompted to confirm the update.
localizely-cli updateIf anything feels off, or you would like to propose some functionality, feel free to do it through GitHub Issue Tracker.
The following sections are intended for maintainers of the Localizely CLI.
All communication with the Localizely API goes through the localizely-client-go package, a Go client generated with OpenAPI Generator from the Localizely OpenAPI specification. Do not add hand-written API calls to this project. When the API changes, regenerate the client, release a new version of it, and update the dependency here.
The client repository is generated as a whole, including its README, so the regeneration process is documented here. The only things you need are the OpenAPI Generator CLI and the generate.sh script from that repository.
Install OpenAPI Generator (see the installation guide for other options)
brew install openapi-generatorClone the client repository
git clone https://github.com/localizely/localizely-client-go.git
cd localizely-client-goRun the script with the new package version as the only argument. It downloads the latest specification from the Localizely API, regenerates all files, and runs go mod tidy.
./generate.sh 1.2.0Review the changes, commit them, and push them together with a tag for the new version
git tag v1.2.0
git push origin main v1.2.0Update the dependency in this project
go get github.com/localizely/localizely-client-go@v1.2.0
go mod tidyNote: The script calls the openapi-generator executable, which is what the Homebrew package provides. Installing the generator through npm gives you openapi-generator-cli instead, so make sure openapi-generator is available on your path.
Releases are built and published with GoReleaser, using the configuration in the .goreleaser.yaml file. A release creates a GitHub release with binaries for Linux, macOS, and Windows, and builds and pushes the localizely/localizely-cli Docker image, tagged with the version and latest, to Docker Hub.
Before you start, make sure you have:
- GoReleaser v2 installed
- Docker running and logged in to Docker Hub (
docker login) with an account that can push to thelocalizely/localizely-clirepository - A GitHub personal access token that can create releases in this repository (the
reposcope for a classic token, or thecontents: writepermission for a fine-grained token)
Bump the Version constant in cmd/root.go to the new version and commit the change. The update command compares this constant with the latest GitHub release, so it must match the tag you are about to create.
Create a tag for the new version, prefixed with v, and push the commit together with the tag
git tag v1.0.11
git push origin main v1.0.11Export your GitHub token
export GITHUB_TOKEN=<your-token>Optionally, do a dry run that builds everything locally without publishing anything
goreleaser release --snapshot --cleanPublish the release
goreleaser release --cleanWhen the command finishes, verify the GitHub release and the Docker Hub tags, and confirm that localizely-cli update detects the new version.
Note: GoReleaser refuses to release from a working tree with uncommitted changes, or from a commit that is not tagged.