User Guides

Cloud synchronization

Introduction

Synchronizing from and to the cloud is a powerful feature of the Lean CLI. Synchronization allows you to work in your local development environment on projects hosted in the cloud. This page describes how the lean cloud pull and lean cloud push commands determine where to pull/push files to and how potentially unwanted destructive actions are prevented.

Pulling cloud projects

Running lean cloud pull downloads your cloud projects to your local drive. The CLI attempts to download each of them to the local directory matching the cloud project's path. If one of your cloud projects is named "My Strategy" and stored in the "Strategies" directory, the CLI attempts to download it to ./Strategies/My Strategy.

If you have two cloud projects with the same name, the first one is stored locally in ./<project name>, and the second one is stored in ./<project name> 2.

After determining where to store the project, the CLI downloads the cloud project's files, its description, and its parameters to the local directory, potentially overwriting existing files and metadata. Local files which do not exist in the cloud are not deleted. After successfully pulling the cloud project's files and parameters, the cloud project's id is saved in the local directory's config.json file. This id ensures the CLI can find which cloud project is linked to the local project the next time you try to pull or push the project.

Pushing local projects

Running lean cloud push uploads your local files to the cloud. The CLI attempts to upload all local projects to the cloud while preserving the directory structure. If your local project is located in the ./Strategies/My Strategy directory, the CLI attempts to upload it to a cloud project named "My Strategy" in a "Strategies" directory on QuantConnect.

The CLI uploads all the local project's files, its description, and its parameters to the cloud project. The cloud project is created for you if it does not exist yet and cloud files that do not exist locally are not deleted. After successfully pushing the local project's files and parameters, the id of the cloud project is stored in the local project's config.json file. This id ensures the CLI can find which cloud project is linked to the local project the next time you try to pull or push the project.

You can also see our Videos. You can also get in touch with us via Chat.

Did you find this page helpful?

Contribute to the documentation: