Initialization

Authentication

Introduction

Some of the Lean CLI commands need to communicate with the QuantConnect API. If you use any commands which interact with the cloud, you must log in using your QuantConnect account so the CLI can send authenticated API requests.

Log In

Follow these steps to log in to your QuantConnect account with the CLI:

  1. Request your user-id and API token.
  2. Retrieve your user-id and API token from the email you registered on QuantConnect.
  3. Run lean login to log in to the CLI, and enter your user-id and token when prompted. This command opens an interactive wizard asking you for your user-id and API token.
    $ lean login
    Your user Id and API token are needed to make authenticated requests to the QuantConnect API
    You can request these credentials on https://www.quantconnect.com/account
    Both will be saved in C:\Users\john\.lean\credentials
    User id: 123456
    API token: ******************
    Successfully logged in

Log Out

Run lean logout to log out. This command removes the global configuration file containing your user Id and API token.

Check Account Status

Run lean whoami to see the name and email address of the user who is currently logged in.

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

Did you find this page helpful?

Contribute to the documentation: