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

Proxy #️⃣

You can define proxy servers for the communication using the --proxy server:port command parameter. Please remember that HTTPS-compliant proxy server is required.

If your proxy requires basic authentication, you can pass the credentials as --proxy user:pass@server:port.

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.
  • languages - List languages available on Localazy including their current state.
  • 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.
  • branch - Create, list, merge and delete branches.

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.
––project {project} Specify the project slug or ID to ensure that the upload is only performed if matching write and read keys are used.
––failOnMissingGroups Fail if unknown group is provided on the command line.
–p key:value Provide additional parameters for highly dynamic configurations.
––async Do not wait for the server to process the uploaded data and report errors.
––branch Perform the operation against a specific branch. If not provided, the operation is performed against the project specified by readKey and writeKey.

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.
––failOnMissingGroups Fail if unknown group is provided on the command line.
–p key:value Provide additional parameters for highly dynamic configurations.
––branch Perform the operation against a specific branch. If not provided, the operation is performed against the project specified by readKey and writeKey.

List Options #️⃣

Option Description
–t tag Perform the operation for the given release tag.
––branch Perform the operation against a specific branch. If not provided, the operation is performed against the project specified by readKey and writeKey.

Languages Options #️⃣

Option Description
––csv Return the list in the CSV format for machine processing.
––branch Perform the operation against a specific branch. If not provided, the operation is performed against the project specified by readKey and writeKey.

File Options #️⃣

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

Option Description
––branch Perform the operation against a specific branch. If not provided, the operation is performed against the project specified by readKey and writeKey.

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]

Tag Options #️⃣

This command allows managing release tags.

Option Description
––branch Perform the operation against a specific branch. If not provided, the operation is performed against the project specified by readKey and writeKey.

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.
––branch Perform the operation against a specific branch. If not provided, the operation is performed against the project specified by readKey and writeKey.

Conversion Options #️⃣

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}

Branching #️⃣

This command allows for creating, listing, merging, and deleting branches.

See Branching for detailed information on all available commands and parameters.

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.