## login

Connect the CLI to your Stripe account by logging in to persist your secret key locally.

The Stripe CLI runs commands using a global configuration or project-specific configurations. To configure the CLI globally, run:

```sh
stripe login
```

You'll be redirected to the Dashboard to confirm that you want to give the CLI access to your account. After confirming, a new API key will be created for the CLI.

> All configurations are stored in `~/.config/stripe/config.toml`, including login credentials. You can use the [`XDG_CONFIG_HOME`](https://wiki.archlinux.org/index.php/XDG_Base_Directory) environment variable to override this location. The configuration file is not automatically removed when the CLI is uninstalled.

**Command:** `stripe login`

### Flags

- `-i, --interactive`
  Use interactive configuration mode if you cannot open a browser and would like to manually provide an API key.

- `--project-name=<project>`
  You can create project-specific configurations with the `--project-name` flag, which can be used in any context.
If you do not provide the `--project-name` flag for a command, it will default to the global configuration.

### Examples

**Basic login**

```sh
stripe login
```

**Log in and specify a project**

```sh
stripe login --project-name=rocket-rides
```

```
Your pairing code is: excels-champ-wins-quaint
This pairing code verifies your authentication with Stripe.
Press Enter to open the browser
...
```

**Log in using interactive mode**

```sh
stripe login --interactive
```

```
Enter your API key:
Your API key is: sk_******************************p7dc
...
```
