Projects
Project Management
Introduction
Creating new projects is an important feature of the Lean CLI. The CLI can automatically scaffold basic Python and C# projects, creating basic algorithm files, research notebooks, and the required editor configuration. Projects scaffolded by the CLI are similar to the ones created on QuantConnect, making it easy to switch between your local environment and the cloud.
Create Projects
Follow these steps to create a new Python project:
- Open a terminal in your CLI root directory.
- Run
lean create-project --language python "<projectName>"
to create a new project named <projectName>.$ lean create-project --language python "My Python Project" Successfully created Python project 'My Python Project'
Follow these steps to create a new C# project:
- Open a terminal in your CLI root directory.
- Run
lean create-project --language csharp "
to create a new C# project named <projectName>.<projectName>
"$ lean create-project --language csharp "My CSharp Project" Successfully created C# project 'My CSharp Project'
You can provide a project name containing forward slashes to create a project in a sub-directory. In case any of the given sub-directories does not exist yet, the CLI creates them for you.
Set the Default Language
It is also possible to set the default language to use when running lean create-project
:
- Run
lean config set default-language python
to set the default language to Python, after which you no longer need to provide the--language python
option to create Python projects.$ lean config set default-language python $ lean create-project "My Python Project" Successfully created Python project 'My Python Project'
- Run
lean config set default-language csharp
to set the default language to C#, after which you no longer need to provide the--language csharp
option to create C# projects.$ lean config set default-language csharp $ lean create-project "My CSharp Project" Successfully created C# project 'My CSharp Project'