Documentation section

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 most 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] [common options] [groups/subcommands] [subcommand options]

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 and conversion rules on them.
  • list - List files all translated files available on the server.
  • file - Manage (rename and delete) files on the server.
  • tag - Manage release tags - list, publish and delete tags.
  • cdn - List all files on the Localazy CDN.
  • conversion - Access information about file format conversions.

For help, invoke localazy [command] -h.

Common Options 🔗

All of the commands above require the localazy.json file and accept these command-line options:

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.
-d working-directory Set the working directory that all paths are relative to.
–no-colors Disable using colored output.

Upload Options 🔗

Option Description
-s Do not perform the actual operation, only simulate the process. No files are uploaded nor written.
-q Quiet mode. Print only important information.
-f Force the upload operation if the validation step fails.
-v The app version used for automatic versioning of deprecated phrases. See Upload Reference.
-p key=value Provide additional parameters for transformations and conditions.
–async Do not wait for the server to process the uploaded data and report errors.

Download Options 🔗

Option Description
-t tag Perform the operation for the given release tag.
-s Do not perform the actual operation, only simulate the process. No files are uploaded nor written.
-q Quiet mode. Print only important information.
-f Force the upload operation if the validation step fails.
-p key=value Provide additional parameters for transformations and conditions.

List Options 🔗

Option Description
-t tag Perform the operation for the given release tag.

Files 🔗

This command allows management of high-level files on the server and shows corresponding CDN addresses.

List files:

localazy file [common-options] list

Delete file:

localazy file [common-options] delete {fileId}

Rename file:

localazy file [common-options] rename {fileId} [-p new-path] [-f new-name]

Tags 🔗

This command allows managing release tags.

List all available tags including their publishing date and CDN addresses:

localazy tag [common-options] list

Create/publish the current translations under the tag:

localazy tag [common-options] publish {tag-name}

Remove the tag including corresponding data:

localazy tag [common-options] delete {tag-name}

Rename existing tag:

localazy tag [common-options] rename {tag-name} {new-name}

Promote tag to another one (existing or new):

localazy tag [common-options] promote {tag-name} {target-tag}

Merge tags, manipulate string keys and languages:

localazy tag [common-options] merge [merge-parameters] {source-tag} {destionation-tag} {output-tag}

See Release Tags for detailed information on all available commands and merge parameters.

CDN Options 🔗

This command lists all files available on CDN for the latest version or given release tag. Learn more about Localazy CDN.

Option Description
-t tag Perform the operation for the given release tag.

Conversions 🔗

This command allows for listing supported conversion:

localazy conversion [common-options] list

And for obtaining detailed information about selected conversion:

localazy conversion [common-options] format {conversion}

Groups 🔗

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

For upload, the group the collected files belongs to is sent to the server as 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 a kind of all rule for the 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.