---
title: "lean login"
description: "API reference for the command `lean login` in command line console."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/api-reference/lean-login
markdown: https://www.quantconnect.com/docs/v2/lean-cli/api-reference/lean-login.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/99%20API%20Reference/42%20lean%20login
modified: 2026-10-28
index: https://www.quantconnect.com/llms.txt
---

# lean login

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > [API Reference](https://www.quantconnect.com/docs/v2/lean-cli/api-reference.md) > lean login

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

Log in with a QuantConnect account.

```
$ lean login [OPTIONS]
```

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## Description

Lets you log in with your QuantConnect API credentials and stores the given values in the `credentials` file in your [global configuration](https://www.quantconnect.com/docs/v2/lean-cli/initialization/configuration.md#02-Global-Configuration) directory.

If `--user-id` or `--api-token` is not provided, an interactive prompt is shown and the missing values are read from stdin.

You can [request your user Id and API token](https://www.quantconnect.com/docs/v2/cloud-platform/community/profile.md#09-Request-API-Token) on your Account page.

## Options

The `lean login` command supports the following options:

| Option | Description |
| --- | --- |
| `-u, --user-id <string>` | QuantConnect user id |
| `-t, --api-token <string>` | QuantConnect API token |
| `--show-secrets` | Show secrets as they are input |
| `--verbose` | Enable debug logging |
| `--help` | Display the help text of the `lean login` command and exit |
