To authorize the upload and download operation, you have to provide writeKey and readKey for the particular project. Select the project from your Dashboard and navigate to the Settings of your project. To obtain the keys, click on the Access keys tab.

There are several ways how you can provide the keys for the CLI tool.

Keys in the configuration file #️⃣

The simplest and most common way is to provide writeKey and readKey in the configuration file localazy.json:

{

  "writeKey": "your-apps-write-key", 
  "readKey": "your-apps-read-key",

  "upload": {},
  "download": {},
  "transformations": []
  
}

However, it may be impractical to provide the keys in the configuration file for security reasons. For example, if you share your source code on Github or other places. In such a situation, you should consider other ways of authorization described below.

Separate key file #️⃣

You can store keys in a separate file called localazy.keys.json. If such a file exists, the keys are loaded from it. You can define a different key file using the command line: localazy [command] -k keys.json

The format of the file with keys is:

{
  "writeKey": "your-apps-write-key", 
  "readKey": "your-apps-read-key"
}

Keys provided on command line #️⃣

You can also define both writeKey and readKey directly on the command line:

localazy [command] -r your-read-key -w your-write-key

Priority #️⃣

If the keys are provided using more methods, the ones to be used are resolved this way:

1. The keys from the configuration file, if provided, are used only if not provided by other way.

2. The keys from the key file have higher priority than keys from the configuration file.

3. The keys provided on the command line have the highest priority. Note that by using only writeKey or readKey on the command line, you can overwrite only the particular one.

Branching support #️⃣

In the configuration file (localazy.json), you can specify the branch to perform the operation on using the branch parameter like this:

{
  "writeKey": "your-apps-write-key", 
  "readKey": "your-apps-read-key",
  "branch": "[target branch]"
}

You can access any branch with writeKey/readKey corresponding to a different one as long as you have permission to access both of them.

See Branching for detailed information.