Tutorials

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.

Creating new projects

Follow these steps to create a new Python project:

  1. Open a terminal in the directory you ran lean init in.
  2. Run lean create-project --language python "My Python Project" to create a new project named "My Python Project".
    $ lean create-project --language python "My Python Project"
    Successfully created Python project 'My Python Project'
    This command creates the ./Project Name directory and creates a simple main.py file, a Python-based research notebook, a project configuration file, and editor configuration for PyCharm and VS Code.

Follow these steps to create a new C# project:

  1. Open a terminal in the directory you ran lean init in.
  2. Run lean create-project --language csharp "My CSharp Project" to create a new C# project named "My CSharp Project".
    $ lean create-project --language csharp "My CSharp Project"
    Successfully created C# project 'My CSharp Project'
    This command creates the ./My C# Project directory and creates a simple Main.cs file, a C#-based research notebook, a project configuration file, and editor configuration for Visual Studio, Rider, and VS Code.

You can provide a project name containing forward slashes to create a project in a subdirectory. In case any of the given subdirectories does not exist yet the CLI creates them for you.

Configuring 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'

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: