Initialization
Authentication
Introduction
Most of the Lean CLI commands need to communicate with the QuantConnect API. If you use any commands which interact with the cloud or deploy a live algorithm locally, you must log in using your QuantConnect account so the CLI can send authenticated API requests.
To use the CLI, you must be a member in an organization on a paid tier.
Log In
Follow these steps to log in to your QuantConnect account with the CLI:
- Request your user-id and API token.
- Retrieve your user-id and API token from the email you registered on QuantConnect.
- 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.