> ## Documentation Index
> Fetch the complete documentation index at: https://infisical-groups-phase-3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# infisical login

> Login into Infisical from the CLI

```bash
infisical login
```

## Description

The CLI uses authentication to verify your identity. When you enter the correct email and password for your account, a token is generated and saved in your system Keyring to allow you to make future interactions with the CLI.

To change where the login credentials are stored, visit the [vaults command](./vault).

If you have added multiple users, you can switch between the users by using the [user command](./user).

### Flags

<Accordion title="--method">
  ```bash
  infisical login --method=<auth-method> # Optional, will default to 'user'.
  ```

  #### Valid values for the `method` flag are:

  * `user`: Login using email and password.
  * `universal-auth`: Login using a universal auth client ID and client secret.

  <Info>
    When `method` is set to `universal-auth`, the `client-id` and `client-secret` flags are required. Optionally you can set the `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` and `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET` environment variables instead of using the flags.

    When you authenticate with universal auth, an access token will be printed to the console upon successful login. This token can be used to authenticate with the Infisical API and the CLI by passing it in the `--token` flag when applicable.

    Use flag `--plain` along with `--silent` to print only the token in plain text when using the `universal-auth` method.
  </Info>
</Accordion>

<Accordion title="--client-id">
  ```bash
  infisical login --client-id=<client-id> # Optional, required if --method=universal-auth.
  ```

  #### Description

  The client ID of the universal auth client. This is required if the `--method` flag is set to `universal-auth`.

  <Tip>
    The `client-id` flag can be substituted with the `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` environment variable.
  </Tip>
</Accordion>

<Accordion title="--client-secret">
  ```bash
  infisical login --client-secret=<client-secret> # Optional, required if --method=universal-auth.
  ```

  #### Description

  The client secret of the universal auth client. This is required if the `--method` flag is set to `universal-auth`.

  <Tip>
    The `client-secret` flag can be substituted with the `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET` environment variable.
  </Tip>
</Accordion>
