Console Client (CLI)

Crowdin CLI is a command line tool that allows you to manage and synchronize localization resources with your Crowdin project:

  • Automate the process of updating your source files in your Crowdin project
  • Download translations from Crowdin and automatically save them in the correct locations
  • Upload all your existing translations to Crowdin in minutes
  • Integrate Crowdin with GIT, SVN, Mercurial, and more.
Note: If you are using the old version of Crowdin CLI (2.0.31 or less) read the article CLI v2 for full details.

This is a cross-platform and it runs in a terminal on Linux based and macOS operating systems or in Command Prompt on Windows. It’s also open-source and it’s source code available at GitHub.

What's New

  • Multithreading for source and translation files upload
  • UX improvements: process indicators, loading states, emojis
  • Interactive generation of a configuration file
  • Bash/Zsh command completion
  • Improved help screen for commands
  • Improved configuration file validation
  • More import options for upload command
  • More export options for download command
  • Based on the new RESTful Crowdin API v2
  • Bug fixes and other improvements

Requirements

Check that you have Java 8 or newer installed. Type java -version command in the terminal (Command Prompt on Windows) to check Java version. For example, java version “1.8.0_212” means that you have Java 8 Update 212 installed.

If you don’t have Java installed, download it from Oracle’s website.

Installation

Homebrew for macOS

To install the Crowdin CLI with homebrew (the package manager for macOS):

$ brew tap crowdin/crowdin
$ brew install crowdin@3

Windows

Download and run installer for Windows.

Debian

We sign all our packages with the Crowdin Signing Key.

Download and install the public signing key:

wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -

Using the following command, create the crowdin.list file in the /etc/apt/sources.list.d directory:

echo "deb https://artifacts.crowdin.com/repo/deb/ /" > /etc/apt/sources.list.d/crowdin.list

And your repository is ready for use. You can install the Crowdin CLI Debian package with:

sudo apt-get update && sudo apt-get install crowdin3

To install the Crowdin CLI manually:

$ wget https://artifacts.crowdin.com/repo/deb/crowdin3.deb -O crowdin.deb
$ sudo dpkg -i crowdin.deb

RPM

We sign all our packages with the Crowdin Signing Key.

Download and install the public signing key:

rpm --import https://artifacts.crowdin.com/repo/GPG-KEY-crowdin

Installing from the RPM repository

Create a file called crowdin.repo in the /etc/yum.repos.d directory containing:

[crowdin]
name=Crowdin repository
baseurl=https://artifacts.crowdin.com/repo/rpm
gpgcheck=1
gpgkey=https://artifacts.crowdin.com/repo/GPG-KEY-crowdin
enabled=1

And your repository is ready for use. You can now install Crowdin CLI with one of the following commands:

sudo yum install crowdin3
sudo dnf install crowdin3

To install the Crowdin CLI manually:

$ wget https://artifacts.crowdin.com/repo/rpm/crowdin3.rpm -O crowdin.rpm
$ sudo rpm -U crowdin3.rpm

Standalone Version

Crowdin CLI can be installed as a stand-alone Java application.

Installation on Linux and macOS

  1. Download crowdin-cli.zip using the button above
  2. Unpack it
  3. Run ./install-crowdin-cli.sh in the terminal with sudo rights in order to add crowdin command to your terminal

Installation on Windows

  1. Download crowdin-cli.zip using the button above
  2. Extract it's content to the place where you want Crowdin CLI to be stored
  3. Open Command Prompt as an Administrator
    1. Click Start
    2. In the Start Search box, type cmd, and then press Ctrl+Shift+Enter
    3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue
  4. Run setup-crowdin.bat script in order to add crowdin command to the Command Prompt
  5. Restart your Command Prompt

Running the App

Use the following method to run the app:

$ crowdin

Alternative method:

$ java -jar crowdin-cli.jar

CLI

Configuration

To use Crowdin CLI you need to have a configuration file. We recommend to name it crowdin.yaml. You can create it running the command:

$ crowdin init

When calling Crowdin CLI in terminal you should be in your project root directory. Otherwise, you will have to specify a configuration file path using the --config option:

$ crowdin upload sources --config /path/to/your/config/file

Run crowdin help to get more details regarding other commands.

Sample configuration file:

"project_id": "projectId"                     #open project settings and go to API section 
"api_token": "personal-access-token"          #open profile settings and go to API & SSO > New Token > create Token
"base_path": "/project-base-path"
"base_url": "https://crowdin.com"
"preserve_hierarchy": true

"files": [
  {
      "source": "/en/**/*.json",                                          #source files filter
      "translation": "/%two_letters_code%/**/%original_file_name%"        #where translations are stored
  }
]

For more information on how to configure Crowdin CLI, read the Configuration File article.

Usage

Once the configuration file is created, you are ready to start using Crowdin CLI to manage your localization resources and automate file synchronization.

General Commands

To display help information:

$ crowdin help

To generate a skeleton configuration file:

$ crowdin init

To check configuration file for general mistakes:

$ crowdin lint

To display a list of uploaded files to Crowdin:

$ crowdin list project

Uploading Resources

To upload source files to Crowdin:

$ crowdin upload sources

To upload a single file without configuration:

$ crowdin upload sources -s path/to/your/file -t file/export/pattern -T personal-token -i project-id --base-url https://crowdin.com

Use placeholders to put appropriate variables.

To display a list of files that will be uploaded to Crowdin:

$ crowdin upload sources --dryrun

To upload existing translations to Crowdin (translations will be synchronized):

$ crowdin upload translations

To show a detailed information about the upload command:

$ crowdin upload --help

Downloading Translations

To download latest translations from Crowdin:

$ crowdin download

To download latest translations for the specific language (language codes):

$ crowdin download -l {language_code}

To display a list of latest translations from Crowdin:

$ crowdin download --dryrun

To show a detailed information about the download command:

$ crowdin download --help

Versions Management

There is no need to run a specific command to create version branches if synchronization tool is used. The version branch will be created automatically during the files upload.

To upload source files to the specified version branch:

$ crowdin upload sources -b {branch_name}

To upload translations to the specified version branch:

$ crowdin upload translations -b {branch_name}

To download translations from the specified version branch:

$ crowdin download -b {branch_name}

See Also

Was this article helpful?