Command-Line Options

Learn advanced command-line parameters that you can use for using Localazy CLI in specific situations such as automated builds and testing.

For the most of the situations, invoking localazy upload and localazy download in the correct folder is enough. However, there are numerous parameters that you can use in specific situations.

The general usage pattern for Localazy CLI is:

localazy [command] [options] [groups]

Commands

There are only two commands:

  • upload - Run upload rules to collect files and upload them to Localazy servers for processing.
  • download - Download files from Localazy servers and run download rules on them.
  • list - List files all translated files available on the server.

Options

All these options can be applied to both upload and download commands, some of them may be applied to list command.

For help, invoke localazy [command] -h.

Option Description
-c config.json Override the configuration file name. Default: localazy.json
-k keys.json Override the keys file name. See Authorization. Default: localazy.keys.json
-r read-key Provide the readkey on the command line. See Authorization.
-w write-key Provide the writeKey on the command line. See Authorization.
-s Do not perform the actual operation, only simulate the process. No files are uploaded nor written.
-f Force the upload operation if the validation step fails.
-q Quiet mode. Print only important information.
-v The app version used for automatic versioning of deprecated phrases. See Upload Reference. Only available for the upload command.
-p key=value Provide additional parameters for transformations and conditions.

Groups

Groups allow for running only selected rules both for upload and download.

For upload, the group the collected files belongs to is sent to server as an additional information and you can later use it in your download rules to decided what to do with the files.

Let’s consider this sample configuration file:

{
  "upload": {
    "files": [

      {
        "pattern": "app/files/en.json"
      },
    
      {
        "group": "library",
        "pattern": "library/files/en.json"
      },

      {
        "group": "web",
        "pattern": "web/files/en.json"
      }

    ]
  }
}

For the first upload rule with the pattern app/files/en.json, no group is provided. Missing or empty group is considered default and is always applied.

By invoking Localazy CLI with groups provided, you can easily decide what files to upload:

  • Invoking localazy upload uploads only app/files/en.json as the default group is always applied.
  • Invoking localazy upload library uploads app/files/en.json and library/files/en.json as both the default group and the library group are applied.
  • Invoking localazy upload library web uploads all three files.

Groups are very effective for selecting resources you want to upload / download. They are also great for having the default rule for the source language and kind of all rule for initial upload of all your existing translations.

Note: You can access the group the collected files belonged to when they were uploaded but groups provided on the command line for download only filter the download rules.